2

I use relative units to redefine the subsection as follows:

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

It works when I use the class AMSBook, However it show me the following wrong message when I use the SpringBook class '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.)

Is there any way to make the class know this relative unit: "\linespacing"?

P.S. I use "\noindent" in the last as I don't want the indent. I still get an error when I delete it.

  • please provide a small test file that shows that error, by default there is no command \linespacing so the code shown would generate an undefined command error not the error shown – David Carlisle May 29 at 22:30
  • Unrelated but the \noindent in that definition is wrong and will break the standard latex section syntax – David Carlisle May 29 at 22:31
  • @DavidCarlisle Hi. I just make the revision and attach the full test code. – X liu May 29 at 22:45
5

In amsart \linespacing is defined by

\newdimen\linespacing
\normalsize \linespacing=\baselineskip

so it's just \baselineskip as set at the document default size.

You could use the same definition in other classes, or use other font dependent values suc as ex units or simply \baselineskip

It is unlikely that the error you show is the first error, with article class the first error is

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

and you only get the missing unit error if you scroll past this error. Later errors are often spurious TeX's recovery from errors often leaves it in a state where more errors are generated.

unrelated to the error but the \noindent should not be in the definition. To suppress indentation simply negate the 4th argument of \@startsection using \noindent in the section definition will generate spurious white paragraphs

| improve this answer | |
  • Thanks. When I replace "\linespacing" by "\baselineskip". Everything works now. I also change the "\noindent" to the right position. – X liu May 29 at 23:00
  • @Xliu glad you got it working but \noindent should not be used at all. LaTeX never uses \noindent to suppress indentation after a section heading. – David Carlisle May 29 at 23:04
  • I use {0pt} as the 3rd argument. By the way, {\z@} means no setting or also set it to 0? – X liu May 29 at 23:12
  • 1
  • Yes. Just checked. Both works. Thank you. – X liu May 29 at 23:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.