当我尝试使用时svmono
,它遇到了以下一些错误:
Error Missing number, treated as zero.
为此提供的帮助:
This is usually caused by a LaTeX command expecting but not finding
either a number or a length as an argument. You may have omitted an
argument, or a square bracket in the text may have been mistaken for
the beginning of an optional argument. This error is also caused by
putting \protect in front of either a length command or a command such
as \value that produces a number.
和
Error Illegal unit of measure (pt inserted).
对此的帮助:
If you just got a
! Missing number, treated as zero.
error, then this is part of the same problem. If not, it means that
LaTeX was expecting a length as an argument and found a number
instead. The most common cause of this error is writing 0 instead of
something like 0in for a length of zero, in which case typing return
should result in correct output. However, the error can also be caused
by omitting a command argument.
错误的位置位于主体的某些环境的开头quotation
。
这是一个抛出这些错误的最小工作示例:
\documentclass{svmono}
\begin{document}
\begin{quotation}
Plus grande est
\end{quotation}
\end{document}
错误出现在“g”和“r”之间:
--- TeX said ---
<to be read again>
g
l.6 Plus g
rande est
基本上,所有以“plus”或“Plus”开头的引号环境都会引发此错误。
我可以通过改写“{plus}”或“{Plus}”来解决错误,但我为什么要这样做呢?
答案1
问题在于svmono
实现quotation
环境的方式。
定义是
\renewenvironment{quotation}
{\par\addvspace{6pt}
\list{}{\listparindent12\p@%
\leftmargin=12\p@%
\itemindent \listparindent
\rightmargin \leftmargin
\parsep \z@ \@plus\p@%
\small}%
\item\relax\hskip-\listparindent}
{\endlist}
当引用以“加”或“减”开头时,这些词将被解释为用于增加或减少长度的基本 TeX 命令。因此,必须终止计算或将计算包含在组中。
因此替换行
\item\relax\hskip-\listparindent
和
\item\relax\hskip-\listparindent\relax
防止将“加”和“减”这两个词理解为运算符。