From 75814246501b895fe491c017f6fe43ce2ee78030 Mon Sep 17 00:00:00 2001 From: Andrew Dunning Date: Sat, 19 Jan 2019 21:01:23 -0500 Subject: [PATCH 1/2] LaTeX template: Respect `numbersections` for books Ensure that `\part` and `\chapter` are only numbered if `numbersections` is set. To return to the previous behaviour, use `-V numbersections -V secnumdepth=0`. --- data/templates/default.latex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/data/templates/default.latex b/data/templates/default.latex index b9dbbb774304..c1d96cdf0fc7 100644 --- a/data/templates/default.latex +++ b/data/templates/default.latex @@ -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$ From e71a1e58adde306882d37ae164c9c936c15e1dd3 Mon Sep 17 00:00:00 2001 From: Andrew Dunning Date: Sat, 19 Jan 2019 21:04:59 -0500 Subject: [PATCH 2/2] Update LaTeX tests for secnumdepth --- test/lhs-test.latex | 2 +- test/lhs-test.latex+lhs | 2 +- test/writer.latex | 2 +- test/writers-lang-and-dir.latex | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/test/lhs-test.latex b/test/lhs-test.latex index f18af737c823..da7dfe6a0d35 100644 --- a/test/lhs-test.latex +++ b/test/lhs-test.latex @@ -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 diff --git a/test/lhs-test.latex+lhs b/test/lhs-test.latex+lhs index dc6f2803bfe9..e959a5e7cb0e 100644 --- a/test/lhs-test.latex+lhs +++ b/test/lhs-test.latex+lhs @@ -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 diff --git a/test/writer.latex b/test/writer.latex index d801e15904e8..04ba7cd15975 100644 --- a/test/writer.latex +++ b/test/writer.latex @@ -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 diff --git a/test/writers-lang-and-dir.latex b/test/writers-lang-and-dir.latex index bb3575771482..8c75341e3176 100644 --- a/test/writers-lang-and-dir.latex +++ b/test/writers-lang-and-dir.latex @@ -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