Hello everyone,
could someone please tell me how I can put a period after section numbers (without then having two periods between a section and a subsection number)?
Thanks!!
Page Layout ⇒ Period after section number
NEW: TikZ book now 40% off at Amazon.com for a short time.

Period after section number
Hi,
for the standard document classes you can use the titlesec package. Take a look at the following example:
Addendum: of course, my previous response will place a period after section numbers only (as originally requested). If the period must appear after every sectional unit (from sections down), then a redefinition of \@seccntformat would be a better choice:
In fact, the previous code can be modified to allow the period to appear only on certain sectional units (without using additional packages); the following example code will produce a perior after the section and subsubsection numbers, but not after the subsection numbers:
for the standard document classes you can use the titlesec package. Take a look at the following example:
Code: Select all
Code, edit and compile here:
\documentclass{article}\usepackage{titlesec}\titleformat{\section}{\normalfont\Large\bfseries}{\thesection.}{1em}{}\begin{document}\section{Test section}\subsection{Test subsection}\end{document}
Code: Select all
Code, edit and compile here:
\documentclass{article}\makeatletter\renewcommand\@seccntformat[1]{\csname the#1\endcsname.\quad}\makeatother\begin{document}\section{Test section}\subsection{Test subsection}\subsubsection{Test subsubsection}\end{document}
Code: Select all
Code, edit and compile here:
\documentclass{article}\makeatletter\renewcommand\@seccntformat[1]{%\@ifundefined{#1@cntformat}%{\csname the#1\endcsname\quad}%{\csname #1@cntformat\endcsname}}\newcommand\section@cntformat{\thesection.\quad}\newcommand\subsubsection@cntformat{\thesubsubsection.\quad}\makeatother\begin{document}\section{Test section}\subsection{Test subsection}\subsubsection{Test subsubsection}\end{document}
1,1,2,3,5,8,13,21,34,55,89,144,233,...
Re: Period after section number
Thank you a lot for your indepth response. I tried your first solution and just added commands for subsection etc., but your second solution seems cleaner so I think I'll use that.
Thanks again!
Thanks again!