Skip to content

Commit

Permalink
LaTeX template: Respect numbersections for books (#5235)
Browse files Browse the repository at this point in the history
Ensure that `\part` and `\chapter` are only numbered if `numbersections` is set. To return to the previous behaviour, use `-V numbersections -V secnumdepth=0`.

Notes on secnumdepth:

1 = Number `\section`
0 = Number `\chapter`
-1 = Number `\part`
-2 = No numbering
  • Loading branch information
adunning authored and jgm committed Jan 23, 2019
1 parent 690193e commit 3ad2255
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion data/templates/default.latex
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ $endif$
$if(numbersections)$
\setcounter{secnumdepth}{$if(secnumdepth)$$secnumdepth$$else$5$endif$}
$else$
\setcounter{secnumdepth}{0}
\setcounter{secnumdepth}{-2}
$endif$
$if(beamer)$
$else$
Expand Down
2 changes: 1 addition & 1 deletion test/lhs-test.latex
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@
\setlength{\emergencystretch}{3em} % prevent overfull lines
\providecommand{\tightlist}{%
\setlength{\itemsep}{0pt}\setlength{\parskip}{0pt}}
\setcounter{secnumdepth}{0}
\setcounter{secnumdepth}{-2}
% Redefines (sub)paragraphs to behave more like sections
\ifx\paragraph\undefined\else
\let\oldparagraph\paragraph
Expand Down
2 changes: 1 addition & 1 deletion test/lhs-test.latex+lhs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
\setlength{\emergencystretch}{3em} % prevent overfull lines
\providecommand{\tightlist}{%
\setlength{\itemsep}{0pt}\setlength{\parskip}{0pt}}
\setcounter{secnumdepth}{0}
\setcounter{secnumdepth}{-2}
% Redefines (sub)paragraphs to behave more like sections
\ifx\paragraph\undefined\else
\let\oldparagraph\paragraph
Expand Down
2 changes: 1 addition & 1 deletion test/writer.latex
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
\setlength{\emergencystretch}{3em} % prevent overfull lines
\providecommand{\tightlist}{%
\setlength{\itemsep}{0pt}\setlength{\parskip}{0pt}}
\setcounter{secnumdepth}{0}
\setcounter{secnumdepth}{-2}
% Redefines (sub)paragraphs to behave more like sections
\ifx\paragraph\undefined\else
\let\oldparagraph\paragraph
Expand Down
2 changes: 1 addition & 1 deletion test/writers-lang-and-dir.latex
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
\setlength{\emergencystretch}{3em} % prevent overfull lines
\providecommand{\tightlist}{%
\setlength{\itemsep}{0pt}\setlength{\parskip}{0pt}}
\setcounter{secnumdepth}{0}
\setcounter{secnumdepth}{-2}
% Redefines (sub)paragraphs to behave more like sections
\ifx\paragraph\undefined\else
\let\oldparagraph\paragraph
Expand Down

0 comments on commit 3ad2255

Please sign in to comment.