6

Every time I call \section{**Section Name**}, a number appears to the left of the name of the section.

How do I hide this number?

  • 8
    Use \section*{My section} – user11232 Sep 16 '12 at 17:32
  • 4
    Or \setcounter{secnumdepth}{0}. – Heiko Oberdiek Sep 16 '12 at 18:40
  • 5
    This is a very reasonable, but pretty elementary question. I recommend studying The Not so short guide to LaTeX; in particular, pg 41 describes section* :) – cmhughes Sep 16 '12 at 18:52
11

You may use

\section*{My section}

to get un-numbered sections. For details refer to The Not So Short Guide to LaTeX. (Page 41 describes \section*) (Thanks to @cmhughes for the link)

As per Heiko's suggestion, you can also use

\setcounter{secnumdepth}{0}

A MWE:

\documentclass[]{article}
\usepackage{lipsum}
\begin{document}
\section*{My section}
\lipsum[1]
\setcounter{secnumdepth}{0}
\section{Another section}
\lipsum[2]
\end{document}

In the KOMA-Script classes there’s an additional possibility with (among others) \addsec. Quote scrguien.pdf (English documentation):

In addition to the commands of the standard classes, KOMA-Script offers the new commands \addsec and \addchap. They are similar to the standard commands \chapter and \section, except that they are unnumbered. They thus produce both a running heading and an entry in the table of contents.

  • hm. But setting \setcounter{secnumdepth}{0} doesn't allow for \ref to work :-( But I do want to refer the sections by numbers, because the PDF structure still gives you that information. So I somehow need a way to just hide the number but without breaking \ref. – Frederick Nord Feb 12 '13 at 15:20

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.