![\documentclass{sn-jnl} 的问题](https://linux22.com/image/468612/%5Cdocumentclass%7Bsn-jnl%7D%20%E7%9A%84%E9%97%AE%E9%A2%98.png)
如果我尝试使用 pdflatex(或仅 latex)编译以下简单代码(sn-jnl.cls 是 Springer 期刊的文档类,因此我认为它被广泛使用......)
\documentclass{sn-jnl}
\usepackage{xcolor}
\begin{document}
\title{My Title}
\maketitle
\section{Introduction}
My Intro
\end{document}
我收到错误消息
Undefined control sequence. \begin{document}
并且,如果我查看日志文件,我会读到(在某个时候):
! Undefined control sequence.
\__hook begindocument ->\SetFootnoteHook
{\hspace *{-8pt}}\DeclareNewFootnot...
l.5 \begin{document}
The control sequence at the end of the top line
of your error message was never \def'ed. If you have
misspelled it (e.g., `\hobx'), type `I' and the correct
spelling (e.g., `I\hbox'). Otherwise just continue,
and I'll forget about whatever was undefined.
! Undefined control sequence.
\__hook begindocument ...8pt}}\DeclareNewFootnote
{A}[gobble]\setlength {\sk...
l.5 \begin{document}
The control sequence at the end of the top line
of your error message was never \def'ed. If you have
misspelled it (e.g., `\hobx'), type `I' and the correct
spelling (e.g., `I\hbox'). Otherwise just continue,
and I'll forget about whatever was undefined.
! Undefined control sequence.
<argument> \skip \footinsA
l.5 \begin{document}
The control sequence at the end of the top line
of your error message was never \def'ed. If you have
misspelled it (e.g., `\hobx'), type `I' and the correct
spelling (e.g., `I\hbox'). Otherwise just continue,
and I'll forget about whatever was undefined.
! Missing number, treated as zero.
<to be read again>
p
l.5 \begin{document}
A number should have been here; I inserted `0'.
(If you can't figure out why I needed to see a number,
look up `weird error' in the index to The TeXbook.)
! Undefined control sequence.
\__hook begindocument ...}}}{}\allowdisplaybreaks
\Gm@savelength {paperwidth...
l.5 \begin{document}
The control sequence at the end of the top line
of your error message was never \def'ed. If you have
misspelled it (e.g., `\hobx'), type `I' and the correct
spelling (e.g., `I\hbox'). Otherwise just continue,
and I'll forget about whatever was undefined.
实际上,在 sn-jnl.cls 中你可以看到以下几行
\AtBeginDocument{%
%%\newcommand*\ExtraParaSkip{12pt}%
\SetFootnoteHook{\hspace*{-8pt}}%
\DeclareNewFootnote{A}[gobble]%
\setlength{\skip\footinsA}{0pt}}%
我不明白这里的问题。
我从 Springer 网站下载了 sn-jnl.cls。
我在 MacOS 上使用 MikTeX。
谢谢 Maurizio
答案1
问题与如何修复过大的徽标?。
类开发人员决定避免加载该类的上一版本所加载的所有包,但这样做他们也删除了该类本身所依赖的包。他们甚至没有更改版本号!
解决方案:
\documentclass{sn-jnl}
\usepackage{amsmath}
\usepackage{manyfoot}
\usepackage{xcolor}
\begin{document}
\title{My Title}
\maketitle
\section{Introduction}
My Intro
\end{document}
答案2
我找到了一个解决方案。您必须添加 sn-jnl 自身无法加载的软件包:
\usepackage{manyfoot}
\usepackage{xcolor}
\usepackage{amsmath}
坦白说,我认为 Springer 的这篇文章太糟糕了……
您是否知道这个问题是否已在 documentclass 的某个版本中修复(但我是从 Springer 网站下载的...)???
谢谢
毛里吉奥