3

I try to set restarting section numbering in each chapter as well with the command.

\renewcommand\thesection{\Alph{section}.}

and get this:

A. Introduction \\ A..1 Background

How to remove one of the dot after section numbering?

If I use the code:

\documentclass[10pt,a4paper]{article}
\usepackage[latin1]{inputenc}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{graphicx}

\begin{document}

\renewcommand\thesection{\Alph{section}}
\section{Combinatorics}
\subsection{Introduction}   
\subsection{Binomial Theorem}

\end{document}

the execution builds:

A Combinatorics

A.1 Introduction

A.2 Binomial Theorem

But if I use other code:

\begin{document}

\renewcommand\thesection{\Alph{section}.}
\section{Combinatorics}
\subsection{Introduction}   
\subsection{Binomial Theorem}

\end{document}

the result is:

A. Combinatorics

A..1 Introduction

A..2 Binomial Theorem

I need the result:

A. Combinatorics

A.1. Introduction

A.2. Binomial Theorem

  • 3
    Welcome, this depends on how you managed to get two dots there in the first place. Right now, your question is abit hard to understand, as you are talking of chapters and sections. Please post a compilable minimal working example. – Johannes_B Apr 8 '17 at 7:06
  • Welcome to Tex.Se! Pl. provide a MWE, for the same. – Mishra S Apr 8 '17 at 7:09
  • 3
    You might have \renewcommand\thesubsection{\thesection.\thesubsection}, which should be \renewcommand\thesubsection{\thesection\thesubsection}. But this is a shot into the blue with a little help of my magic 8-ball. – Johannes_B Apr 8 '17 at 7:46
4

A quick hack:

\documentclass[10pt,a4paper]{article}
\usepackage[latin1]{inputenc}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{graphicx}

\begin{document}

\renewcommand\thesection{\Alph{section}.}
\renewcommand\thesubsection{\Alph{section}.\arabic{subsection}.}
\section{Combinatorics}
\subsection{Introduction}   
\subsection{Binomial Theorem}

\end{document}

enter image description here

  • @ChristianHupfer Good catch! Thank you very much for noticing! – user36296 Apr 8 '17 at 17:32
  • I noticed nothing ;-) – user31729 Apr 8 '17 at 17:36
  • 1
    @EnosLolang Please reconsider your choice of accepted answers, this one is (as a wrote) a quick hack, the much cleaner solution is the one of Christian Hupfer – user36296 Apr 9 '17 at 10:57
  • 1
    Yes, thank you. actually I prefer that one, but the lack is the two lines syntax: \renewcommand\thesection{\Alph{section}.} \renewcommand\thesubsection{\Alph{section}.\arabic{subsection}.} – Enos Lolang Apr 9 '17 at 20:17
6

Since any of the \theX (X meaning section, subsection etc down to subparagraph (?).) counter outputs should have a suffix ., the easiest way is to redefine \@seccntformat to have this trailing dot.

\documentclass[10pt,a4paper]{article}
%\usepackage[latin1]{inputenc}
%\usepackage{amsmath}
%\usepackage{amsfonts}
%\usepackage{amssymb}
%\usepackage{graphicx}

\makeatletter
\def\@seccntformat#1{\csname the#1\endcsname.\quad}
\makeatother

\begin{document}

\renewcommand\thesection{\Alph{section}}
\section{Combinatorics}
\subsection{Introduction}   
\subsection{Binomial Theorem}

\end{document}

enter image description here

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.