0

I'm going crazy! I would like to customize the title of the \subsection. The numbering should be 1.1 ... 1.2 ... 1.3 ... etc. Also I would like to set the distance between the number and the description to be about 35mm. Is it possible? Thanks a lot!

\documentclass[a4paper,12pt]{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{titlesec}

\titleformat{\subsection}{\Large}

\begin{document}

\subsection{First Section}

\subsection{Second Section}

\end{document}
5

1 Answer 1

1

I'm not sure what you really want. The divisional ordering for the article class is (forgetting about \part) \section, \subsection, \subsubsection, etc. Do you only want \subsection with no \section?

If you want both \section and \subsection then put a \section{some section title} before any \subsection.

If you only want \subsection with numbering 1.1, 1.2, 1.3 etc then change the printing of the subsection counter. Put the following in your preamble:

\renewcommand{\thesubsection}{1.\arabic{subsection}}

EDIT

The following is a more flexible way. Among other things the \section command increments the section number. Also by default the section number is placed before the number of a subsection.

Define a command to increment the section number, called say \upsecnum and use this before a block of subsections.

For example:

% subsecprob.tex  SE 580322
\documentclass{article}
\newcommand{\upsecnum}{\refstepcounter{section}}

\begin{document}

\upsecnum       % start a subsection block
\subsection{One}
\subsection{Two}
\subsection{Three} \label{subsec}
Now start a new block of subsections. \verb|\upsecnum|

\upsecnum
\subsection{Uno}
\subsection{Duo}
\subsection{Tres}
The third subsection overall is \ref{subsec}.

\setcounter{section}{0} % reinitialise section numbering
\section{A section}

\subsection{Eins}
\subsection{Zwei}
\subsection{Drei}

\end{document}

enter image description here

1
  • Perfect! Thank you!
    – Andy Toff
    Commented Jan 26, 2021 at 9:28

You must log in to answer this question.

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