diff --git a/.github/workflows/build-examples.yml b/.github/workflows/build-examples.yml new file mode 100644 index 0000000..9a1d8bc --- /dev/null +++ b/.github/workflows/build-examples.yml @@ -0,0 +1,75 @@ +name: Build Example PDF files + +on: [push, pull_request] + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + with: + fetch-depth: 0 # otherwise, there would be errors pushing refs to the destination repository. + - name: Setup pandoc + env: + PANDOC_VERSION: "3.1.7" + run: | + wget -qO- https://github.com/jgm/pandoc/releases/download/${PANDOC_VERSION}/pandoc-${PANDOC_VERSION}-linux-amd64.tar.gz | sudo tar xzf - --strip-components 1 -C /usr/local/ + - name: Setup TexLive + env: + REMOTE: http://mirror.ctan.org/systems/texlive/tlnet + INSTALL: '/tmp/install-texlive' + run: | + mkdir -p ${INSTALL} + curl -sSL ${REMOTE}/install-tl-unx.tar.gz | tar -xzv -C $INSTALL --strip-components=1 + sudo ${INSTALL}/install-tl -no-gui -profile .texlife.profile + VERSION=$($INSTALL/install-tl --version | grep 'version' | grep -o '[0-9]\{4\}') + PLATFORM=$($INSTALL/install-tl --print-platform) + TEXLIVE_DIR="/usr/local/texlive/${VERSION}" + TEXBIN="/usr/local/texlive/${VERSION}/bin/${PLATFORM}" + echo "${TEXBIN}" >> $GITHUB_PATH + sudo chown -hR $(whoami) "$TEXLIVE_DIR" + - name: Initialization for tlmgr + run: | + sudo apt-get update -qq && sudo apt-get install xzdec -y + tlmgr init-usertree + - name: Setup fonts and image convertion tool + run: sudo apt-get update -qq && sudo apt-get install fonts-noto-cjk poppler-utils -y + - name: Setup Python + uses: actions/setup-python@v2 + with: + python-version: '3.11' + - name: Install python filters + run: | + python -m pip install --upgrade pip + pip install pandoc-latex-environment + - name: Install LaTeX packages + run: | + tlmgr install adjustbox background bidi csquotes footmisc footnotebackref fvextra mdframed pagecolor sourcecodepro sourcesanspro titling ulem upquote xurl hardwrap catchfile + # trial and error + tlmgr install letltxmacro zref everypage framed collectbox + # packages needed for the template + tlmgr install xecjk filehook unicode-math ucharcat pagecolor babel-german ly1 mweights sourcecodepro sourcesanspro mdframed needspace fvextra footmisc footnotebackref background + # packages only needed for some examples (that include packages via header-includes) + tlmgr install awesomebox fontawesome5 + # packages only needed for some examples (example boxes-with-pandoc-latex-environment-and-tcolorbox) + tlmgr install tcolorbox pgf etoolbox environ trimspaces + - name: Build examples + run: cd examples && bash build-examples.sh && cd .. + - name: Add generated example files + uses: actions/upload-artifact@v2 + with: + name: build-files + path: | + examples/*/document.pdf + examples/*/preview.png + - name: Commit files + run: | + git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com" + git config --local user.name "github-actions[bot]" + git commit -m "Add generated example files" -a + - name: Push changes + uses: ad-m/github-push-action@master + if: github.event_name == 'push' && github.ref == 'refs/heads/master' + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + branch: ${{ github.ref }} diff --git a/.gitignore b/.gitignore index 6065098..4292209 100644 --- a/.gitignore +++ b/.gitignore @@ -5,6 +5,8 @@ private/ # build folder dist/ +.idea + # contains unit tests (incomplete at the moment, so don't include them) test/ test/.idea/ diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 9af02ce..0000000 --- a/.travis.yml +++ /dev/null @@ -1,62 +0,0 @@ -os: linux -dist: bionic -language: java -before_install: - # default pandoc is too old -> install a newer version manually - - PANDOC_VERSION="2.11.2" - - pandoc_deb="pandoc-${PANDOC_VERSION}-1-amd64.deb" - - wget "https://github.com/jgm/pandoc/releases/download/${PANDOC_VERSION}/${pandoc_deb}" - - sudo dpkg -i ${pandoc_deb} - - rm ${pandoc_deb} - - # default textlife from apt-get is too old - # install the latest texlife version manually - - REMOTE="http://mirror.ctan.org/systems/texlive/tlnet" - - INSTALL="/tmp/install-texlive" - - mkdir -p $INSTALL - - curl -sSL $REMOTE/install-tl-unx.tar.gz | tar -xzv -C $INSTALL --strip-components=1 - - sudo $INSTALL/install-tl -no-gui -profile .texlife.profile - - VERSION=$($INSTALL/install-tl --version | grep 'version' | grep -o '[0-9]\{4\}') - - PLATFORM=$($INSTALL/install-tl --print-platform) - - TEXLIVE_DIR="/usr/local/texlive/${VERSION}" - - TEXBIN="/usr/local/texlive/${VERSION}/bin/${PLATFORM}" - - export "PATH=$TEXBIN:$PATH" - - # initialization for tlmgr - - sudo apt-get install xzdec - - tlmgr init-usertree - - # install pdftoppm for rendering the PDFs - - sudo apt-get install poppler-utils - - # for executing python based pandoc filters install python and pip - - sudo apt-get install python3 - - sudo apt-get install python3-pip - - sudo pip3 install --upgrade setuptools - - sudo pip3 install wheel - - # install python filters - - pip3 install pandoc-latex-environment - - # packages specified in the template - #- sudo $(which tlmgr) install adjustbox afterpage amsmath amssymb babel background beamerarticle bidi bookmark booktabs caption csquotes etoolbox fancyhdr fancyvrb float fontenc footmisc footnote footnotebackref footnotehyper fvextra geometry graphicx grffile hyperref ifluatex ifxetex inputenc listings lmodern longtable luatexja-fontspec luatexja-preset mathspec mdframed microtype natbib pagecolor parskip pgfpages polyglossia setspace sourcecodepro sourcesanspro textcomp tikz titling ulem unicode-math upquote url xcolor xeCJK xurl - - - sudo chown -hR $(whoami) "$TEXLIVE_DIR" - # packages specified in the template - - tlmgr install adjustbox background bidi csquotes footmisc footnotebackref fvextra mdframed pagecolor sourcecodepro sourcesanspro titling ulem upquote xurl - - # trial and error - - tlmgr install letltxmacro zref everypage framed collectbox - - # packages needed for the template - - tlmgr install xecjk filehook unicode-math ucharcat pagecolor babel-german ly1 mweights sourcecodepro sourcesanspro mdframed needspace fvextra footmisc footnotebackref background - - # packages only needed for some examples (that include packages via header-includes) - - tlmgr install awesomebox fontawesome5 - - # packages only needed for some examples (example boxes-with-pandoc-latex-environment-and-tcolorbox) - - tlmgr install tcolorbox pgf etoolbox environ trimspaces -before_script: - - cd examples -script: - - bash build-examples.sh \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 760cf7f..718f89a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,63 @@ 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). +## [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)). +- Merge changes from the pandoc default LaTeX template from version 3.1.8 ([2d42e04](https://github.com/jgm/pandoc-templates/commit/2d42e04cbd65dd36c4469156b00f636e7f31623e)) (#364, David Mehren). +- Add fix for `table-use-row-colors` which previously stopped working (#301, Chris Fenner). + +## [2.4.1] - 2023-09-06 + +- Merge changes from the pandoc default LaTeX template from version 3.1.7 (as of 2023-08-31, [8a5b381](https://github.com/jgm/pandoc-templates/blob/8a5b381c156c974b485197208c6dc86fce94b5c3/default.latex)). + +## [2.4.0] - 2023-04-17 + +- Merge changes from the pandoc default LaTeX template (as of 2023-03-29, [a5159c2](https://github.com/jgm/pandoc/blob/a5159c2c505cd9a87856877b3287aa0b88e4e0ba/data/templates/default.latex)). +- Fix placement of float figures (tables, images, etc.). Float figures should now appear + exactly where they are included. The option `float-placement-figure` is also restored. +- Remove Travis CI build +- Fix wrong font sizes on the title page. The problem went away on its own, likely because + of an updated LaTeX package. + +## [2.3.0] - 2023-03-13 + +The Eisvogel template is now available in the Docker image [pandoc/extra](https://hub.docker.com/r/pandoc/extra)! +For more Information refer to the [documentation in the Readme](https://github.com/Wandmalfarbe/pandoc-latex-template#docker-image) or +the [documentation on docker hub](https://hub.docker.com/r/pandoc/extra). + +- Merge changes from the pandoc default LaTeX template (as of 2023-03-10, [9b04036](https://github.com/jgm/pandoc/blob/9b04036f6b0745c6ce0cb027683e94b648da3a9c/data/templates/default.latex)). + - Add `CJKsansfont` and `CJKmonofont` for XeLaTeX. `CJKsansfont` and `CJKmonofont` will be set + for XeLaTeX only if `CJKmainfont` is also provided (#328, Yudong Jin). +- Add documentation in the README on how to use the `pandoc/extra` docker image (#319, damien clochard). +- Fix wrong literate of characters `è` and `È` in listings. The character `è` was wrongly + converted to `é` and `È` to `É` (#324, damien clochard). + +## [2.2.0] - 2023-01-22 + +- Merge changes from the pandoc default LaTeX template (as of 2023-01-13, [909ced5](https://github.com/jgm/pandoc/blob/909ced5153e2c7cefd5018c39f83231824940fb8/data/templates/default.latex)). + - This change adds support for pandoc 3. + +## [2.1.0] - 2022-12-04 + +- Merge changes from the pandoc default LaTeX template (as of 2022-11-19, [144bf90ab9](https://github.com/jgm/pandoc/blob/144bf90ab92b517dd721baf80f121f86187ccd61/data/templates/default.latex)). +- Restructure the examples. Any example folder now contains at least the following files: + - `document.md`: the Markdown document to convert to a PDF + - `document.pdf`: the resulting PDF document + - `build.sh`: a shell script to convert the document `document.md` with pandoc. This script might call pandoc with additional arguments (e.g. filters or template variables). + - `preview.png`: a PNG image of the resulting PDF document intended as a quick preview +- Use the Koma-Script package `scrlayer-scrpage` for the headers and footers instead of the package `fancyhdr` (#174, khaveesh). + - Fix a header and footer bug when using `oneside` introduced by the migration to `scrlayer-scrpage` (#248, ret2src). + - Restore pagestyle `plain` for chapters (#275). Headers and footers are removed from chapter pages, as it has been before the migration to `scrlayer-scrpage`. +- Correct the examples and documentation (#239, mprobson), (#261, supcik). +- Exclude title page from page count (#230, shmalebx9). +- Make code-block-font-size not affect inline listings (#229, LudvigHz). +- Rename the Eisvogel template variable `logo` to `titlepage-logo`. + - `logo` is already used by beamer, and one might want to use both + formats (beamer and latex) without the logo appearing as a + background image on beamer slides. +- Add an example for a table of contents (#283). + ## [2.0.0] - 2021-01-31 **This release includes breaking changes.** @@ -118,6 +175,12 @@ All notable changes to this project are documented in this file. On the [release - First release of the template as a ZIP file with the examples. +[2.4.2]: https://github.com/Wandmalfarbe/pandoc-latex-template/compare/v2.4.1...v2.4.2 +[2.4.1]: https://github.com/Wandmalfarbe/pandoc-latex-template/compare/v2.4.0...v2.4.1 +[2.4.0]: https://github.com/Wandmalfarbe/pandoc-latex-template/compare/v2.3.0...v2.4.0 +[2.3.0]: https://github.com/Wandmalfarbe/pandoc-latex-template/compare/v2.2.0...v2.3.0 +[2.2.0]: https://github.com/Wandmalfarbe/pandoc-latex-template/compare/v2.1.0...v2.2.0 +[2.1.0]: https://github.com/Wandmalfarbe/pandoc-latex-template/compare/v2.0.0...v2.1.0 [2.0.0]: https://github.com/Wandmalfarbe/pandoc-latex-template/compare/v1.6.1...v2.0.0 [1.6.1]: https://github.com/Wandmalfarbe/pandoc-latex-template/compare/v1.6.0...v1.6.1 [1.6.0]: https://github.com/Wandmalfarbe/pandoc-latex-template/compare/v1.5.0...v1.6.0 @@ -131,4 +194,4 @@ All notable changes to this project are documented in this file. On the [release [1.2.1]: https://github.com/Wandmalfarbe/pandoc-latex-template/compare/v1.2.0...v1.2.1 [1.2.0]: https://github.com/Wandmalfarbe/pandoc-latex-template/compare/1.1.0...v1.2.0 [1.1.0]: https://github.com/Wandmalfarbe/pandoc-latex-template/compare/v1.0.0...1.1.0 -[1.0.0]: https://github.com/Wandmalfarbe/pandoc-latex-template/releases/tag/v1.0.0 \ No newline at end of file +[1.0.0]: https://github.com/Wandmalfarbe/pandoc-latex-template/releases/tag/v1.0.0 diff --git a/README.md b/README.md index d2ecdc1..00a47f3 100644 --- a/README.md +++ b/README.md @@ -2,9 +2,7 @@ # Eisvogel -[![Build Status](https://travis-ci.com/Wandmalfarbe/pandoc-latex-template.svg?branch=master)](https://travis-ci.com/Wandmalfarbe/pandoc-latex-template) - -A clean **pandoc LaTeX template** to convert your markdown files to PDF or LaTeX. It is designed for lecture notes and exercises with a focus on computer science. The template is compatible with pandoc 2. +A clean **pandoc LaTeX template** to convert your markdown files to PDF or LaTeX. It is designed for lecture notes and exercises with a focus on computer science. The template is compatible with pandoc 3. ## Preview @@ -23,6 +21,36 @@ A clean **pandoc LaTeX template** to convert your markdown files to PDF or LaTeX If there are no folders called `templates` or `pandoc` you need to create them and put the template `eisvogel.latex` inside. You can find the default user data directory on your system by looking at the output of `pandoc --version`. + +### Docker image + +Alternatively, if you don't want to install LaTeX, you can use the Docker +image named [pandoc/extra]. The image contains pandoc, LaTeX and a curated +selection of components such as the eisvogel template, pandoc filters and +open source fonts. A common use of the image looks like this +(line breaks for readability): + +``` bash +docker run --rm \ + --volume "$(pwd):/data" \ + --user $(id -u):$(id -g) \ + pandoc/extra example.md -o example.pdf --template eisvogel --listings +``` + +For frequent command line use, you can define the following shell alias: + +``` bash +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 +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. @@ -35,7 +63,7 @@ A clean **pandoc LaTeX template** to convert your markdown files to PDF or LaTeX 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/basic-example.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](examples/basic-example/document.md)). Your markdown document may look like the following: ``` markdown --- @@ -72,6 +100,10 @@ This template defines some new variables to control the appearance of the result the height of the rule on the top of the title page (in points) + - `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. + - `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. @@ -140,10 +172,6 @@ This template defines some new variables to control the appearance of the result typeset as book - - `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. - - `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: @@ -338,7 +366,7 @@ There will be one blank page before each chapter because the template is two-sid 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` or `logo` +### LaTeX Errors `Missing endcsname inserted` or `File x not found` when using `titlepage-background`, `logo`, or `titlepage-logo`. ``` latex Error producing PDF. diff --git a/docs/index.md b/docs/index.md index 23c4ed6..46b8f8f 100644 --- a/docs/index.md +++ b/docs/index.md @@ -2,8 +2,6 @@ # Eisvogel -[![Build Status](https://travis-ci.com/Wandmalfarbe/pandoc-latex-template.svg?branch=master)](https://travis-ci.com/Wandmalfarbe/pandoc-latex-template) - A clean **pandoc LaTeX template** to convert your markdown files to PDF or LaTeX. It is designed for lecture notes and exercises with a focus on computer science. The template is compatible with pandoc 2. ## Preview diff --git a/eisvogel.tex b/eisvogel.tex index 03d63df..961f88c 100644 --- a/eisvogel.tex +++ b/eisvogel.tex @@ -1,6 +1,6 @@ %% -% Copyright (c) 2017 - 2021, Pascal Wagler; -% Copyright (c) 2014 - 2021, John MacFarlane +% Copyright (c) 2017 - 2023, Pascal Wagler; +% Copyright (c) 2014 - 2023, John MacFarlane % % All rights reserved. % @@ -43,12 +43,7 @@ % Options for packages loaded elsewhere \PassOptionsToPackage{unicode$for(hyperrefoptions)$,$hyperrefoptions$$endfor$}{hyperref} \PassOptionsToPackage{hyphens}{url} -\PassOptionsToPackage{dvipsnames,svgnames*,x11names*,table}{xcolor} -$if(dir)$ -$if(latex-dir-rtl)$ -\PassOptionsToPackage{RTLdocument}{bidi} -$endif$ -$endif$ +\PassOptionsToPackage{dvipsnames,svgnames,x11names,table}{xcolor} $if(CJKmainfont)$ \PassOptionsToPackage{space}{xeCJK} $endif$ @@ -57,9 +52,6 @@ $endif$ $if(fontsize)$ $fontsize$, $endif$ -$if(lang)$ - $babel-lang$, -$endif$ $if(papersize)$ $papersize$paper, $else$ @@ -84,6 +76,9 @@ $if(background-image)$ \usebackgroundtemplate{% \includegraphics[width=\paperwidth]{$background-image$}% } +% In beamer background-image does not work well when other images are used, so this is the workaround +\pgfdeclareimage[width=\paperwidth,height=\paperheight]{background}{$background-image$} +\usebackgroundtemplate{\pgfuseimage{background}} $endif$ \usepackage{pgfpages} \setbeamertemplate{caption}[numbered] @@ -133,75 +128,38 @@ $if(beamerarticle)$ \usepackage{beamerarticle} % needs to be loaded first $endif$ \usepackage{amsmath,amssymb} -$if(fontfamily)$ -\usepackage[$for(fontfamilyoptions)$$fontfamilyoptions$$sep$,$endfor$]{$fontfamily$} -$else$ -\usepackage{lmodern} -$endif$ $if(linestretch)$ \usepackage{setspace} $else$ +% Use setspace anyway because we change the default line spacing. +% The spacing is changed early to affect the titlepage and the TOC. \usepackage{setspace} \setstretch{1.2} $endif$ -\usepackage{ifxetex,ifluatex} -\ifnum 0\ifxetex 1\fi\ifluatex 1\fi=0 % if pdftex +\usepackage{iftex} +\ifPDFTeX \usepackage[$if(fontenc)$$fontenc$$else$T1$endif$]{fontenc} \usepackage[utf8]{inputenc} \usepackage{textcomp} % provide euro and other symbols \else % if luatex or xetex $if(mathspec)$ - \ifxetex - \usepackage{mathspec} + \ifXeTeX + \usepackage{mathspec} % this also loads fontspec \else - \usepackage{unicode-math} + \usepackage{unicode-math} % this also loads fontspec \fi $else$ - \usepackage{unicode-math} + \usepackage{unicode-math} % this also loads fontspec $endif$ - \defaultfontfeatures{Scale=MatchLowercase} + \defaultfontfeatures{Scale=MatchLowercase}$-- must come before Beamer theme \defaultfontfeatures[\rmfamily]{Ligatures=TeX,Scale=1} -$if(mainfont)$ - \setmainfont[$for(mainfontoptions)$$mainfontoptions$$sep$,$endfor$]{$mainfont$} -$endif$ -$if(sansfont)$ - \setsansfont[$for(sansfontoptions)$$sansfontoptions$$sep$,$endfor$]{$sansfont$} -$endif$ -$if(monofont)$ - \setmonofont[$for(monofontoptions)$$monofontoptions$$sep$,$endfor$]{$monofont$} -$endif$ -$for(fontfamilies)$ - \newfontfamily{$fontfamilies.name$}[$for(fontfamilies.options)$$fontfamilies.options$$sep$,$endfor$]{$fontfamilies.font$} -$endfor$ -$if(mathfont)$ -$if(mathspec)$ - \ifxetex - \setmathfont(Digits,Latin,Greek)[$for(mathfontoptions)$$mathfontoptions$$sep$,$endfor$]{$mathfont$} - \else - \setmathfont[$for(mathfontoptions)$$mathfontoptions$$sep$,$endfor$]{$mathfont$} - \fi -$else$ - \setmathfont[$for(mathfontoptions)$$mathfontoptions$$sep$,$endfor$]{$mathfont$} -$endif$ -$endif$ -$if(CJKmainfont)$ - \ifxetex - \usepackage{xeCJK} - \setCJKmainfont[$for(CJKoptions)$$CJKoptions$$sep$,$endfor$]{$CJKmainfont$} - \fi -$endif$ -$if(luatexjapresetoptions)$ - \ifluatex - \usepackage[$for(luatexjapresetoptions)$$luatexjapresetoptions$$sep$,$endfor$]{luatexja-preset} - \fi -$endif$ -$if(CJKmainfont)$ - \ifluatex - \usepackage[$for(luatexjafontspecoptions)$$luatexjafontspecoptions$$sep$,$endfor$]{luatexja-fontspec} - \setmainjfont[$for(CJKoptions)$$CJKoptions$$sep$,$endfor$]{$CJKmainfont$} - \fi -$endif$ \fi +$if(fontfamily)$ +$else$ +$-- 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 $if(beamer)$ $if(theme)$ \usetheme[$for(themeoptions)$$themeoptions$$sep$,$endfor$]{$theme$} @@ -222,6 +180,78 @@ $if(outertheme)$ \useoutertheme{$outertheme$} $endif$ $endif$ +$-- User font settings (must come after default font and Beamer theme) +$if(fontfamily)$ +\usepackage[$for(fontfamilyoptions)$$fontfamilyoptions$$sep$,$endfor$]{$fontfamily$} +$endif$ +\ifPDFTeX\else + % xetex/luatex font selection +$if(mainfont)$ + \setmainfont[$for(mainfontoptions)$$mainfontoptions$$sep$,$endfor$]{$mainfont$} +$endif$ +$if(sansfont)$ + \setsansfont[$for(sansfontoptions)$$sansfontoptions$$sep$,$endfor$]{$sansfont$} +$endif$ +$if(monofont)$ + \setmonofont[$for(monofontoptions)$$monofontoptions$$sep$,$endfor$]{$monofont$} +$endif$ +$for(fontfamilies)$ + \newfontfamily{$fontfamilies.name$}[$for(fontfamilies.options)$$fontfamilies.options$$sep$,$endfor$]{$fontfamilies.font$} +$endfor$ +$if(mathfont)$ +$if(mathspec)$ + \ifXeTeX + \setmathfont(Digits,Latin,Greek)[$for(mathfontoptions)$$mathfontoptions$$sep$,$endfor$]{$mathfont$} + \else + \setmathfont[$for(mathfontoptions)$$mathfontoptions$$sep$,$endfor$]{$mathfont$} + \fi +$else$ + \setmathfont[$for(mathfontoptions)$$mathfontoptions$$sep$,$endfor$]{$mathfont$} +$endif$ +$endif$ +$if(CJKmainfont)$ + \ifXeTeX + \usepackage{xeCJK} + \setCJKmainfont[$for(CJKoptions)$$CJKoptions$$sep$,$endfor$]{$CJKmainfont$} + $if(CJKsansfont)$ + \setCJKsansfont[$for(CJKoptions)$$CJKoptions$$sep$,$endfor$]{$CJKsansfont$} + $endif$ + $if(CJKmonofont)$ + \setCJKmonofont[$for(CJKoptions)$$CJKoptions$$sep$,$endfor$]{$CJKmonofont$} + $endif$ + \fi +$endif$ +$if(luatexjapresetoptions)$ + \ifLuaTeX + \usepackage[$for(luatexjapresetoptions)$$luatexjapresetoptions$$sep$,$endfor$]{luatexja-preset} + \fi +$endif$ +$if(CJKmainfont)$ + \ifLuaTeX + \usepackage[$for(luatexjafontspecoptions)$$luatexjafontspecoptions$$sep$,$endfor$]{luatexja-fontspec} + \setmainjfont[$for(CJKoptions)$$CJKoptions$$sep$,$endfor$]{$CJKmainfont$} + \fi +$endif$ +\fi +$if(zero-width-non-joiner)$ +%% Support for zero-width non-joiner characters. +\makeatletter +\def\zerowidthnonjoiner{% + % Prevent ligatures and adjust kerning, but still support hyphenating. + \texorpdfstring{% + \TextOrMath{\nobreak\discretionary{-}{}{\kern.03em}% + \ifvmode\else\nobreak\hskip\z@skip\fi}{}% + }{}% +} +\makeatother +\ifPDFTeX + \DeclareUnicodeCharacter{200C}{\zerowidthnonjoiner} +\else + \catcode`^^^^200c=\active + \protected\def ^^^^200c{\zerowidthnonjoiner} +\fi +%% End of ZWNJ support +$endif$ % Use upquote if available, for straight quotes in verbatim environments \IfFileExists{upquote.sty}{\usepackage{upquote}}{} \IfFileExists{microtype.sty}{% use microtype if available @@ -249,7 +279,6 @@ $endif$ \definecolor{default-filecolor}{HTML}{A50000} \definecolor{default-citecolor}{HTML}{4077C0} \definecolor{default-urlcolor}{HTML}{4077C0} -\IfFileExists{xurl.sty}{\usepackage{xurl}}{} % add URL line breaks if available $if(footnotes-pretty)$ % load footmisc in order to customize footnotes (footmisc has to be loaded before hyperref, cf. https://tex.stackexchange.com/a/169124/144087) \usepackage[hang,flushmargin,bottom,multiple]{footmisc} @@ -258,38 +287,6 @@ $if(footnotes-pretty)$ \setlength{\skip\footins}{0.3cm} % set space between page content and footnote \setlength{\footskip}{0.9cm} % set space between footnote and page bottom $endif$ -\IfFileExists{bookmark.sty}{\usepackage{bookmark}}{\usepackage{hyperref}} -\hypersetup{ -$if(title-meta)$ - pdftitle={$title-meta$}, -$endif$ -$if(author-meta)$ - pdfauthor={$author-meta$}, -$endif$ -$if(lang)$ - pdflang={$lang$}, -$endif$ -$if(subject)$ - pdfsubject={$subject$}, -$endif$ -$if(keywords)$ - pdfkeywords={$for(keywords)$$keywords$$sep$, $endfor$}, -$endif$ -$if(colorlinks)$ - colorlinks=true, - linkcolor=$if(linkcolor)$$linkcolor$$else$default-linkcolor$endif$, - filecolor=$if(filecolor)$$filecolor$$else$default-filecolor$endif$, - citecolor=$if(citecolor)$$citecolor$$else$default-citecolor$endif$, - urlcolor=$if(urlcolor)$$urlcolor$$else$default-urlcolor$endif$, -$else$ - hidelinks, -$endif$ - breaklinks=true, - pdfcreator={LaTeX via pandoc with the Eisvogel template}} -\urlstyle{same} % disable monospaced font for URLs -$if(verbatim-in-note)$ -\VerbatimFootnotes % allow verbatim text in footnotes -$endif$ $if(geometry)$ $if(beamer)$ \geometry{$for(geometry)$$geometry$$sep$,$endfor$} @@ -302,7 +299,7 @@ $else$ \usepackage[margin=2.5cm,includehead=true,includefoot=true,centering,$for(geometry)$$geometry$$sep$,$endfor$]{geometry} $endif$ $endif$ -$if(logo)$ +$if(titlepage-logo)$ \usepackage[export]{adjustbox} \usepackage{graphicx} $endif$ @@ -377,17 +374,30 @@ $if(graphics)$ \setkeys{Gin}{width=\maxwidth,height=\maxheight,keepaspectratio} % Set default figure placement to htbp \makeatletter -\def\fps@figure{htbp} +% Make use of float-package and set default placement for figures to H. +% The option H means 'PUT IT HERE' (as opposed to the standard h option which means 'You may put it here if you like'). +\usepackage{float} +\floatplacement{figure}{$if(float-placement-figure)$$float-placement-figure$$else$H$endif$} \makeatother $endif$ -$if(links-as-notes)$ -% Make links footnotes instead of hotlinks: -\DeclareRobustCommand{\href}[2]{#2\footnote{\url{#1}}} +$if(svg)$ +\usepackage{svg} $endif$ $if(strikeout)$ -\usepackage[normalem]{ulem} -% Avoid problems with \sout in headers with hyperref -\pdfstringdefDisableCommands{\renewcommand{\sout}{}} +$-- also used for underline +\ifLuaTeX + \usepackage{luacolor} + \usepackage[soul]{lua-ul} +\else +\usepackage{soul} +$if(CJKmainfont)$ + \ifXeTeX + % soul's \st doesn't work for CJK: + \usepackage{xeCJKfntef} + \renewcommand{\st}[1]{\sout{#1}} + \fi +$endif$ +\fi $endif$ \setlength{\emergencystretch}{3em} % prevent overfull lines \providecommand{\tightlist}{% @@ -397,6 +407,9 @@ $if(numbersections)$ $else$ \setcounter{secnumdepth}{-\maxdimen} % remove section numbering $endif$ +$if(subfigure)$ +\usepackage{subcaption} +$endif$ $if(beamer)$ $else$ $if(block-headings)$ @@ -414,47 +427,74 @@ $endif$ $if(pagestyle)$ \pagestyle{$pagestyle$} $endif$ - -% Make use of float-package and set default placement for figures to H. -% The option H means 'PUT IT HERE' (as opposed to the standard h option which means 'You may put it here if you like'). -\usepackage{float} -\floatplacement{figure}{$if(float-placement-figure)$$float-placement-figure$$else$H$endif$} - -$for(header-includes)$ -$header-includes$ -$endfor$ +$if(csl-refs)$ +% definitions for citeproc citations +\NewDocumentCommand\citeproctext{}{} +\NewDocumentCommand\citeproc{mm}{% + \begingroup\def\citeproctext{#2}\cite{#1}\endgroup} +\makeatletter + % allow citations to break across lines + \let\@cite@ofmt\@firstofone + % avoid brackets around text for \cite: + \def\@biblabel#1{} + \def\@cite#1#2{{#1\if@tempswa , #2\fi}} +\makeatother +\newlength{\cslhangindent} +\setlength{\cslhangindent}{1.5em} +\newlength{\csllabelwidth} +\setlength{\csllabelwidth}{3em} +\newenvironment{CSLReferences}[2] % #1 hanging-indent, #2 entry-spacing + {\begin{list}{}{% + \setlength{\itemindent}{0pt} + \setlength{\leftmargin}{0pt} + \setlength{\parsep}{0pt} + % turn on hanging indent if param 1 is 1 + \ifodd #1 + \setlength{\leftmargin}{\cslhangindent} + \setlength{\itemindent}{-1\cslhangindent} + \fi + % set entry spacing + \setlength{\itemsep}{#2\baselineskip}}} + {\end{list}} +\usepackage{calc} +\newcommand{\CSLBlock}[1]{\hfill\break\parbox[t]{\linewidth}{\strut\ignorespaces#1\strut}} +\newcommand{\CSLLeftMargin}[1]{\parbox[t]{\csllabelwidth}{\strut#1\strut}} +\newcommand{\CSLRightInline}[1]{\parbox[t]{\linewidth - \csllabelwidth}{\strut#1\strut}} +\newcommand{\CSLIndent}[1]{\hspace{\cslhangindent}#1} +$endif$ $if(lang)$ -\ifxetex - $if(mainfont)$ - $else$ - % See issue https://github.com/reutenauer/polyglossia/issues/127 - \renewcommand*\familydefault{\sfdefault} - $endif$ - % Load polyglossia as late as possible: uses bidi with RTL langages (e.g. Hebrew, Arabic) - \usepackage{polyglossia} - \setmainlanguage[$for(polyglossia-lang.options)$$polyglossia-lang.options$$sep$,$endfor$]{$polyglossia-lang.name$} -$for(polyglossia-otherlangs)$ - \setotherlanguage[$for(polyglossia-otherlangs.options)$$polyglossia-otherlangs.options$$sep$,$endfor$]{$polyglossia-otherlangs.name$} -$endfor$ +\ifLuaTeX +\usepackage[bidi=basic]{babel} \else - \usepackage[$for(babel-otherlangs)$$babel-otherlangs$,$endfor$main=$babel-lang$]{babel} +\usepackage[bidi=default]{babel} +\fi +$if(babel-lang)$ +\babelprovide[main,import]{$babel-lang$} +$if(mainfont)$ +\ifPDFTeX +\else +\babelfont{rm}[$for(mainfontoptions)$$mainfontoptions$$sep$,$endfor$]{$mainfont$} +\fi +$endif$ +$endif$ +$for(babel-otherlangs)$ +\babelprovide[import]{$babel-otherlangs$} +$endfor$ +$for(babelfonts/pairs)$ +\babelfont[$babelfonts.key$]{rm}{$babelfonts.value$} +$endfor$ % get rid of language-specific shorthands (see #6817): \let\LanguageShortHands\languageshorthands \def\languageshorthands#1{} -$if(babel-newcommands)$ - $babel-newcommands$ $endif$ -\fi -$endif$ -\ifluatex +$for(header-includes)$ +$header-includes$ +$endfor$ +\ifLuaTeX \usepackage{selnolig} % disable illegal ligatures \fi $if(dir)$ -\ifxetex - % Load bidi as late as possible as it modifies e.g. graphicx - \usepackage{bidi} -\fi -\ifnum 0\ifxetex 1\fi\ifluatex 1\fi=0 % if pdftex +\ifPDFTeX \TeXXeTstate=1 \newcommand{\RL}[1]{\beginR #1\endR} \newcommand{\LR}[1]{\beginL #1\endL} @@ -472,32 +512,49 @@ $for(bibliography)$ \addbibresource{$bibliography$} $endfor$ $endif$ -$if(csl-refs)$ -\newlength{\cslhangindent} -\setlength{\cslhangindent}{1.5em} -\newlength{\csllabelwidth} -\setlength{\csllabelwidth}{3em} -\newenvironment{CSLReferences}[2] % #1 hanging-ident, #2 entry spacing - {% don't indent paragraphs - \setlength{\parindent}{0pt} - % turn on hanging indent if param 1 is 1 - \ifodd #1 \everypar{\setlength{\hangindent}{\cslhangindent}}\ignorespaces\fi - % set entry spacing - \ifnum #2 > 0 - \setlength{\parskip}{#2\baselineskip} - \fi - }% - {} -\usepackage{calc} -\newcommand{\CSLBlock}[1]{#1\hfill\break} -\newcommand{\CSLLeftMargin}[1]{\parbox[t]{\csllabelwidth}{#1}} -\newcommand{\CSLRightInline}[1]{\parbox[t]{\linewidth - \csllabelwidth}{#1}\break} -\newcommand{\CSLIndent}[1]{\hspace{\cslhangindent}#1} +$if(nocite-ids)$ +\nocite{$for(nocite-ids)$$it$$sep$, $endfor$} $endif$ $if(csquotes)$ \usepackage{csquotes} $endif$ - +\IfFileExists{bookmark.sty}{\usepackage{bookmark}}{\usepackage{hyperref}} +\IfFileExists{xurl.sty}{\usepackage{xurl}}{} % add URL line breaks if available +\urlstyle{$if(urlstyle)$$urlstyle$$else$same$endif$} +$if(links-as-notes)$ +% Make links footnotes instead of hotlinks: +\DeclareRobustCommand{\href}[2]{#2\footnote{\url{#1}}} +$endif$ +$if(verbatim-in-note)$ +\VerbatimFootnotes % allow verbatim text in footnotes +$endif$ +\hypersetup{ +$if(title-meta)$ + pdftitle={$title-meta$}, +$endif$ +$if(author-meta)$ + pdfauthor={$author-meta$}, +$endif$ +$if(lang)$ + pdflang={$lang$}, +$endif$ +$if(subject)$ + pdfsubject={$subject$}, +$endif$ +$if(keywords)$ + pdfkeywords={$for(keywords)$$keywords$$sep$, $endfor$}, +$endif$ +$if(colorlinks)$ + colorlinks=true, + linkcolor={$if(linkcolor)$$linkcolor$$else$default-linkcolor$endif$}, + filecolor={$if(filecolor)$$filecolor$$else$default-filecolor$endif$}, + citecolor={$if(citecolor)$$citecolor$$else$default-citecolor$endif$}, + urlcolor={$if(urlcolor)$$urlcolor$$else$default-urlcolor$endif$}, +$else$ + hidelinks, +$endif$ + breaklinks=true, + pdfcreator={LaTeX via pandoc with the Eisvogel template}} $if(title)$ \title{$title$$if(thanks)$\thanks{$thanks$}$endif$} $endif$ @@ -533,35 +590,6 @@ $endif$ %% added %% -% -% language specification -% -% If no language is specified, use English as the default main document language. -% -$if(lang)$$else$ -\ifnum 0\ifxetex 1\fi\ifluatex 1\fi=0 % if pdftex - \usepackage[shorthands=off,$for(babel-otherlangs)$$babel-otherlangs$,$endfor$main=english]{babel} -$if(babel-newcommands)$ - $babel-newcommands$ -$endif$ -\else - $if(mainfont)$ - $else$ - % Workaround for bug in Polyglossia that breaks `\familydefault` when `\setmainlanguage` is used. - % See https://github.com/Wandmalfarbe/pandoc-latex-template/issues/8 - % See https://github.com/reutenauer/polyglossia/issues/186 - % See https://github.com/reutenauer/polyglossia/issues/127 - \renewcommand*\familydefault{\sfdefault} - $endif$ - % load polyglossia as late as possible as it *could* call bidi if RTL lang (e.g. Hebrew or Arabic) - \usepackage{polyglossia} - \setmainlanguage[]{english} -$for(polyglossia-otherlangs)$ - \setotherlanguage[$polyglossia-otherlangs.options$]{$polyglossia-otherlangs.name$} -$endfor$ -\fi -$endif$ - $if(page-background)$ \usepackage[pages=all]{background} $endif$ @@ -613,7 +641,7 @@ $endif$ \item\relax\color{blockquote-text}\ignorespaces}{\unskip\unskip\endlist\end{customblockquote}} % -% Source Sans Pro as the de­fault font fam­ily +% Source Sans Pro as the default font family % Source Code Pro for monospace text % % 'default' option sets the default @@ -689,11 +717,6 @@ $if(tables)$ \renewcommand{\arraystretch}{1.3} % spacing (padding) $if(table-use-row-colors)$ -% TODO: This doesn't work anymore. I don't know why. -% Reset rownum counter so that each table -% starts with the same row colors. -% https://tex.stackexchange.com/questions/170637/restarting-rowcolors -% % Unfortunately the colored cells extend beyond the edge of the % table because pandoc uses @-expressions (@{}) like so: % @@ -701,18 +724,16 @@ $if(table-use-row-colors)$ % \end{longtable} % % https://en.wikibooks.org/wiki/LaTeX/Tables#.40-expressions -\let\oldlongtable\longtable -\let\endoldlongtable\endlongtable -\renewenvironment{longtable}{ -\rowcolors{3}{}{table-row-color!100} % row color -\oldlongtable} { -\endoldlongtable -\global\rownum=0\relax} +\usepackage{etoolbox} +\AtBeginEnvironment{longtable}{\rowcolors{2}{}{table-row-color!100}} +\preto{\toprule}{\hiderowcolors}{}{} +\appto{\endhead}{\showrowcolors}{}{} +\appto{\endfirsthead}{\showrowcolors}{}{} $endif$ $endif$ % -% remove paragraph indention +% remove paragraph indentation % \setlength{\parindent}{0pt} \setlength{\parskip}{6pt plus 2pt minus 1pt} @@ -751,7 +772,10 @@ $else$ framexleftmargin = 2.5em, $endif$ backgroundcolor = \color{listing-background}, - basicstyle = \color{listing-text-color}\linespread{1.0}$if(code-block-font-size)$$code-block-font-size$$else$\small$endif$\ttfamily{}, + basicstyle = \color{listing-text-color}\linespread{1.0}% + \lst@ifdisplaystyle% + $if(code-block-font-size)$$code-block-font-size$$else$\small$endif$% + \fi\ttfamily{}, breaklines = true, frame = single, framesep = 0.19em, @@ -775,8 +799,8 @@ $endif$ 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 @@ -849,21 +873,25 @@ $if(beamer)$ $else$ $if(disable-header-and-footer)$ $else$ -\usepackage{fancyhdr} +\usepackage[headsepline,footsepline]{scrlayer-scrpage} -\fancypagestyle{eisvogel-header-footer}{ - \fancyhead{} - \fancyfoot{} - \lhead[$if(header-right)$$header-right$$else$$date$$endif$]{$if(header-left)$$header-left$$else$$title$$endif$} - \chead[$if(header-center)$$header-center$$else$$endif$]{$if(header-center)$$header-center$$else$$endif$} - \rhead[$if(header-left)$$header-left$$else$$title$$endif$]{$if(header-right)$$header-right$$else$$date$$endif$} - \lfoot[$if(footer-right)$$footer-right$$else$\thepage$endif$]{$if(footer-left)$$footer-left$$else$$for(author)$$author$$sep$, $endfor$$endif$} - \cfoot[$if(footer-center)$$footer-center$$else$$endif$]{$if(footer-center)$$footer-center$$else$$endif$} - \rfoot[$if(footer-left)$$footer-left$$else$$for(author)$$author$$sep$, $endfor$$endif$]{$if(footer-right)$$footer-right$$else$\thepage$endif$} - \renewcommand{\headrulewidth}{0.4pt} - \renewcommand{\footrulewidth}{0.4pt} +\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$} + \cfoot*{$if(footer-center)$$footer-center$$else$$endif$} + \ofoot*{$if(footer-right)$$footer-right$$else$\thepage$endif$} + \addtokomafont{pageheadfoot}{\upshape} } \pagestyle{eisvogel-header-footer} + +$if(book)$ +\deftripstyle{ChapterStyle}{}{}{}{}{\pagemark}{} +\renewcommand*{\chapterpagestyle}{ChapterStyle} +$endif$ + $if(page-background)$ \backgroundsetup{ scale=1, @@ -942,9 +970,9 @@ $else$ } $endif$ -$if(logo)$ +$if(titlepage-logo)$ \noindent -\includegraphics[width=$if(logo-width)$$logo-width$$else$35mm$endif$, left]{$logo$} +\includegraphics[width=$if(logo-width)$$logo-width$$else$35mm$endif$, left]{$titlepage-logo$} $endif$ $if(titlepage-background)$ @@ -954,6 +982,7 @@ $endif$ \end{flushleft} \end{titlepage} \restoregeometry +\pagenumbering{arabic} $else$ $if(maketitle)$ \vspace*{-3\baselineskip} @@ -977,6 +1006,9 @@ $endif$ $if(title)$ $if(beamer)$ \frame{\titlepage} +% don't generate the default title +% $else$ +% \maketitle $endif$ $if(abstract)$ \begin{abstract} @@ -1021,12 +1053,12 @@ $endif$ } $endif$ $endif$ -$if(lot)$ -\listoftables -$endif$ $if(lof)$ \listoffigures $endif$ +$if(lot)$ +\listoftables +$endif$ $if(linestretch)$ \setstretch{$linestretch$} $endif$ diff --git a/examples/basic-example/document.pdf b/examples/basic-example/document.pdf index 48aaa4d..1ab1732 100644 Binary files a/examples/basic-example/document.pdf and b/examples/basic-example/document.pdf differ diff --git a/examples/basic-example/preview.png b/examples/basic-example/preview.png index 7b9fc16..09b5406 100644 Binary files a/examples/basic-example/preview.png and b/examples/basic-example/preview.png differ diff --git a/examples/beamer/document.pdf b/examples/beamer/document.pdf index e77c4ea..b30abb2 100644 Binary files a/examples/beamer/document.pdf and b/examples/beamer/document.pdf differ diff --git a/examples/beamer/preview.png b/examples/beamer/preview.png index cdb8233..fcd3b60 100644 Binary files a/examples/beamer/preview.png and b/examples/beamer/preview.png differ diff --git a/examples/book/document.pdf b/examples/book/document.pdf index d3634b2..069f6a3 100644 Binary files a/examples/book/document.pdf and b/examples/book/document.pdf differ diff --git a/examples/book/preview.png b/examples/book/preview.png index a236122..71f0c3a 100644 Binary files a/examples/book/preview.png and b/examples/book/preview.png differ diff --git a/examples/boxes-with-pandoc-latex-environment-and-awesomebox/document.md b/examples/boxes-with-pandoc-latex-environment-and-awesomebox/document.md index 337351f..7b4b622 100644 --- a/examples/boxes-with-pandoc-latex-environment-and-awesomebox/document.md +++ b/examples/boxes-with-pandoc-latex-environment-and-awesomebox/document.md @@ -70,8 +70,8 @@ Fusce aliquet augue sapien, non efficitur mi ornare sed. Morbi at dictum felis. Pellentesque tortor lacus, semper et neque vitae, egestas commodo nisl. ::: -```caution -::: warning +```markdown +::: caution Lorem ipsum dolor ... ::: ``` diff --git a/examples/boxes-with-pandoc-latex-environment-and-awesomebox/document.pdf b/examples/boxes-with-pandoc-latex-environment-and-awesomebox/document.pdf index 52b8228..94cb8a6 100644 Binary files a/examples/boxes-with-pandoc-latex-environment-and-awesomebox/document.pdf and b/examples/boxes-with-pandoc-latex-environment-and-awesomebox/document.pdf differ diff --git a/examples/boxes-with-pandoc-latex-environment-and-awesomebox/preview.png b/examples/boxes-with-pandoc-latex-environment-and-awesomebox/preview.png index 9fd4413..a496de3 100644 Binary files a/examples/boxes-with-pandoc-latex-environment-and-awesomebox/preview.png and b/examples/boxes-with-pandoc-latex-environment-and-awesomebox/preview.png differ diff --git a/examples/boxes-with-pandoc-latex-environment-and-tcolorbox/document.pdf b/examples/boxes-with-pandoc-latex-environment-and-tcolorbox/document.pdf index e3a6d0f..5f2e0bf 100644 Binary files a/examples/boxes-with-pandoc-latex-environment-and-tcolorbox/document.pdf and b/examples/boxes-with-pandoc-latex-environment-and-tcolorbox/document.pdf differ diff --git a/examples/boxes-with-pandoc-latex-environment-and-tcolorbox/preview.png b/examples/boxes-with-pandoc-latex-environment-and-tcolorbox/preview.png index 4d8fcfa..280614c 100644 Binary files a/examples/boxes-with-pandoc-latex-environment-and-tcolorbox/preview.png and b/examples/boxes-with-pandoc-latex-environment-and-tcolorbox/preview.png differ diff --git a/examples/build-examples.sh b/examples/build-examples.sh index 6812066..a1a399c 100644 --- a/examples/build-examples.sh +++ b/examples/build-examples.sh @@ -13,7 +13,7 @@ containsElement () { return 1 } -# these examples are skipped because they don't run on travis (for now) +# these examples are skipped because they don't run in CI builds (for now) skippedExamples=("language-chinese" "language-japanese") # loop all files in the current folder @@ -35,4 +35,4 @@ for f in *; do cd ".." fi fi -done \ No newline at end of file +done diff --git a/examples/code-blocks-listings/document.pdf b/examples/code-blocks-listings/document.pdf index 912c4a8..126df71 100644 Binary files a/examples/code-blocks-listings/document.pdf and b/examples/code-blocks-listings/document.pdf differ diff --git a/examples/code-blocks-listings/preview.png b/examples/code-blocks-listings/preview.png index eca54c3..ec3b4cd 100644 Binary files a/examples/code-blocks-listings/preview.png and b/examples/code-blocks-listings/preview.png differ diff --git a/examples/code-blocks-without-listings/document.pdf b/examples/code-blocks-without-listings/document.pdf index 976c9a6..e5192e5 100644 Binary files a/examples/code-blocks-without-listings/document.pdf and b/examples/code-blocks-without-listings/document.pdf differ diff --git a/examples/code-blocks-without-listings/preview.png b/examples/code-blocks-without-listings/preview.png index c1465cf..436b85d 100644 Binary files a/examples/code-blocks-without-listings/preview.png and b/examples/code-blocks-without-listings/preview.png differ diff --git a/examples/header-and-footer/document.pdf b/examples/header-and-footer/document.pdf index 181e0f0..4ad4e94 100644 Binary files a/examples/header-and-footer/document.pdf and b/examples/header-and-footer/document.pdf differ diff --git a/examples/header-and-footer/preview.png b/examples/header-and-footer/preview.png index 14fc30e..2df4748 100644 Binary files a/examples/header-and-footer/preview.png and b/examples/header-and-footer/preview.png differ diff --git a/examples/images-and-tables/document.pdf b/examples/images-and-tables/document.pdf index 0f4496c..7d44d9b 100644 Binary files a/examples/images-and-tables/document.pdf and b/examples/images-and-tables/document.pdf differ diff --git a/examples/images-and-tables/preview.png b/examples/images-and-tables/preview.png index 8c1856b..11ffe55 100644 Binary files a/examples/images-and-tables/preview.png and b/examples/images-and-tables/preview.png differ diff --git a/examples/language-chinese/document.pdf b/examples/language-chinese/document.pdf index 845d231..a250906 100644 Binary files a/examples/language-chinese/document.pdf and b/examples/language-chinese/document.pdf differ diff --git a/examples/language-chinese/preview.png b/examples/language-chinese/preview.png index 1cc3490..89ca6e0 100644 Binary files a/examples/language-chinese/preview.png and b/examples/language-chinese/preview.png differ diff --git a/examples/language-german/document.pdf b/examples/language-german/document.pdf index 99dfc04..270a6b3 100644 Binary files a/examples/language-german/document.pdf and b/examples/language-german/document.pdf differ diff --git a/examples/language-german/preview.png b/examples/language-german/preview.png index 79af987..e2e4a85 100644 Binary files a/examples/language-german/preview.png and b/examples/language-german/preview.png differ diff --git a/examples/language-japanese/document.pdf b/examples/language-japanese/document.pdf index 624780d..5a64daf 100644 Binary files a/examples/language-japanese/document.pdf and b/examples/language-japanese/document.pdf differ diff --git a/examples/language-japanese/preview.png b/examples/language-japanese/preview.png index 2fc6b15..6e3a8d4 100644 Binary files a/examples/language-japanese/preview.png and b/examples/language-japanese/preview.png differ diff --git a/examples/page-background/document.pdf b/examples/page-background/document.pdf index 8317798..39ad6b9 100644 Binary files a/examples/page-background/document.pdf and b/examples/page-background/document.pdf differ diff --git a/examples/page-background/preview.png b/examples/page-background/preview.png index e4d59b0..f9fb9e4 100644 Binary files a/examples/page-background/preview.png and b/examples/page-background/preview.png differ diff --git a/examples/table-of-contents/build.sh b/examples/table-of-contents/build.sh new file mode 100644 index 0000000..a2080cf --- /dev/null +++ b/examples/table-of-contents/build.sh @@ -0,0 +1 @@ +pandoc "document.md" -o "document.pdf" --from markdown --template "../../eisvogel.tex" \ No newline at end of file diff --git a/examples/table-of-contents/document.md b/examples/table-of-contents/document.md new file mode 100644 index 0000000..da93460 --- /dev/null +++ b/examples/table-of-contents/document.md @@ -0,0 +1,59 @@ +--- +title: "Example PDF" +author: [Author] +date: "2022-03-04" +subject: "Markdown" +keywords: [Markdown, Example] +lang: "en" +toc: true +toc-own-page: true +... + +# Vinaque sanguine metuenti cuiquam Alcyone fixus + +## Aesculeae domus vincemur et Veneris adsuetus lapsum + +Lorem markdownum Letoia, et alios: figurae flectentem annis aliquid Peneosque ab +esse, obstat gravitate. Obscura atque coniuge, per de coniunx, sibi **medias +commentaque virgine** anima tamen comitemque petis, sed. In Amphion vestros +hamos ire arceor mandere spicula, in licet aliquando. + +```java +public class Example implements LoremIpsum { + public static void main(String[] args) { + if(args.length < 2) { + System.out.println("Lorem ipsum dolor sit amet"); + } + } // Obscura atque coniuge, per de coniunx +} +``` + +Porrigitur et Pallas nuper longusque cratere habuisse sepulcro pectore fertur. +Laudat ille auditi; vertitur iura tum nepotis causa; motus. Diva virtus! Acrota +destruitis vos iubet quo et classis excessere Scyrumve spiro subitusque mente +Pirithoi abstulit, lapides. + +## Lydia caelo recenti haerebat lacerum ratae at + +Te concepit pollice fugit vias alumno **oras** quam potest +[rursus](http://example.com#rursus) optat. Non evadere orbem equorum, spatiis, +vel pede inter si. + +1. De neque iura aquis +2. Frangitur gaudia mihi eo umor terrae quos +3. Recens diffudit ille tantum + +\begin{equation}\label{eq:neighbor-propability} + p_{ij}(t) = \frac{\ell_j(t) - \ell_i(t)}{\sum_{k \in N_i(t)}^{} \ell_k(t) - \ell_i(t)} +\end{equation} + +Tamen condeturque saxa Pallorque num et ferarum promittis inveni lilia iuvencae +adessent arbor. Florente perque at condeturque saxa et ferarum promittis tendebat. Armos nisi obortas refugit me. + +> Et nepotes poterat, se qui. Euntem ego pater desuetaque aethera Maeandri, et +[Dardanio geminaque](http://example.com#Dardanio_geminaque) cernit. Lassaque poenas +nec, manifesta $\pi r^2$ mirantia captivarum prohibebant scelerato gradus unusque +dura. + +- Permulcens flebile simul +- Iura tum nepotis causa motus diva virtus Acrota. Tamen condeturque saxa Pallorque num et ferarum promittis inveni lilia iuvencae adessent arbor. Florente perque at ire arcum. \ No newline at end of file diff --git a/examples/table-of-contents/document.pdf b/examples/table-of-contents/document.pdf new file mode 100644 index 0000000..be5342c Binary files /dev/null and b/examples/table-of-contents/document.pdf differ diff --git a/examples/table-of-contents/preview.png b/examples/table-of-contents/preview.png new file mode 100644 index 0000000..ffe8135 Binary files /dev/null and b/examples/table-of-contents/preview.png differ diff --git a/examples/title-page-background/document.pdf b/examples/title-page-background/document.pdf index c3d4b13..371e704 100644 Binary files a/examples/title-page-background/document.pdf and b/examples/title-page-background/document.pdf differ diff --git a/examples/title-page-background/preview.png b/examples/title-page-background/preview.png index efe042c..c8d83bd 100644 Binary files a/examples/title-page-background/preview.png and b/examples/title-page-background/preview.png differ diff --git a/examples/title-page-custom/document.pdf b/examples/title-page-custom/document.pdf index c46880d..01eaba0 100644 Binary files a/examples/title-page-custom/document.pdf and b/examples/title-page-custom/document.pdf differ diff --git a/examples/title-page-custom/preview.png b/examples/title-page-custom/preview.png index 56463f5..41a27ba 100644 Binary files a/examples/title-page-custom/preview.png and b/examples/title-page-custom/preview.png differ diff --git a/examples/title-page-default/document.pdf b/examples/title-page-default/document.pdf index 899bed1..1824c3f 100644 Binary files a/examples/title-page-default/document.pdf and b/examples/title-page-default/document.pdf differ diff --git a/examples/title-page-default/preview.png b/examples/title-page-default/preview.png index defe986..ce094ce 100644 Binary files a/examples/title-page-default/preview.png and b/examples/title-page-default/preview.png differ diff --git a/examples/title-page-green/document.pdf b/examples/title-page-green/document.pdf index d501234..cc5bc67 100644 Binary files a/examples/title-page-green/document.pdf and b/examples/title-page-green/document.pdf differ diff --git a/examples/title-page-green/preview.png b/examples/title-page-green/preview.png index 4f3bae0..3ff8e6b 100644 Binary files a/examples/title-page-green/preview.png and b/examples/title-page-green/preview.png differ diff --git a/examples/title-page-logo/document.md b/examples/title-page-logo/document.md index f016596..df8dfa5 100644 --- a/examples/title-page-logo/document.md +++ b/examples/title-page-logo/document.md @@ -10,7 +10,7 @@ titlepage: true titlepage-text-color: "7137C8" titlepage-rule-color: "7137C8" titlepage-rule-height: 2 -logo: "logo.pdf" +titlepage-logo: "logo.pdf" logo-width: 30mm ... diff --git a/examples/title-page-logo/document.pdf b/examples/title-page-logo/document.pdf index 0d14229..20ed5c5 100644 Binary files a/examples/title-page-logo/document.pdf and b/examples/title-page-logo/document.pdf differ diff --git a/examples/title-page-logo/preview.png b/examples/title-page-logo/preview.png index 32b34d5..1b1d562 100644 Binary files a/examples/title-page-logo/preview.png and b/examples/title-page-logo/preview.png differ diff --git a/tests/build-tests.sh b/tests/build-tests.sh new file mode 100644 index 0000000..76fdfec --- /dev/null +++ b/tests/build-tests.sh @@ -0,0 +1,38 @@ +#!/bin/bash +set -e + +echo "##" +echo "# building tests" +echo "##" +echo "" + +containsElement () { + local e match="$1" + shift + for e; do [[ "$e" == "$match" ]] && return 0; done + return 1 +} + +# these examples are skipped because they don't run in CI builds (for now) +skippedExamples=() + +# loop all files in the current folder +for f in *; do + # run only for folders + if [ -d "$f" ]; then + + if containsElement "$f" "${skippedExamples[@]}"; then + echo "skipping '$f'" + echo "" + else + echo "building '$f'" + cd "$f" + echo " - running pandoc build script" + bash "$PWD/build.sh" + echo " - generating preview" + pdftoppm -r 150 -png "document.pdf" > "preview.png" + echo "" + cd ".." + fi + fi +done diff --git a/tests/heading/build.sh b/tests/heading/build.sh new file mode 100644 index 0000000..ee87a78 --- /dev/null +++ b/tests/heading/build.sh @@ -0,0 +1 @@ +pandoc "document.md" -o "document.pdf" --from markdown --template "../../eisvogel.tex" --listings \ No newline at end of file diff --git a/tests/heading/document.md b/tests/heading/document.md new file mode 100644 index 0000000..60ef278 --- /dev/null +++ b/tests/heading/document.md @@ -0,0 +1,32 @@ +--- +title: "Test: Heading" +author: [Author] +date: "2022-11-24" +subject: "Markdown" +keywords: [Markdown, Example, Text, Heading] +lang: "en" +... + +# Test: Heading + +## Setext-style headings + +level one +========= + +level two +--------- + +## ATX-style headings + +# level one + +## level two + +### level three + +#### level four + +##### level five + +###### level six diff --git a/tests/heading/document.pdf b/tests/heading/document.pdf new file mode 100644 index 0000000..342f291 Binary files /dev/null and b/tests/heading/document.pdf differ diff --git a/tests/heading/preview.png b/tests/heading/preview.png new file mode 100644 index 0000000..babbbbc Binary files /dev/null and b/tests/heading/preview.png differ diff --git a/tests/horizontal-rule/build.sh b/tests/horizontal-rule/build.sh new file mode 100644 index 0000000..ee87a78 --- /dev/null +++ b/tests/horizontal-rule/build.sh @@ -0,0 +1 @@ +pandoc "document.md" -o "document.pdf" --from markdown --template "../../eisvogel.tex" --listings \ No newline at end of file diff --git a/tests/horizontal-rule/document.md b/tests/horizontal-rule/document.md new file mode 100644 index 0000000..f6a9444 --- /dev/null +++ b/tests/horizontal-rule/document.md @@ -0,0 +1,28 @@ +--- +title: "Test: Horizontal Rule" +author: [Author] +date: "2022-11-24" +subject: "Markdown" +keywords: [Markdown, Example, Text, Horizontal Rule] +lang: "en" +... + +# Test: Horizontal Rule + +## Horizontal Rule with `*` (asterisk) + +**** + +********** + +## Horizontal Rule with `-` (minus) + +---- + +---------- + +## Horizontal Rule with `_` (underscore) + +____ + +__________ diff --git a/tests/horizontal-rule/document.pdf b/tests/horizontal-rule/document.pdf new file mode 100644 index 0000000..ecda89e Binary files /dev/null and b/tests/horizontal-rule/document.pdf differ diff --git a/tests/horizontal-rule/preview.png b/tests/horizontal-rule/preview.png new file mode 100644 index 0000000..561da89 Binary files /dev/null and b/tests/horizontal-rule/preview.png differ diff --git a/tests/list-definition/build.sh b/tests/list-definition/build.sh new file mode 100644 index 0000000..ee87a78 --- /dev/null +++ b/tests/list-definition/build.sh @@ -0,0 +1 @@ +pandoc "document.md" -o "document.pdf" --from markdown --template "../../eisvogel.tex" --listings \ No newline at end of file diff --git a/tests/list-definition/document.md b/tests/list-definition/document.md new file mode 100644 index 0000000..b13d021 --- /dev/null +++ b/tests/list-definition/document.md @@ -0,0 +1,29 @@ +--- +title: "Test: Definition List" +author: [Author] +date: "2022-11-24" +subject: "Markdown" +keywords: [Markdown, Example, Text, List, Definition List] +lang: "en" +... + +# Test: Definition List + +## Definition List with single definition + +Apple +: Pomaceous fruit of plants of the genus Malus in +the family Rosaceae. + +Orange +: The fruit of an evergreen tree of the genus Citrus. + +## Definition List with multiple definitions + +Apple +: Pomaceous fruit of plants of the genus Malus in + the family Rosaceae. +: An American computer company. + +Orange +: The fruit of an evergreen tree of the genus Citrus. diff --git a/tests/list-definition/document.pdf b/tests/list-definition/document.pdf new file mode 100644 index 0000000..04c3d19 Binary files /dev/null and b/tests/list-definition/document.pdf differ diff --git a/tests/list-definition/preview.png b/tests/list-definition/preview.png new file mode 100644 index 0000000..d466e63 Binary files /dev/null and b/tests/list-definition/preview.png differ diff --git a/tests/list-ordered/build.sh b/tests/list-ordered/build.sh new file mode 100644 index 0000000..ee87a78 --- /dev/null +++ b/tests/list-ordered/build.sh @@ -0,0 +1 @@ +pandoc "document.md" -o "document.pdf" --from markdown --template "../../eisvogel.tex" --listings \ No newline at end of file diff --git a/tests/list-ordered/document.md b/tests/list-ordered/document.md new file mode 100644 index 0000000..0a60ef6 --- /dev/null +++ b/tests/list-ordered/document.md @@ -0,0 +1,43 @@ +--- +title: "Lists" +author: [Author] +date: "2022-11-24" +subject: "Markdown" +keywords: [Markdown, Example, Text, List, Ordered List] +lang: "en" +... + +# Test: Lists + +## Ordered list with number and period + +2. two +3. three +4. four + +## Ordered list with number and bracket + +8) eight +9) nine +10) ten + +## Ordered list with roman numerals + +II. one +III. two +IV. three + +## Ordered nested list + +1. one + 1) orange + 2) apple + * pine + * maple + 3) orange +2. two + 1. sunny + II. two + III. three + IV. four + 2. rainy diff --git a/tests/list-ordered/document.pdf b/tests/list-ordered/document.pdf new file mode 100644 index 0000000..2e06493 Binary files /dev/null and b/tests/list-ordered/document.pdf differ diff --git a/tests/list-ordered/preview.png b/tests/list-ordered/preview.png new file mode 100644 index 0000000..e796602 Binary files /dev/null and b/tests/list-ordered/preview.png differ diff --git a/tests/list-task/build.sh b/tests/list-task/build.sh new file mode 100644 index 0000000..ee87a78 --- /dev/null +++ b/tests/list-task/build.sh @@ -0,0 +1 @@ +pandoc "document.md" -o "document.pdf" --from markdown --template "../../eisvogel.tex" --listings \ No newline at end of file diff --git a/tests/list-task/document.md b/tests/list-task/document.md new file mode 100644 index 0000000..e6b5128 --- /dev/null +++ b/tests/list-task/document.md @@ -0,0 +1,34 @@ +--- +title: "Test: Task List" +author: [Author] +date: "2022-11-24" +subject: "Markdown" +keywords: [Markdown, Example, Text, List, Task List] +lang: "en" +... + +# Test: Task List + +## Task list unchecked + +- [ ] one +- [ ] two +- [ ] three + +## Task list checked + +- [x] one +- [x] two +- [x] three + +## Task list nested + +- [x] one + - [ ] orange + - [ ] apple + - [x] pine + - [x] maple + - [ ] mango +- [ ] two + - [x] sunny + - [ ] rainy diff --git a/tests/list-task/document.pdf b/tests/list-task/document.pdf new file mode 100644 index 0000000..97534f3 Binary files /dev/null and b/tests/list-task/document.pdf differ diff --git a/tests/list-task/preview.png b/tests/list-task/preview.png new file mode 100644 index 0000000..0d3be0a Binary files /dev/null and b/tests/list-task/preview.png differ diff --git a/tests/list-unordered/build.sh b/tests/list-unordered/build.sh new file mode 100644 index 0000000..ee87a78 --- /dev/null +++ b/tests/list-unordered/build.sh @@ -0,0 +1 @@ +pandoc "document.md" -o "document.pdf" --from markdown --template "../../eisvogel.tex" --listings \ No newline at end of file diff --git a/tests/list-unordered/document.md b/tests/list-unordered/document.md new file mode 100644 index 0000000..fdd36a1 --- /dev/null +++ b/tests/list-unordered/document.md @@ -0,0 +1,43 @@ +--- +title: "List Unordered" +author: [Author] +date: "2022-11-24" +subject: "Markdown" +keywords: [Markdown, Example, Text, List, Unordered List] +lang: "en" +... + +# Test: List Unordered + +## Unordered list with dash + +- one +- two +- three + +## Unordered list with asterisk + +* one +* two +* three + +## Unordered list with plus sign + ++ one ++ two ++ three + +## Unordered nested list + +- one + - orange + - apple + * pine + * maple + - orange +- two + + sunny + * four + * five + * six + + rainy diff --git a/tests/list-unordered/document.pdf b/tests/list-unordered/document.pdf new file mode 100644 index 0000000..a838e82 Binary files /dev/null and b/tests/list-unordered/document.pdf differ diff --git a/tests/list-unordered/preview.png b/tests/list-unordered/preview.png new file mode 100644 index 0000000..a7f7b94 Binary files /dev/null and b/tests/list-unordered/preview.png differ