在序言中使用相对单位

在序言中使用相对单位

我使用相对单位重新定义该小节如下:

\documentclass[reqno,twoside]{svmult}


\makeatletter
\@addtoreset{chapter}{part}% reset chapter number when a new part starts

\renewcommand\subsection{\@startsection{subsection}{2}%
{\z@}{.7\linespacing\@plus.8\linespacing}{.3\linespacing}%
{\normalfont\bfseries\noindent}}

\renewcommand\subsubsection{\@startsection{subsubsection}{3}%
{\z@}{-.5\linespacing\@plus.5\linespacing}{.2\linespacing}%
{\normalfont\noindent\bfseries\slshape}}
\renewcommand\paragraph{\@startsection{paragraph}{4}%
{\z@}{-.5\linespacing\@plus.3\linespacing}{.2\linespacing}%
{\normalfont\noindent\color{blue}}}

\renewcommand\subparagraph{\@startsection{subparagraph}{5}%
{\z@}{-.3\linespacing\@plus.2\linespacing}{.1\linespacing}%
{\normalfont\slshape\noindent\color{blue}}}

\makeatother


\renewcommand*\thesection{\thechapter.\arabic{section}}% section 1.1
\renewcommand*\thesubsection{\thesection.\arabic{subsection}}% subsection 1.1.1
\renewcommand*\thesubsubsection{\thesubsection.\arabic{subsubsection}} %subsubsection1.1.1.1



\begin{document}
\part{A}
\chapter{AA}
\section{AAA}
\subsection{AAAA}
\subsubsection{AAAAA}
\paragraph{BBBBBBBB}
\subparagraph{BBBBBBBB}
\end{document}

当我使用类 AMSBook 时它可以工作,但是当我使用 SpringBook 类“svmult”时它显示以下错误消息。

Dimensions can be in units of em, ex, in, pt, pc,
cm, mm, dd, cc, bp, or sp; but yours is a new one!
I'll assume that you meant to say pt, for printer's points.
To recover gracefully from this error, it's best to
delete the erroneous units; e.g., type `2' to delete
two letters. (See Chapter 27 of The TeXbook.)

有什么办法可以让班级知道这一点相对单位: “\行间距”?

附言我最后使用了“\noindent”,因为我不需要缩进。删除它时仍然会出错。

答案1

在 amsart 中\linespacing定义为

\newdimen\linespacing
\normalsize \linespacing=\baselineskip

所以它就像\baselineskip文档默认大小一样设置。

您可以在其他类中使用相同的定义,或者使用其他字体相关值(如ex单位)或简单\baselineskip

您显示的错误不太可能是第一个错误,对于article类,第一个错误是

! Undefined control sequence.
<argument> .7\linespacing 
                          \@plus .8\linespacing 
l.11 \subsection
                {aaa}
? 

如果您滚动浏览此错误,则只会看到缺失单元错误。 后面的错误通常是虚假的 TeX 从错误中恢复时,通常会使其处于生成更多错误的状态。

与错误无关,但不应\noindent在定义中。要抑制缩进,只需否定在节定义中\@startsection使用的第 4 个参数,就会生成虚假的白色段落\noindent

相关内容