I want all of my \subsection behave like \subsection* Instead of adding * everywhere, I like to add a few lines in the preamble. What should I do? Can I just \renewcommand?
Asked
Active
Viewed 668 times
20
2 Answers
24
Write
\setcounter{secnumdepth}{1}
in your preamble. This says to LaTeX that only first level sections should be numbered; \subsection is level 2.
As Gonzalo Medina points out, there's also the tocdepth counter that controls what section levels are included in the table of contents. LaTeX is happy to include also unnumbered section levels in the ToC, it's a matter of taste and of the document's nature how deep one should go.
egreg
- 1,121,712
6
Here is a way to redefine it. This uses the solution from Swap definition of starred and non-starred command:
\documentclass{article}
\makeatletter
\let\oldsubsection\subsection
\renewcommand\subsection{\@ifstar{\oldsubsection}{\oldsubsection*}}
\makeatother
\begin{document}
\section{First section}
\subsection{First subsection}
\end{document}
Peter Grill
- 223,288
sedfor example) would work just fine... – raphink Sep 12 '11 at 16:38