Hi,
I have been been stumbling through modifying a class file designed for formatting books, and at some point (after changing some macro names), I started to get the following error:
! Undefined control sequence.
<everypar> ...ubpenalty \@M \begingroup \@svsechd
\endgroup \unskip \@tempsk...
Now there are several things that are strange about this, at least to my LaTeX-unsophisticated mind:
1) Nowhere in the current code I'm working on nor in the article.cls file I'm referencing does either the symbol \@svsechd nor the encompassing code show up at all, so I don't understand where the error is being generated.
2) I DID find the variable and the encompassing code fragment after grepping it my LaTeX tree -- it turns up exclusively in pdfslide/slide.clo . YET not only does my Latex stuff make no reference to slide.clo, but also when I compile the LaTeX source and generate the error, I can verify (using 'ls -lut') that the above file isn't even accessed!
So, where is the reference to \@svsechd coming from? Why does code show up that appears cloned from an unrelated .clo file that's not even being accessed? What do I need to do to get rid of the error?
After about an hour's work, I was able to strip my original files down to a very simple working example, keeping only the lines in the original .cls file that I was able to isolate as generating the error. I ran it on two different computers (both Macs, one with TeXLive 2009, the other with TeXLive 2010). Here is the whole thing:
\documentclass{article}
\makeatletter
\newcommand\runinhead{\@startsection{paragraph}{4}{\z@}%
{-6\p@}%
{-6\p@}%
{\normalfont\normalsize\bfseries\boldmath
\rightskip=\z@ \@plus 8em\pretolerance=10000 }}
\def\@sect#1#2#3#4#5#6[#7]#8{%
\@xsect{#5}
}
\makeatother
\begin{document}
\runinhead{x}
\end{document}
Generally speaking, is there a good reference for low-level \@ commands of the type this fragment apparently relies on? For various reasons, I suspect it's the invocation to \@xsect that triggers the error.
Thanks
Grant
General ⇒ strange "undefined control sequence" error
NEW: TikZ book now 40% off at Amazon.com for a short time.

- Stefan Kottwitz
- Site Admin
- Posts: 10348
- Joined: Mon Mar 10, 2008 9:44 pm
strange "undefined control sequence" error
Hi Grant,
welcome to the board!
You made a very good minimal example to demonstrate the problem.
in a terminal window or use kpsewhich and your favorite editor.
Stefan
welcome to the board!
You made a very good minimal example to demonstrate the problem.
I recommend to look into source2e.pdf. Just use texdoc in the terminal:grant909 wrote:Generally speaking, is there a good reference for low-level \@ commands of the type this fragment apparently relies on?
Code: Select all
texdoc source2e
The problem is caused by your redefinition of \@sect. Originally, it defines \@svsechd, you didn't. Have a look in latex.ltx for this. For example, just typegrant909 wrote:For various reasons, I suspect it's the invocation to \@xsect that triggers the error.
Code: Select all
less `kpsewhich latex.ltx`
Stefan
LaTeX.org admin