[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: latex \renewcommand trouble

* Shao Zhang <shao@linuxfreak.com> writes:

> 	\renewcommand{\subsection}{\@startsection
> 	{subsection}%
> 	{2}%
> 	{0mm}%
> 	{0.5\baselineskip}%
> 	{0.5\baselineskip}%
> 	{\normalfont\normalsize\itshape}}%

> 	But when I use it with something like \subsection{hello}

> 	I got the following error:

> 	Document Class: article 1999/01/07 v1.4a Standard LaTeX document
> 	class
> 	(/usr/share/texmf/tex/latex/base/size12.clo)) (hello.aux)
> 	! You can't use `\spacefactor' in vertical mode.

Provided that your definition is correct otherwise, you still need to
put a \makeatletter before and a \makeatother after the \renewcommand if
you are doing the re-definition in a normal document. The alternative is
to use a private style file where this is not necessary.


PS: This is so specific that you would have gotten better and faster
    answers in a special (La)TeX forum, e.g. the comp.text.tex

Colin Marquardt <colin.marquardt@gmx.de>

Reply to: