41

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?

David Carlisle
  • 757,742
FUUNK1000
  • 673
  • 2
  • 6
  • 8
  • 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 Mar 04 '16 at 08:55
  • There is better way to redefine style of sections. – touhami Mar 04 '16 at 08: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. – David Carlisle Mar 04 '16 at 08:56

4 Answers4

47

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

PDF no section numbering

A. West
  • 571
  • 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. – Marcel Krüger Jun 03 '19 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

11

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}{}