Springer Nature LaTeX Template and Tikz Issue

2,800

Solution 1

As Simon posted a second before me:-) This can be simplified to


\documentclass{article}
\usepackage{program}
%\catcode`\|=12\relax

\usepackage{tikz}



\begin{document}



\end{document}

The program package makes | active already in the preamble which is rather optimistic, uncommenting the catcode setting restores the standard behaviour. this is probably preferable than using a local copy of the class that will not work for submission.

Solution 2

\RequirePackage{tikz} before \documentclass{...} works

Solution 3

It seems to be a conflict with the package program. Commenting the line #311 of the file sn-jnl.cls makes the problem go away.

And later adding \usepackage{program} after tikz works fine.

\documentclass[referee,sn-basic]{sn-jnl} %  using .cls edited

\jyear{2021}%


%\usepackage{program}% <<<<<<<<<<<<<this fails
\usepackage{tikz}
\usepackage{program}% <<<<<<<<<<<<< works OK

\begin{document}
    
    \title[Article Title]{Article Title}
    
    \author*[1,2]{\fnm{First} \sur{Author}}\email{[email protected]}
    
    \affil*[1]{\orgdiv{Department}, \orgname{Organization}, \orgaddress{\street{Street}, \city{City}, \postcode{100190}, \state{State}, \country{Country}}}
    
    \affil[2]{\orgdiv{Department}, \orgname{Organization}, \orgaddress{\street{Street}, \city{City}, \postcode{10587}, \state{State}, \country{Country}}}
    
    
    \abstract{abc}
    
    \maketitle
    
    \section{Introduction}\label{sec1}  
    
\end{document}

A

Share:
2,800

Related videos on Youtube

A Mani
Author by

A Mani

A. Mani is a leading researcher on the foundations of rough sets, algebra, logic, rough sets, AIML, vagueness, mereology and FOM. Her interests include algebraic semantics, granularity, clustering, other formal approaches to vagueness, education research and gender studies. She is a research scientist at ISI, Kolkata, a senior member (elected) of the International Rough Set Society and was a visiting faculty at HBCSE, TIFR Mumbai till recently. Her homepage is at https://www.logicamani.in She has over twelve years of experience in providing part-time consulting services in soft and statistical computing and GNU/R, and has a long association with the free software movement.

Updated on January 19, 2022

Comments

  • A Mani
    A Mani 9 months

    The springer latex template is not working with Tikz. Link: https://www.springernature.com/gp/authors/campaigns/latex-author-support Output error:

    l.16 \input
                pgfmathfunctions.code.tex
    ! Missing \endcsname inserted.
    <to be read again> 
                       \let 
    

    MWE:

    \documentclass[referee,sn-basic]{sn-jnl}
    
    \jyear{2021}%
    
    \usepackage{tikz}
    
    \begin{document}
    
    \title[Article Title]{Article Title}
    
    \author*[1,2]{\fnm{First} \sur{Author}}\email{[email protected]}
    
    \affil*[1]{\orgdiv{Department}, \orgname{Organization}, \orgaddress{\street{Street}, \city{City}, \postcode{100190}, \state{State}, \country{Country}}}
    
    \affil[2]{\orgdiv{Department}, \orgname{Organization}, \orgaddress{\street{Street}, \city{City}, \postcode{10587}, \state{State}, \country{Country}}}
    
    
    \abstract{abc}
    
    \maketitle
    
    \section{Introduction}\label{sec1}
    
    
    \end{document}
    
  • David Carlisle
    David Carlisle about 1 year
    it only works to load program after you have edited the class not to load it (and you can't use an edited class for submission to Springer (you could try complaining to springer and getting them to not include the progtam package though)
  • A Mani
    A Mani about 1 year
    \RequirePackage{tikz} solves the problem. So this is another example where \RequirePackage{} is actually useful.
  • David Carlisle
    David Carlisle about 1 year
    @AMani no. \RequirePackage is identical to \usepacklage they do not have two definitions one is literally a copy of the other using \let , usepackage is defined by \let\usepackage\RequirePackage oh, before the class, OK. (but it only works for this example, if you actually use | anywhere it will be broken by the program package,.
  • Arne
    Arne about 1 year
    My saviour! Thanks.
  • Usual_Learner
    Usual_Learner 6 months
    @AMani, Hello ma'am.. It's been a long time. Hopefully, you'd see this! Actually I am facing the same issue at the moment. I tried your approach, but it's not working. Would you tell me what exactly did you do back then? Did you edit the class file as suggested by @Simon?
  • A Mani
    A Mani 6 months
    No I did not edit the class file. My preamble: \RequirePackage{tikz} \usetikzlibrary{shapes,arrows} \documentclass[referee,sn-mathphys]{sn-jnl} \usepackage{amsmath} etc