Springer Nature LaTeX 模板和 Tikz 问题

Springer Nature LaTeX 模板和 Tikz 问题

Springer Latex 模板不适用于 Tikz。链接:https://www.springernature.com/gp/authors/campaigns/latex-author-support 输出错误:

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

梅威瑟:

\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}

答案1

正如 Simon 在我之前发布的那样 :-) 这可以简化为


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

\usepackage{tikz}



\begin{document}



\end{document}

program|在序言中已经处于活动状态,这是相当乐观的,取消注释 catcode 设置会恢复标准行为。这可能比使用无法提交的类的本地副本更可取。

答案2

\RequirePackage{tikz}\documentclass{...}工作前

答案3

这似乎与软件包有冲突program。注释掉文件的#311行sn-jnl.cls可以解决问题。

后来又添加 \usepackage{program} tikz 运行良好。

\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

答案4

另一个解决方法是在加载其中一个包\normalbaroutside后添加该命令。像这样programsn-*

\documentclass[sn-mathphys]{sn-jnl} % or \usepackage{program}
\normalbaroutside

\usepackage{tikz-cd} % or \usepackage{tikz}

|此命令可消除环境外部的冲突行为{program}。它已在 中记录program.sty,但似乎在其他地方都没有:

% program.sty, Version 3.3.14
% Version History:
  ...
% 3.3.4: Added \ifVBarOutsideProgram switch -- The command \normalbaroutside
%        makes | to act normally outside the program environment
  ...
% Set switch to false if you want | to act normally 
% outside the program environment:
\newif\ifVBarOutsideProgram \VBarOutsideProgramtrue
\def\normalbaroutside{\catcode`\|=12 \VBarOutsideProgramfalse}
  ...

相关内容