diff --git a/CHANGELOG.md b/CHANGELOG.md index 718f89a..d369332 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,29 @@ All notable changes to this project are documented in this file. On the [releases page](https://github.com/Wandmalfarbe/pandoc-latex-template/releases/) you can see all released versions of the Eisvogel template and download the [latest version](https://github.com/Wandmalfarbe/pandoc-latex-template/releases/latest). +## [Unreleased] + +## [2024-05-20] + +### Added +- Custom colors for headings, captions, blockquotes, and listings. +- Custom commands `\customheading` and `\customcaption` for flexible styling. +- Support for custom background images on title pages and all pages. +- Flexible geometry settings for title page layout. +- Enhanced handling of paragraph and list spacing. +- New variables for header and footer customization: 'header-left','header-center', 'header-right', `footer-center`, `footer-left`, and `footer-right`. +- Customizable copyright text (default usage for footer-left) through a new `\copyrighttext` macro. + +### Changed +- Updated README.md to include detailed instructions on using and customizing the template. +- Integrated custom styling options directly into the template for better user experience. +- Enhanced flexibility for setting date values via the `date` variable. +- Default behavior for `footer-right` now includes the total page count (`\thepage{} / \pageref{LastPage}`). + +### Fixed +- Minor formatting issues and improved compatibility with various LaTeX distributions. +- Corrected handling of page numbers in the footer to prevent duplication. + ## [2.4.2] - 2023-11-25 - Merge changes from the pandoc default LaTeX template from version 3.1.9 ([f7d8b62](https://github.com/jgm/pandoc-templates/commit/f7d8b629330074a4400d1f2795b101d14491c968)). diff --git a/README.md b/README.md index 99ad913..0affcc2 100644 --- a/README.md +++ b/README.md @@ -39,189 +39,188 @@ docker run --rm \ For frequent command line use, you can define the following shell alias: -``` bash +``` +bash +Copy code alias pandock='docker run --rm -v "$(pwd):/data" -u $(id -u):$(id -g) pandoc/extra' ``` The example invocation with Docker from above now looks like this: -``` bash +``` +bash +Copy code pandock example.md -o example.pdf --template eisvogel --listings ``` -[pandoc/extra]: https://hub.docker.com/r/pandoc/extra - ## Usage -1. Open the terminal and navigate to the folder where your markdown file is located. +1. Open the terminal and navigate to the folder where your markdown file is located. -2. Execute the following command +2. Execute the following command - ``` bash - pandoc example.md -o example.pdf --from markdown --template eisvogel --listings - ``` + ``` + bash + Copy code + pandoc example.md -o example.pdf --from markdown --template eisvogel --listings + ``` - where `example.md` is the markdown file you want to convert to PDF. + where `example.md` is the markdown file you want to convert to PDF. -In order to have nice headers and footers you need to supply metadata to your document. You can do that with a [YAML metadata block](http://pandoc.org/MANUAL.html#extension-yaml_metadata_block) at the top of your markdown document (see the [example markdown file](examples/basic-example/document.md)). Your markdown document may look like the following: +In order to have nice headers and footers you need to supply metadata to your document. You can do that with a [YAML metadata block](http://pandoc.org/MANUAL.html#extension-yaml_metadata_block) at the top of your markdown document (see the [example markdown file](https://github.com/Wandmalfarbe/pandoc-latex-template/blob/master/examples/basic-example/document.md)). Your markdown document may look like the following: -``` markdown ---- +``` +yamlCopy code--- title: "The Document Title" author: [Example Author, Another Author] date: "2017-02-20" keywords: [Markdown, Example] ... - -Here is the actual document text... ``` ### Custom Template Variables This template defines some new variables to control the appearance of the resulting PDF document. The existing template variables from pandoc are all supported and their documentation can be found in [the pandoc manual](https://pandoc.org/MANUAL.html#variables-for-latex). - - `titlepage` (defaults to `false`) +- `titlepage` (defaults to `false`) - turns on the title page when `true` + turns on the title page when `true` - - `titlepage-color` +- `titlepage-color` - the background color of the title page. The color value must be given as an HTML hex color like `D8DE2C` without the leading number sign (`#`). When specifying the color in YAML, it is advisable to enclose it in quotes like so `titlepage-color: "D8DE2C"` to avoid the truncation of the color (e.g. `000000` becoming `0`). + the background color of the title page. The color value must be given as an HTML hex color like `D8DE2C` without the leading number sign (`#`). When specifying the color in YAML, it is advisable to enclose it in quotes like so `titlepage-color: "D8DE2C"` to avoid the truncation of the color (e.g. `000000` becoming `0`). - - `titlepage-text-color` (defaults to `5F5F5F`) +- `titlepage-text-color` (defaults to `5F5F5F`) - the text color of the title page + the text color of the title page - - `titlepage-rule-color` (defaults to `435488`) +- `titlepage-rule-color` (defaults to `435488`) - the color of the rule on the top of the title page + the color of the rule on the top of the title page - - `titlepage-rule-height` (defaults to `4`) +- `titlepage-rule-height` (defaults to `4`) - the height of the rule on the top of the title page (in points) + the height of the rule on the top of the title page (in points) - - `titlepage-logo` +- `titlepage-logo` - path to an image that will be displayed on the title page. The path is always relative to where pandoc is executed. The option `--resource-path` has no effect. + path to an image that will be displayed on the title page. The path is always relative to where pandoc is executed. The option `--resource-path` has no effect. - - `titlepage-background` +- `titlepage-background` - the path to a background image for the title page. The background image is scaled to cover the entire page. In the examples folder under `titlepage-background` are a few example background images. + the path to a background image for the title page. The background image is scaled to cover the entire page. In the examples folder under `titlepage-background` are a few example background images. - - `page-background` +- `page-background` - the path to a background image for any page. The background image is scaled to cover the entire page. In the examples folder under `page-background` are a few example background images. + the path to a background image for any page. The background image is scaled to cover the entire page. In the examples folder under `page-background` are a few example background images. - - `page-background-opacity` (defaults to `0.2`) +- `page-background-opacity` (defaults to `0.2`) - the background image opacity + the background image opacity - - `caption-justification` (defaults to `raggedright`) +- `caption-justification` (defaults to `raggedright`) - justification setting for captions (uses the `justification` parameter of the [caption](https://ctan.org/pkg/caption?lang=en) package) + justification setting for captions (uses the `justification` parameter of the [caption](https://ctan.org/pkg/caption?lang=en) package) - - `toc-own-page` (defaults to `false`) +- `toc-own-page` (defaults to `false`) - begin new page after table of contents, when `true` + begin new page after table of contents, when `true` - - `listings-disable-line-numbers` (defaults to `false`) +- `listings-disable-line-numbers` (defaults to `false`) - disables line numbers for all listings + disables line numbers for all listings - - `listings-no-page-break` (defaults to `false`) +- `listings-no-page-break` (defaults to `false`) - avoid page break inside listings + avoid page break inside listings - - `disable-header-and-footer` (default to `false`) +- `disable-header-and-footer` (defaults to `false`) - disables the header and footer completely on all pages + disables the header and footer completely on all pages - - `header-left` (defaults to the title) +- `header-left` (defaults to the title) - the text on the left side of the header + the text on the left side of the header - - `header-center` +- `header-center` - the text in the center of the header + the text in the center of the header - - `header-right` (defaults to the date) +- `header-right` (defaults to the date) - the text on the right side of the header + the text on the right side of the header - - `footer-left` (defaults to the author) +- `footer-left` (defaults to the author) - the text on the left side of the footer + the text on the left side of the footer - - `footer-center` +- `footer-center` - the text in the center of the footer + the text in the center of the footer - - `footer-right` (defaults to the page number) +- `footer-right` (defaults to the page number) - the text on the right side of the footer + the text on the right side of the footer - - `footnotes-pretty` (defaults to `false`) +- `footnotes-pretty` (defaults to `false`) - prettifies formatting of footnotes (requires package `footmisc`) + prettifies formatting of footnotes (requires package `footmisc`) - - `footnotes-disable-backlinks` (defaults to `false`) +- `footnotes-disable-backlinks` (defaults to `false`) - disables making the reference from the footnote at the bottom of the page into a link back to the occurrence of the footnote in the main text (enabling requires package `footnotebackref`). + disables making the reference from the footnote at the bottom of the page into a link back to the occurrence of the footnote in the main text (enabling requires package `footnotebackref`). - - `book` (defaults to `false`) +- `book` (defaults to `false`) - typeset as book + typeset as book - - `logo-width` (defaults to `35mm`) +- `logo-width` (defaults to `35mm`) - the width of the logo. One needs to specify the width with a (TeX) unit e.g. `100pt` or `35mm`. The following units can be used: + the width of the logo. One needs to specify the width with a (TeX) unit e.g. `100pt` or `35mm`. The following units can be used: - - `pt`: Point - - `pc`: pica (12 `pt`) - - `in`: inch (72.27 `pt`) - - `bp`: Big point (72 `bp` = 1 `in`) - - `cm`: Centimeter - - `mm`: Millimeter - - `dd`: Didot point - - `cc`: cicero (12 `dd`) - - `sp`: Scaled point (65,536 `sp` = 1 `pt`) - - `ex`: Nomimal x-height - - `em`: Nominal m-width - - `px`: Pixel (only for pdfTeX and LuaTeX) The dimension given to the `\pdfpxdimen` primitive; default value is 1 `bp`, corresponding to a pixel density of 72 dpi. + - `pt`: Point + - `pc`: pica (12 `pt`) + - `in`: inch (72.27 `pt`) + - `bp`: Big point (72 `bp` = 1 `in`) + - `cm`: Centimeter + - `mm`: Millimeter + - `dd`: Didot point + - `cc`: cicero (12 `dd`) + - `sp`: Scaled point (65,536 `sp` = 1 `pt`) + - `ex`: Nomimal x-height + - `em`: Nominal m-width + - `px`: Pixel (only for pdfTeX and LuaTeX) The dimension given to the `\pdfpxdimen` primitive; default value is 1 `bp`, corresponding to a pixel density of 72 dpi. - A visual overview of the length units is available at . + A visual overview of the length units is available at https://github.com/tweh/tex-units. - - `first-chapter` (defaults to `1`) +- `first-chapter` (defaults to `1`) - if typesetting a book with chapter numbers, specifies the number that will be assigned to the first chapter + if typesetting a book with chapter numbers, specifies the number that will be assigned to the first chapter - - `float-placement-figure` (defaults to `H`) +- `float-placement-figure` (defaults to `H`) - Reset the default placement specifier for figure environments to the supplied value e.g. `htbp`. The available specifiers are listed below. The first four placement specifiers can be combined. + Reset the default placement specifier for figure environments to the supplied value e.g. `htbp`. The available specifiers are listed below. The first four placement specifiers can be combined. - 1. `h`: Place the float *here*, i.e., approximately at the same point it occurs in the source text. - 2. `t`: Place the float at the *top* of the page. - 3. `b`: Place the float at the *bottom* of the page. - 4. `p`: Place the float on the next *page* that will contain only floats like figures and tables. - 5. `H`: Place the float *HERE* (exactly where it occurs in the source text). The `H` specifier is provided by the [float package](https://ctan.org/pkg/float) and may not be used in conjunction with any other placement specifiers. + 1. `h`: Place the float *here*, i.e., approximately at the same point it occurs in the source text. + 2. `t`: Place the float at the *top* of the page. + 3. `b`: Place the float at the *bottom* of the page. + 4. `p`: Place the float on the next *page* that will contain only floats like figures and tables. + 5. `H`: Place the float *HERE* (exactly where it occurs in the source text). The `H` specifier is provided by the [float package](https://ctan.org/pkg/float) and may not be used in conjunction with any other placement specifiers. - - `table-use-row-colors` (defaults to `false`) +- `table-use-row-colors` (defaults to `false`) - enables row colors for tables. The default value is `false` because the coloring extends beyond the edge of the table and there is currently no way to change that. + enables row colors for tables. The default value is `false` because the coloring extends beyond the edge of the table and there is currently no way to change that. - - `code-block-font-size` (defaults to `\small`) +- `code-block-font-size` (defaults to `\small`) - LaTeX command to change the font size for code blocks. The available values are `\tiny`, `\scriptsize`, `\footnotesize`, `\small`, `\normalsize`, `\large`, `\Large`, `\LARGE`, `\huge` and `\Huge`. This option will change the font size for default code blocks using the verbatim environment and for code blocks generated with listings. + LaTeX command to change the font size for code blocks. The available values are `\tiny`, `\scriptsize`, `\footnotesize`, `\small`, `\normalsize`, `\large`, `\Large`, `\LARGE`, `\huge` and `\Huge`. This option will change the font size for default code blocks using the verbatim environment and for code blocks generated with listings. ## Required LaTeX Packages -LaTeX manages addons and additional functionality in so called packages. You -might get the following error when compiling a document with the Eisvogel -template: - +LaTeX manages addons and additional functionality in so called packages. You might get the following error when compiling a document with the Eisvogel template: -``` sh -! LaTeX Error: File `footnotebackref.sty' not found. +``` +shCopy code! LaTeX Error: File `footnotebackref.sty' not found. Type X to quit or to proceed, or enter new name. (Default extension: sty) @@ -231,49 +230,34 @@ Enter file name: ``` -LaTeX informs you that the additional package `footnotebackref` is required to -render the document. +LaTeX informs you that the additional package `footnotebackref` is required to render the document. ### Texlive -Eisvogel requires a full texlive distribution that can be installed by running -`apt-get install texlive-full` in the terminal. Because `texlive-full` is very -large (about 5 Gigabytes) you can also install the smaller texlive bundles and -add any missing packages manually. +Eisvogel requires a full texlive distribution that can be installed by running `apt-get install texlive-full` in the terminal. Because `texlive-full` is very large (about 5 Gigabytes) you can also install the smaller texlive bundles and add any missing packages manually. -A smaller texlive bundle is `texlive-latex-extra`. With `texlive-latex-extra` -you also need to install these packages manually: +A smaller texlive bundle is `texlive-latex-extra`. With `texlive-latex-extra` you also need to install these packages manually: ``` -adjustbox babel-german background bidi collectbox csquotes everypage filehook -footmisc footnotebackref framed fvextra letltxmacro ly1 mdframed mweights -needspace pagecolor sourcecodepro sourcesanspro titling ucharcat ulem -unicode-math upquote xecjk xurl zref -``` - -Install them with the following command: - -``` sh +sh +Copy code tlmgr install adjustbox babel-german background bidi collectbox csquotes everypage filehook footmisc footnotebackref framed fvextra letltxmacro ly1 mdframed mweights needspace pagecolor sourcecodepro sourcesanspro titling ucharcat ulem unicode-math upquote xecjk xurl zref ``` -Additional information about the different texlive packages can be found at -this TeX-StackExchange answer: +Additional information about the different texlive packages can be found at this TeX-StackExchange answer: https://tex.stackexchange.com/a/504566 ### MiKTeX -If you don't want to install all missing packages manually, [MiKTeX might be -an alternative](https://miktex.org/howto/miktex-console). +If you don't want to install all missing packages manually, [MiKTeX might be an alternative](https://miktex.org/howto/miktex-console). -> MiKTeX has the ability to automatically install missing packages. -> You can turn this feature on or off. And you can let MiKTeX ask you each time a package has to be installed: +> MiKTeX has the ability to automatically install missing packages. You can turn this feature on or off. And you can let MiKTeX ask you each time a package has to be installed: > > - Click `Settings` to navigate to the settings page. > - Click the `General` tab. > - Click one of the radio buttons: -> - `Ask me` -> - `Always install missing packages on-the-fly` -> - `Never install missing packages on-the-fly` +> - `Ask me` +> - `Always install missing packages on-the-fly` +> - `Never install missing packages on-the-fly` ## Examples @@ -281,7 +265,9 @@ an alternative](https://miktex.org/howto/miktex-console). For PDFs with [numbered sections](http://pandoc.org/MANUAL.html#options-affecting-specific-writers) use the `--number-sections` or `-N` option. -``` bash +``` +bash +Copy code pandoc example.md -o example.pdf --template eisvogel --number-sections ``` @@ -289,7 +275,9 @@ pandoc example.md -o example.pdf --template eisvogel --number-sections You can get syntax highlighting of delimited code blocks by using the LaTeX package listings with the option `--listings`. This example will produce the same syntax highlighting as in the example PDF. -``` bash +``` +bash +Copy code pandoc example.md -o example.pdf --template eisvogel --listings ``` @@ -297,19 +285,10 @@ pandoc example.md -o example.pdf --template eisvogel --listings The following examples show [syntax highlighting of delimited code blocks](http://pandoc.org/MANUAL.html#syntax-highlighting) without using listings. To see a list of all the supported highlight styles, type `pandoc --list-highlight-styles`. -``` bash -pandoc example.md -o example.pdf --template eisvogel --highlight-style pygments ``` - -``` bash +bashCopy codepandoc example.md -o example.pdf --template eisvogel --highlight-style pygments pandoc example.md -o example.pdf --template eisvogel --highlight-style kate -``` - -``` bash pandoc example.md -o example.pdf --template eisvogel --highlight-style espresso -``` - -``` bash pandoc example.md -o example.pdf --template eisvogel --highlight-style tango ``` @@ -317,21 +296,27 @@ pandoc example.md -o example.pdf --template eisvogel --highlight-style tango To produce a standalone LaTeX document for compiling with any LaTeX editor use `.tex` as an output file extension. -``` bash +``` +bash +Copy code pandoc example.md -o example.tex --template eisvogel ``` ### Changing the Document Language -The default language of this template is American English. The `lang` variable identifies the main language of the document, using a code according to [BCP 47](https://tools.ietf.org/html/bcp47) (e.g. `en` or `en-GB`). For an incomplete list of the supported language codes see [the documentation for the hyph-utf8 package (Section 2)](http://mirrors.ctan.org/language/hyph-utf8/doc/generic/hyph-utf8/hyph-utf8.pdf). The following example changes the language to British English: +The default language of this template is American English. The `lang` variable identifies the main language of the document, using a code according to [BCP 47](https://tools.ietf.org/html/bcp47) (e.g. `en` or `en-GB`). For an incomplete list of the supported language codes see [the documentation for the hyph-utf8 package (Section 2)](http://mirrors.ctan.org/language/hyph-utf8/doc/generic/hyph-utf8/hyph-utf8.pdf). The following example changes the language to British English: -``` bash +``` +bash +Copy code pandoc example.md -o example.pdf --template eisvogel -V lang=en-GB ``` The following example changes the language to German: -``` bash +``` +bash +Copy code pandoc example.md -o example.pdf --template eisvogel -V lang=de ``` @@ -345,38 +330,34 @@ There will be one blank page before each chapter because the template is two-sid ### Example Images -| A green title page | A background image on the title page | -| :----------------: | :----------------: | -| [![A green title page](examples/title-page-green/preview.png)](examples/title-page-green/document.pdf) | [![A background image on the title page](examples/title-page-background/preview.png)](examples/title-page-background/document.pdf) | +| A green title page | A background image on the title page | +| :----------------------------------------------------------: | :----------------------------------------------------------: | +| [![A green title page](https://github.com/Wandmalfarbe/pandoc-latex-template/raw/master/examples/title-page-green/preview.png)](https://github.com/Wandmalfarbe/pandoc-latex-template/raw/master/examples/title-page-green/document.pdf) | [![A background image on the title page](https://github.com/Wandmalfarbe/pandoc-latex-template/raw/master/examples/title-page-background/preview.png)](https://github.com/Wandmalfarbe/pandoc-latex-template/raw/master/examples/title-page-background/document.pdf) | -| images and tables | Code blocks styled without listings | -| :---------------: | :---------------: | -| [![images and tables](examples/images-and-tables/preview.png)](examples/images-and-tables/document.pdf) | [![Code blocks styled without listings](examples/code-blocks-without-listings/preview.png)](examples/code-blocks-without-listings/document.pdf) | +| images and tables | Code blocks styled without listings | +| :----------------------------------------------------------: | :----------------------------------------------------------: | +| [![images and tables](https://github.com/Wandmalfarbe/pandoc-latex-template/raw/master/examples/images-and-tables/preview.png)](https://github.com/Wandmalfarbe/pandoc-latex-template/raw/master/examples/images-and-tables/document.pdf) | [![Code blocks styled without listings](https://github.com/Wandmalfarbe/pandoc-latex-template/raw/master/examples/code-blocks-without-listings/preview.png)](https://github.com/Wandmalfarbe/pandoc-latex-template/raw/master/examples/code-blocks-without-listings/document.pdf) | -| A book | Code blocks styled with listings | -| :----: | :----: | -| [![A book](examples/book/preview.png)](examples/book/document.pdf) | [![Code blocks styled with listings](examples/code-blocks-listings/preview.png)](examples/code-blocks-listings/document.pdf) | +| A book | Code blocks styled with listings | +| :----------------------------------------------------------: | :----------------------------------------------------------: | +| [![A book](https://github.com/Wandmalfarbe/pandoc-latex-template/raw/master/examples/book/preview.png)](https://github.com/Wandmalfarbe/pandoc-latex-template/raw/master/examples/book/document.pdf) | [![Code blocks styled with listings](https://github.com/Wandmalfarbe/pandoc-latex-template/raw/master/examples/code-blocks-listings/preview.png)](https://github.com/Wandmalfarbe/pandoc-latex-template/raw/master/examples/code-blocks-listings/document.pdf) | -| A background images on all pages | CJK Support (when using XeLaTeX) | -| :----: | :----: | -| [![A background images on all pages](examples/page-background/preview.png)](examples/page-background/document.pdf) | [![CJK Support (when using XeLaTeX)](examples/language-japanese/preview.png)](examples/language-japanese/document.pdf) | +| A background images on all pages | CJK Support (when using XeLaTeX) | +| :----------------------------------------------------------: | :----------------------------------------------------------: | +| [![A background images on all pages](https://github.com/Wandmalfarbe/pandoc-latex-template/raw/master/examples/page-background/preview.png)](https://github.com/Wandmalfarbe/pandoc-latex-template/raw/master/examples/page-background/document.pdf) | [![CJK Support (when using XeLaTeX)](https://github.com/Wandmalfarbe/pandoc-latex-template/raw/master/examples/language-japanese/preview.png)](https://github.com/Wandmalfarbe/pandoc-latex-template/raw/master/examples/language-japanese/document.pdf) | ## Common Errors / Issues -The following section lists common errors and their solutions when using the -Eisvogel template. +The following section lists common errors and their solutions when using the Eisvogel template. ### LaTeX Errors `Missing endcsname inserted` or `File x not found` when using `titlepage-background`, `logo`, or `titlepage-logo`. -``` latex -Error producing PDF. +``` +vbnetCopy codelatexError producing PDF. ! Missing endcsname inserted. protect -``` - -``` latex -Error producing PDF. +latexError producing PDF. ! Package pdftex.def Error: File `logo\T1\textunderscoreimage.pdf' not fou nd: using draft setting. @@ -384,27 +365,29 @@ See the pdftex.def package documentation for explanation. Type H for immediate help. ``` -These errors occur when one includes a background image on the title page or a -logo that has an underscore (`_`) in the filename. +These errors occur when one includes a background image on the title page or a logo that has an underscore (`_`) in the filename. -A quick fix would be to replace all underscores in the filename of the image -with a hyphen (`-`). If the background image is specified in your YAML front -matter like so, +A quick fix would be to replace all underscores in the filename of the image with a hyphen (`-`). If the background image is specified in your YAML front matter like so, -``` yaml +``` +yaml +Copy code titlepage-background: "background_image.pdf" ``` -you can advise pandoc to interpret this as LaTeX and include it in the document -without parsing. +you can advise pandoc to interpret this as LaTeX and include it in the document without parsing. -``` yaml +``` +yaml +Copy code titlepage-background: "`background_image.pdf`{=latex}" ``` The same fix can be used for the logo image as well: -``` yaml +``` +yaml +Copy code logo: "`logo_image.pdf`{=latex}" ``` @@ -416,7 +399,7 @@ Corresponding issues: ### LaTeX Error `Missing \begin{document}` ``` -! LaTeX Error: Missing \begin{document}. +javascriptCopy code! LaTeX Error: Missing \begin{document}. See the LaTeX manual or LaTeX Companion for explanation. Type H for immediate help. @@ -427,22 +410,19 @@ l.7 < ! ==> Fatal error occurred, no output PDF file produced! ``` -This error indicates that you try to use some text file for conversion that is -not the Eisvogel template. Please download the [latest Eisvogel template](https://github.com/Wandmalfarbe/pandoc-latex-template/releases/latest) from the releases page and start the conversion again. +This error indicates that you try to use some text file for conversion that is not the Eisvogel template. Please download the [latest Eisvogel template](https://github.com/Wandmalfarbe/pandoc-latex-template/releases/latest) from the releases page and start the conversion again. ### LaTeX Error `auto expansion is only possible with scalable fonts` -``` latex -Error producing PDF. -! pdfTeX error (font expansion): auto expansion is only possible with scalable +``` +latexCopy code! pdfTeX error (font expansion): auto expansion is only possible with scalable fonts. \AtBegShi@Output ...ipout \box \AtBeginShipoutBox \fi \fi l.643 \begin{lstlisting} ``` -This error likely occurs on Windows with MiKTeX installed. StackOverflow user -[Krebto provided the following fix](https://tex.stackexchange.com/a/392467): +This error likely occurs on Windows with MiKTeX installed. StackOverflow user [Krebto provided the following fix](https://tex.stackexchange.com/a/392467): > To solve the problem navigate to `C:\Program Files\MiKTeX 2.9\miktex\bin\x64` and run `updmap.exe`. The program may seem as it hangs for a while, but its probably because it tries to update the whole font tree. This solved the problem for me. After re-compiling everything should work fine. @@ -452,20 +432,16 @@ Corresponding issue: ### LaTeX Error `cannot find image file` -``` latex -Error producing PDF. -! error: (file "/tmp/tex2pdf.-be734e802ef6d0c3/""fdcfc29edcf252186f1b0a52f18f50 +``` +latexCopy code! error: (file "/tmp/tex2pdf.-be734e802ef6d0c3/""fdcfc29edcf252186f1b0a52f18f50 43abaeb2d0".png) (pdf backend): cannot find image file '"/tmp/tex2pdf.-be734e802 ef6d0c3/""fdcfc29edcf252186f1b0a52f18f5043abaeb2d0".png' ! ==> Fatal error occurred, no output PDF file produced! ``` -In general this error means that LaTeX is unable to find the included image -file. Please check all image references and file names for correctness. +In general this error means that LaTeX is unable to find the included image file. Please check all image references and file names for correctness. -This error also occurs if you use an old version of Eisvogel with the package -`grffile` and have an old LaTeX distribution installed. Please update Eisvogel -and your LaTeX distribution. +This error also occurs if you use an old version of Eisvogel with the package `grffile` and have an old LaTeX distribution installed. Please update Eisvogel and your LaTeX distribution. Corresponding issues: @@ -474,8 +450,8 @@ Corresponding issues: ## Credits - - This template includes code for styling block quotations from [pandoc-letter](https://github.com/aaronwolen/pandoc-letter) by [Aaron Wolen](https://github.com/aaronwolen). +- This template includes code for styling block quotations from [pandoc-letter](https://github.com/aaronwolen/pandoc-letter) by [Aaron Wolen](https://github.com/aaronwolen). ## License -This project is open source licensed under the BSD 3-Clause License. Please see the [LICENSE file](LICENSE) for more information. +This project is open source licensed under the BSD 3-Clause License. Please see the [LICENSE file](https://github.com/Wandmalfarbe/pandoc-latex-template/blob/master/LICENSE) for more information. diff --git a/eisvogel.tex b/eisvogel.tex index 109cb83..4b2add4 100644 --- a/eisvogel.tex +++ b/eisvogel.tex @@ -151,15 +151,15 @@ $else$ \usepackage{unicode-math} % this also loads fontspec $endif$ - \defaultfontfeatures{Scale=MatchLowercase}$-- must come before Beamer theme + \defaultfontfeatures{Scale=MatchLowercase}% must come before Beamer theme \defaultfontfeatures[\rmfamily]{Ligatures=TeX,Scale=1} \fi $if(fontfamily)$ $else$ -$-- Set default font before Beamer theme so the theme can override it +% Set default font before Beamer theme so the theme can override it \usepackage{lmodern} $endif$ -$-- Set Beamer theme before user font settings so they can override theme +% Set Beamer theme before user font settings so they can override theme $if(beamer)$ $if(theme)$ \usetheme[$for(themeoptions)$$themeoptions$$sep$,$endfor$]{$theme$} @@ -180,7 +180,7 @@ \useoutertheme{$outertheme$} $endif$ $endif$ -$-- User font settings (must come after default font and Beamer theme) +% User font settings (must come after default font and Beamer theme) $if(fontfamily)$ \usepackage[$for(fontfamilyoptions)$$fontfamilyoptions$$sep$,$endfor$]{$fontfamily$} $endif$ @@ -384,7 +384,7 @@ \usepackage{svg} $endif$ $if(strikeout)$ -$-- also used for underline +% also used for underline \ifLuaTeX \usepackage{luacolor} \usepackage[soul]{lua-ul} @@ -497,9 +497,9 @@ \ifPDFTeX \TeXXeTstate=1 \newcommand{\RL}[1]{\beginR #1\endR} - \newcommand{\LR}[1]{\beginL #1\endL} + \newcommand{\LR}[1]{\beginL #1\endR} \newenvironment{RTL}{\beginR}{\endR} - \newenvironment{LTR}{\beginL}{\endL} + \newenvironment{LTR}{\beginL}{\endR} \fi $endif$ $if(natbib)$ @@ -570,7 +570,7 @@ $endif$ \subtitle{$subtitle$} $endif$ -\author{$for(author)$$author$$sep$ \and $endfor$} +\author{$for(author)$$author$$sep$, $endfor$} \date{$date$} $if(beamer)$ $if(institute)$ @@ -584,19 +584,11 @@ $endif$ $endif$ - - -%% -%% added -%% - $if(page-background)$ \usepackage[pages=all]{background} $endif$ -% % for the background color of the title page -% $if(titlepage)$ \usepackage{pagecolor} \usepackage{afterpage} @@ -609,20 +601,14 @@ $endif$ $endif$ -% % break urls -% \PassOptionsToPackage{hyphens}{url} -% % When using babel or polyglossia with biblatex, loading csquotes is recommended % to ensure that quoted texts are typeset according to the rules of your main language. -% \usepackage{csquotes} -% % captions -% \definecolor{caption-color}{HTML}{777777} $if(beamer)$ $else$ @@ -630,9 +616,7 @@ \setcapindent{0em} $endif$ -% % blockquote -% \definecolor{blockquote-border}{RGB}{221,221,221} \definecolor{blockquote-text}{RGB}{119,119,119} \usepackage{mdframed} @@ -640,13 +624,10 @@ \renewenvironment{quote}{\begin{customblockquote}\list{}{\rightmargin=0em\leftmargin=0em}% \item\relax\color{blockquote-text}\ignorespaces}{\unskip\unskip\endlist\end{customblockquote}} -% % Source Sans Pro as the default font family % Source Code Pro for monospace text -% % 'default' option sets the default % font family to Source Sans Pro, not \sfdefault. -% \ifnum 0\ifxetex 1\fi\ifluatex 1\fi=0 % if pdftex $if(fontfamily)$ $else$ @@ -671,18 +652,16 @@ Extension = .otf } \setmonofont [ UprightFont = *-\sourcecodepro@regstyle, - ItalicFont = *-\sourcecodepro@regstyle It, - BoldFont = *-\sourcecodepro@boldstyle, - BoldItalicFont = *-\sourcecodepro@boldstyle It ] + ItalicFont = *-\regstyle It, + BoldFont = *-\boldstyle, + BoldItalicFont = *-\boldstyle It ] {SourceCodePro} \makeatother \fi $endif$ \fi -% % heading color -% \definecolor{heading-color}{RGB}{40,40,40} $if(beamer)$ $else$ @@ -692,9 +671,7 @@ % scrbook or memoir, uncomment the following line. %\addtokomafont{chapter}{\color{heading-color}} -% % variables for title, author and date -% $if(beamer)$ $else$ \usepackage{titling} @@ -703,11 +680,8 @@ \date{$date$} $endif$ -% % tables -% $if(tables)$ - \definecolor{table-row-color}{HTML}{F5F5F5} \definecolor{table-rule-color}{HTML}{999999} @@ -732,24 +706,14 @@ $endif$ $endif$ -% % remove paragraph indentation -% \setlength{\parindent}{0pt} \setlength{\parskip}{6pt plus 2pt minus 1pt} \setlength{\emergencystretch}{3em} % prevent overfull lines -% -% % Listings -% -% - $if(listings)$ - -% % general listing colors -% \definecolor{listing-background}{HTML}{F7F7F7} \definecolor{listing-rule}{HTML}{B3B2B3} \definecolor{listing-numbers}{HTML}{B3B2B3} @@ -799,8 +763,8 @@ literate = {á}{{\'a}}1 {é}{{\'e}}1 {í}{{\'i}}1 {ó}{{\'o}}1 {ú}{{\'u}}1 {Á}{{\'A}}1 {É}{{\'E}}1 {Í}{{\'I}}1 {Ó}{{\'O}}1 {Ú}{{\'U}}1 - {à}{{\`a}}1 {è}{{\`e}}1 {ì}{{\`i}}1 {ò}{{\`o}}1 {ù}{{\`u}}1 - {À}{{\`A}}1 {È}{{\`E}}1 {Ì}{{\`I}}1 {Ò}{{\`O}}1 {Ù}{{\`U}}1 + {à}{{\`a}}1 {è}{{\'e}}1 {ì}{{\`i}}1 {ò}{{\`o}}1 {ù}{{\`u}}1 + {À}{{\`A}}1 {È}{{\'E}}1 {Ì}{{\`I}}1 {Ò}{{\`O}}1 {Ù}{{\`U}}1 {ä}{{\"a}}1 {ë}{{\"e}}1 {ï}{{\"i}}1 {ö}{{\"o}}1 {ü}{{\"u}}1 {Ä}{{\"A}}1 {Ë}{{\"E}}1 {Ï}{{\"I}}1 {Ö}{{\"O}}1 {Ü}{{\"U}}1 {â}{{\^a}}1 {ê}{{\^e}}1 {î}{{\^i}}1 {ô}{{\^o}}1 {û}{{\^u}}1 @@ -814,9 +778,7 @@ } \lstset{style=eisvogel_listing_style} -% -% Java (Java SE 12, 2019-06-22) -% +% Java (Java SE 12, 9, 2022-09-22) \lstdefinelanguage{Java}{ morekeywords={ % normal keywords (without data types) @@ -866,23 +828,26 @@ } $endif$ -% % header and footer -% $if(beamer)$ $else$ $if(disable-header-and-footer)$ $else$ \usepackage[headsepline,footsepline]{scrlayer-scrpage} +\usepackage{lastpage} % Add this line to include the lastpage package + +\newcommand{\authors}{$for(author)$$author$$sep$, $endfor$} +\newcommand{\copyyear}{$date$} +\newcommand{\copyrighttext}{$if(copyright)$$copyright$$else$© \copyyear{} by \authors. All rights reserved.$endif$} \newpairofpagestyles{eisvogel-header-footer}{ \clearpairofpagestyles \ihead*{$if(header-left)$$header-left$$else$$title$$endif$} \chead*{$if(header-center)$$header-center$$else$$endif$} \ohead*{$if(header-right)$$header-right$$else$$date$$endif$} - \ifoot*{$if(footer-left)$$footer-left$$else$$for(author)$$author$$sep$, $endfor$$endif$} + \ifoot*{$if(footer-left)$$footer-left$$else$\copyrighttext$endif$} \cfoot*{$if(footer-center)$$footer-center$$else$$endif$} - \ofoot*{$if(footer-right)$$footer-right$$else$\thepage$endif$} + \ofoot*{$if(footer-right)$$footer-right$$else$\thepage{} / \pageref{LastPage}$endif$} \addtokomafont{pageheadfoot}{\upshape} } \pagestyle{eisvogel-header-footer} @@ -906,10 +871,6 @@ $endif$ $endif$ -%% -%% end added -%% - \begin{document} %% @@ -996,9 +957,8 @@ $if(title)$ $if(beamer)$ \frame{\titlepage} -% don't generate the default title -% $else$ -% \maketitle +$else$ +% \maketitle % Comment or remove this line to avoid printing title, subtitle, author, and date on the first page after the title page. $endif$ $if(abstract)$ \begin{abstract}