43

I have the next code:

\documentclass[a4paper,openright, 12pt]{article}
\usepackage[utf8]{inputenc}

\usepackage{fullpage}
\newcommand{\ssection}[1]{%
\section[#1]{\centering\normalfont\scshape #1}}
\newcommand{\ssubsection}[1]{%
\subsection[#1]{\bfseries\normalfont\scshape #1}}
\newcommand{\ssubsubsection}[1]{%
\ssubsubsection[#1]{\bfseries\normalfont\scshape #1}}

\begin{document}
\ssection{Special relativity}
  bla bla bla
\ssubsection{Lorentz's transformation}
  bla bla bla
\ssubsection{Minkowski space-time}
  bla bla bla
 \end{document}

anyone know how to remove the sections numbering?

And if I use:

\documentclass[a4paper,openright, 16pt]{article}

Why the letters are not bigger?

3
  • 4
    with standard class article is one you have only 10,11,12pt you can try with extarticle class there is 14pt, 17pt and even more. For section numbering use \setcounter{secnumdepth}{0}
    – touhami
    Commented Mar 4, 2016 at 8:55
  • There is better way to redefine style of sections.
    – touhami
    Commented Mar 4, 2016 at 8:56
  • 3
    You have tagged this titlesec which is a package that would allow you to properly declare section formatting but you have not used that package at all and are placing formatting commands in the argument of \section which is just wrong thing to do. Commented Mar 4, 2016 at 8:56

4 Answers 4

50

Add \setcounter{secnumdepth}{0} to preamble.

PDF no section numbering

1
  • 1
    Welcome to TeX StackExchange. Maybe you could add some information how this differs from the other answers? What are the advantages? Are there disadvantages? Also the same answer was given in a comment by touhami, maybe you can mention that. Commented Jun 3, 2019 at 14:04
37
  • To center the sections, you could for example use the sectsty package
  • One way to remove the numbers from the sections is to use unnumbered sections denoted by the stars.

\documentclass[a4paper,openright, 12pt]{article}
\usepackage{sectsty}

\allsectionsfont{\centering}

\begin{document}

    \section*{Special relativity}
    bla bla bla
    \subsection*{Lorentz's transformation}
    bla bla bla
    \subsection*{Minkowski space-time}
    bla bla bla

\end{document}

enter image description here

1
12

To remove section numbering but keep references to the section you can add this to your preamble:

\makeatletter
\renewcommand{\@seccntformat}[1]{}
\makeatother
5

If you want to remove the numbering from the sections and not from the table of contensts try this :

\usepackage{titlesec}
\titleformat{\section}{\normalfont\Large\bfseries}{}{0pt}{}

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .