Quantcast
Channel: Redefining \section to mean \section* - TeX - LaTeX Stack Exchange
Viewing all articles
Browse latest Browse all 4

Redefining \section to mean \section*

$
0
0

I'm sorry if this is a duplicate, however I couldn't seem to find an exact answer to this anywhere. I am typing up a paper in LaTeX, and for ease of typing (although not that much admittedly), I would like to redefine the \section command so it doesn't give section numbers (ie is the same as \section*).

Initially, I naively tried \renewcommand{\section}{\section*}, however of course this led to an infinite recursion (since \section* is defined using \section), so didn't work. Next, having done a bit of research, it appeared I could circumvent this by doing (in the preamble):

\let\oldsection\section*\renewcommand{\section}{\oldsection}

However this returned the error:

! LaTeX Error: Missing \begin{document}.See the LaTeX manual or LaTeX Companion for explanation.Type  H <return>  for immediate help. ...                                              l.13 \let\oldsection\section*

I believe the error relates to the use of \section* in the \let command, however am not sure exactly what is wrong.

I know I could sort this out by doing:

\let\oldsection\section\renewcommand{\section*}{\oldsection}

however I feel this isn't in the spirit of laziness which started me in this, and I would like (if possible), a solution which still allows me to use \section it optimal.

I suspect the solution may lie in a redefinition of the numbering rules for \section (which would be ok, however not ideal), however any help is greatly appreciated!


Viewing all articles
Browse latest Browse all 4

Latest Images

Trending Articles





Latest Images