Merge pull request #74 from umanovskis/master

Add support for first-chapter variable
This commit is contained in:
Pascal Wagler 2018-12-22 12:22:55 +01:00 committed by GitHub
commit 7630b2c88c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 1 deletions

View File

@ -108,6 +108,10 @@ This template defines some new variables to control the appearance of the title
the width of the logo (in points)
- `first-chapter` (defaults to `1`)
if typesetting a book with chapter numbers, specifies the number that will be assigned to the first chapter
## Examples
### Numbered Sections
@ -171,7 +175,7 @@ pandoc example.md -o example.pdf --template eisvogel -V lang=de
To typeset a book supply the template variable `-V book`.
To get the correct chapter headings you need to tell pandoc that it should convert first level headings (indicated by one `#` in markdown) to chapters with the command line option `--top-level-division=chapter`.
To get the correct chapter headings you need to tell pandoc that it should convert first level headings (indicated by one `#` in markdown) to chapters with the command line option `--top-level-division=chapter`. Chapter numbers start at 1. If you need to change that, specify `first-chapter` in the template variables.
There will be one blank page before each chapter because the template is two-sided per default. So if you plan to publish your book as a PDF and don't need a blank page you should add the class option `onesided` which can be done by supplying a template variable `-V classoption=oneside`.

View File

@ -736,6 +736,11 @@ $abstract$
$endif$
$endif$
$if(first-chapter)$
\setcounter{chapter}{$first-chapter$}
\addtocounter{chapter}{-1}
$endif$
$for(include-before)$
$include-before$