Restructure Examples & Add new build script
10
README.md
@ -10,7 +10,7 @@ A clean **pandoc LaTeX template** to convert your markdown files to PDF or LaTeX
|
||||
|
||||
| A custom title page | A basic example page |
|
||||
| :------------------: | :------------------: |
|
||||
| [![A custom title page](examples/custom-titlepage/custom-titlepage.png)](examples/custom-titlepage/custom-titlepage.pdf) | [![A basic example page](examples/basic-example/basic-example.png)](examples/basic-example/basic-example.pdf) |
|
||||
| [![A custom title page](examples/title-page-custom/preview.png)](examples/title-page-custom/document.pdf) | [![A basic example page](examples/basic-example/preview.png)](examples/basic-example/document.pdf) |
|
||||
|
||||
## Installation
|
||||
|
||||
@ -319,19 +319,19 @@ There will be one blank page before each chapter because the template is two-sid
|
||||
|
||||
| A green title page | A background image on the title page |
|
||||
| :----------------: | :----------------: |
|
||||
| [![A green title page](examples/green-titlepage/green-titlepage.png)](examples/green-titlepage/green-titlepage.pdf) | [![A background image on the title page](examples/titlepage-background/titlepage-background.png)](examples/titlepage-background/titlepage-background.pdf) |
|
||||
| [![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) |
|
||||
|
||||
| images and tables | Code blocks styled without listings |
|
||||
| :---------------: | :---------------: |
|
||||
| [![images and tables](examples/images-and-tables/images-and-tables.png)](examples/images-and-tables/images-and-tables.pdf) | [![Code blocks styled without listings](examples/without-listings/without-listings.png)](examples/without-listings/without-listings.pdf) |
|
||||
| [![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) |
|
||||
|
||||
| A book | Code blocks styled with listings |
|
||||
| :----: | :----: |
|
||||
| [![A book](examples/book/book.png)](examples/book/book.pdf) | [![Code blocks styled with listings](examples/listings/listings.png)](examples/listings/listings.pdf) |
|
||||
| [![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 background images on all pages | CJK Support (when using XeLaTeX) |
|
||||
| :----: | :----: |
|
||||
| [![A background images on all pages](examples/page-background/page-background.png)](examples/page-background/page-background.pdf) | [![CJK Support (when using XeLaTeX)](examples/japanese/japanese.png)](examples/japanese/japanese.pdf) |
|
||||
| [![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) |
|
||||
|
||||
## Common Errors / Issues
|
||||
|
||||
|
Before Width: | Height: | Size: 228 KiB |
1
examples/basic-example/build.sh
Normal file
@ -0,0 +1 @@
|
||||
pandoc "document.md" -o "document.pdf" --from markdown --template "../../eisvogel.tex" --listings
|
BIN
examples/basic-example/preview.png
Normal file
After Width: | Height: | Size: 227 KiB |
Before Width: | Height: | Size: 176 KiB |
1
examples/beamer/build.sh
Normal file
@ -0,0 +1 @@
|
||||
pandoc "document.md" -o "document.pdf" --from markdown --to beamer --template "../../eisvogel.tex" --listings
|
BIN
examples/beamer/preview.png
Normal file
After Width: | Height: | Size: 177 KiB |
Before Width: | Height: | Size: 555 KiB |
1
examples/book/build.sh
Normal file
@ -0,0 +1 @@
|
||||
pandoc "document.md" -o "document.pdf" --from markdown --template "../../eisvogel.tex" --listings --top-level-division="chapter"
|
BIN
examples/book/document.pdf
Normal file
BIN
examples/book/preview.png
Normal file
After Width: | Height: | Size: 554 KiB |
Before Width: | Height: | Size: 348 KiB |
@ -0,0 +1 @@
|
||||
pandoc "document.md" -o "document.pdf" --from markdown --template "../../eisvogel.tex" --filter pandoc-latex-environment --listings
|
After Width: | Height: | Size: 350 KiB |
Before Width: | Height: | Size: 175 KiB |
@ -0,0 +1 @@
|
||||
pandoc "document.md" -o "document.pdf" --from markdown --template "../../eisvogel.tex" --filter pandoc-latex-environment --listings
|
After Width: | Height: | Size: 176 KiB |
@ -3,103 +3,50 @@ set -e
|
||||
cp "../eisvogel.tex" "../eisvogel.latex"
|
||||
|
||||
echo "##"
|
||||
echo "# Building examples"
|
||||
echo "# building examples"
|
||||
echo "##"
|
||||
echo ""
|
||||
|
||||
echo "- header-and-footer"
|
||||
# Important: The template file will be searched in the '--resource-path' if it
|
||||
# is specified. So in order to find the template we have to include the cwd
|
||||
# into the resource path as well by specifying a '.' and separating the
|
||||
# two paths with a ':' (should be ';' on windows).
|
||||
pandoc "header-and-footer/header-and-footer.md" -o "header-and-footer/header-and-footer.pdf" --from markdown --template "../eisvogel.latex" --listings --resource-path ".:./header-and-footer/"
|
||||
pdftoppm -r 150 -png "header-and-footer/header-and-footer.pdf" > "header-and-footer/header-and-footer.png"
|
||||
# Reset
|
||||
Color_Off='\033[0m' # Text Reset
|
||||
|
||||
echo "- page-background"
|
||||
cd "page-background"
|
||||
pandoc "page-background.md" -o "page-background.pdf" --from markdown --template "../../eisvogel.latex" --listings
|
||||
pdftoppm -r 150 -png "page-background.pdf" > "page-background.png"
|
||||
cd ".."
|
||||
# Regular Colors
|
||||
Black='\033[0;30m' # Black
|
||||
Red='\033[0;31m' # Red
|
||||
Green='\033[0;32m' # Green
|
||||
Yellow='\033[0;33m' # Yellow
|
||||
Blue='\033[0;34m' # Blue
|
||||
Purple='\033[0;35m' # Purple
|
||||
Cyan='\033[0;36m' # Cyan
|
||||
White='\033[0;37m' # White
|
||||
|
||||
echo "- titlepage-background"
|
||||
cd "titlepage-background"
|
||||
pandoc "titlepage-background.md" -o "titlepage-background.pdf" --from markdown --template "../../eisvogel.latex" --listings
|
||||
pdftoppm -r 150 -png "titlepage-background.pdf" > "titlepage-background.png"
|
||||
cd ".."
|
||||
containsElement () {
|
||||
local e match="$1"
|
||||
shift
|
||||
for e; do [[ "$e" == "$match" ]] && return 0; done
|
||||
return 1
|
||||
}
|
||||
|
||||
echo "- basic-example"
|
||||
pandoc "basic-example/basic-example.md" -o "basic-example/basic-example.pdf" --from markdown --template "../eisvogel.latex" --listings
|
||||
pdftoppm -r 150 -png "basic-example/basic-example.pdf" > "basic-example/basic-example.png"
|
||||
# these examples are skipped because they don't run on travis (for now)
|
||||
skippedExamples=("images-and-tables")
|
||||
|
||||
echo "- beamer"
|
||||
pandoc "beamer/beamer.md" -o "beamer/beamer.pdf" --from markdown --to beamer --template "../eisvogel.latex" --listings
|
||||
pdftoppm -r 150 -png "beamer/beamer.pdf" > "beamer/beamer.png"
|
||||
# loop all files in the current folder
|
||||
for f in *; do
|
||||
# run only for folders
|
||||
if [ -d "$f" ]; then
|
||||
|
||||
echo "- custom-titlepage"
|
||||
cd "custom-titlepage"
|
||||
pandoc "custom-titlepage.md" -o "custom-titlepage.pdf" --from markdown --template "../../eisvogel.latex" --listings
|
||||
pdftoppm -r 150 -png "custom-titlepage.pdf" > "custom-titlepage.png"
|
||||
cd ".."
|
||||
|
||||
echo "- default-titlepage"
|
||||
pandoc "default-titlepage/default-titlepage.md" -o "default-titlepage/default-titlepage.pdf" --from markdown --template "../eisvogel.latex" --listings
|
||||
pdftoppm -r 150 -png "default-titlepage/default-titlepage.pdf" > "default-titlepage/default-titlepage.png"
|
||||
|
||||
echo "- german"
|
||||
# No lang option (-V lang=de) here because the language
|
||||
# is set in the markdown file via the YAML metadata block.
|
||||
pandoc "german/german.md" -o "german/german.pdf" --from markdown --template "../eisvogel.latex" --highlight-style kate
|
||||
pdftoppm -r 150 -png "german/german.pdf" > "german/german.png"
|
||||
|
||||
# No lang option (-V lang=jp) here because Japanese unsupported in polyglossia.
|
||||
# These commands are disabled because the CJK font isn't available on travis.
|
||||
#pandoc "japanese/japanese.md" -o "japanese/japanese.pdf" --from markdown --template "../eisvogel.latex" --listings --pdf-engine=xelatex -V CJKmainfont="HiraginoSans-W4"
|
||||
#pdftoppm -r 150 -png "japanese/japanese.pdf" > "japanese/japanese.png"
|
||||
|
||||
echo "- listings"
|
||||
pandoc "listings/listings.md" -o "listings/listings.pdf" --from markdown --template "../eisvogel.latex" --listings
|
||||
pdftoppm -r 150 -png "listings/listings.pdf" > "listings/listings.png"
|
||||
|
||||
echo "- without-listings"
|
||||
pandoc "without-listings/without-listings.md" -o "without-listings/without-listings.pdf" --from markdown --template "../eisvogel.latex" --highlight-style kate
|
||||
pdftoppm -r 150 -png "without-listings/without-listings.pdf" > "without-listings/without-listings.png"
|
||||
|
||||
echo "- green-titlepage"
|
||||
pandoc "green-titlepage/green-titlepage.md" -o "green-titlepage/green-titlepage.pdf" --from markdown --template "../eisvogel.latex" --listings
|
||||
pdftoppm -r 150 -png "green-titlepage/green-titlepage.pdf" > "green-titlepage/green-titlepage.png"
|
||||
|
||||
echo "- book"
|
||||
# Additional options like `book: true` and `classoption: [oneside]` are set in the markdown file via the YAML metadata block.
|
||||
pandoc "book/book.md" -o "book/book.pdf" --from markdown --template "../eisvogel.latex" --listings --top-level-division="chapter"
|
||||
pdftoppm -r 150 -png "book/book.pdf" > "book/book.png"
|
||||
|
||||
echo "- boxes-with-pandoc-latex-environment-and-awesomebox"
|
||||
pandoc "boxes-with-pandoc-latex-environment-and-awesomebox/boxes.md" -o "boxes-with-pandoc-latex-environment-and-awesomebox/boxes.pdf" --from markdown --template "../eisvogel.latex" --filter pandoc-latex-environment --listings
|
||||
pdftoppm -r 150 -png "boxes-with-pandoc-latex-environment-and-awesomebox/boxes.pdf" > "boxes-with-pandoc-latex-environment-and-awesomebox/boxes.png"
|
||||
|
||||
echo "- boxes-with-pandoc-latex-environment-and-tcolorbox"
|
||||
pandoc "boxes-with-pandoc-latex-environment-and-tcolorbox/boxes-tcolorbox.md" -o "boxes-with-pandoc-latex-environment-and-tcolorbox/boxes-tcolorbox.pdf" --from markdown --template "../eisvogel.latex" --filter pandoc-latex-environment --listings
|
||||
pdftoppm -r 150 -png "boxes-with-pandoc-latex-environment-and-tcolorbox/boxes-tcolorbox.pdf" > "boxes-with-pandoc-latex-environment-and-tcolorbox/boxes-tcolorbox.png"
|
||||
|
||||
# No lang option (-V lang=zh) here because Chinese is unsupported in polyglossia and babel.
|
||||
# These commands are disabled because the CJK font isn't available on travis.
|
||||
#pandoc "chinese/chinese.md" -o "chinese/chinese.pdf" --from markdown --template "../eisvogel.latex" --listings --pdf-engine=xelatex -V CJKmainfont="HiraginoSans-W4"
|
||||
#pdftoppm -r 150 -png "chinese/chinese.pdf" > "chinese/chinese.png"
|
||||
|
||||
echo "- images-and-tables"
|
||||
# Important: The template file will be searched in the '--resource-path' if it
|
||||
# is specified. So in order to find the template we have to include the cwd
|
||||
# into the resource path as well by specifying a '.' and separating the
|
||||
# two paths with a ':' (should be ';' on windows).
|
||||
pandoc "images-and-tables/images-and-tables.md" -o "images-and-tables/images-and-tables.pdf" --from markdown --template "../eisvogel.latex" --listings --resource-path ".:./images-and-tables/"
|
||||
pdftoppm -r 150 -png "images-and-tables/images-and-tables.pdf" > "images-and-tables/images-and-tables.png"
|
||||
|
||||
echo "- logo-titlepage"
|
||||
# Important: Since the logo is a manually included image, the option "--resource-path" can't be used for specifying its location.
|
||||
# The location of the logo has to be relative to where pandoc is executed, so we cd into the directory with the logo.
|
||||
cd "logo-titlepage"
|
||||
pandoc "logo-titlepage.md" -o "logo-titlepage.pdf" --from markdown --template "../../eisvogel.latex" --listings
|
||||
pdftoppm -r 150 -png "logo-titlepage.pdf" > "logo-titlepage.png"
|
||||
cd ".."
|
||||
|
||||
rm "../eisvogel.latex"
|
||||
if containsElement "$f" "${skippedExamples[@]}"; then
|
||||
echo "${Yellow}skipping '$f'${Color_Off}"
|
||||
echo ""
|
||||
else
|
||||
echo "${Blue}building '$f'${Color_Off}"
|
||||
cd "$f"
|
||||
echo " - running pandoc build script"
|
||||
sh "$PWD/build.sh"
|
||||
echo " - generating preview"
|
||||
pdftoppm -r 150 -png "document.pdf" > "preview.png"
|
||||
echo ""
|
||||
cd ".."
|
||||
fi
|
||||
fi
|
||||
done
|
Before Width: | Height: | Size: 625 KiB |
1
examples/code-blocks-listings/build.sh
Normal file
@ -0,0 +1 @@
|
||||
pandoc "document.md" -o "document.pdf" --from markdown --template "../../eisvogel.tex" --listings
|
BIN
examples/code-blocks-listings/document.pdf
Normal file
BIN
examples/code-blocks-listings/preview.png
Normal file
After Width: | Height: | Size: 214 KiB |
1
examples/code-blocks-without-listings/build.sh
Normal file
@ -0,0 +1 @@
|
||||
pandoc "document.md" -o "document.pdf" --from markdown --template "../../eisvogel.tex" --highlight-style kate
|
BIN
examples/code-blocks-without-listings/document.pdf
Normal file
BIN
examples/code-blocks-without-listings/preview.png
Normal file
After Width: | Height: | Size: 168 KiB |
Before Width: | Height: | Size: 280 KiB |
Before Width: | Height: | Size: 265 KiB |
Before Width: | Height: | Size: 247 KiB |
Before Width: | Height: | Size: 266 KiB |
1
examples/header-and-footer/build.sh
Normal file
@ -0,0 +1 @@
|
||||
pandoc "document.md" -o "document.pdf" --from markdown --template "../../eisvogel.tex" --listings
|
BIN
examples/header-and-footer/document.pdf
Normal file
Before Width: | Height: | Size: 235 KiB |
BIN
examples/header-and-footer/preview.png
Normal file
After Width: | Height: | Size: 235 KiB |
1
examples/images-and-tables/build.sh
Normal file
@ -0,0 +1 @@
|
||||
pandoc "document.md" -o "document.pdf" --from markdown --template "../../eisvogel.tex" --listings
|
Before Width: | Height: | Size: 432 KiB After Width: | Height: | Size: 432 KiB |
Before Width: | Height: | Size: 512 KiB |
2
examples/language-chinese/build.sh
Normal file
@ -0,0 +1,2 @@
|
||||
# No lang option (-V lang=zh) here because Chinese is unsupported in polyglossia and babel.
|
||||
pandoc "document.md" -o "document.pdf" --from markdown --template "../../eisvogel.tex" --listings --pdf-engine "xelatex" -V CJKmainfont="HiraginoSans-W4"
|
BIN
examples/language-chinese/document.pdf
Normal file
BIN
examples/language-chinese/preview.png
Normal file
After Width: | Height: | Size: 625 KiB |
1
examples/language-german/build.sh
Normal file
@ -0,0 +1 @@
|
||||
pandoc "document.md" -o "document.pdf" --from markdown --template "../../eisvogel.tex" --listings
|
BIN
examples/language-german/preview.png
Normal file
After Width: | Height: | Size: 228 KiB |
2
examples/language-japanese/build.sh
Normal file
@ -0,0 +1,2 @@
|
||||
# No lang option (-V lang=jp) here because Japanese unsupported in polyglossia.
|
||||
pandoc "document.md" -o "document.pdf" --from markdown --template "../../eisvogel.tex" --listings --pdf-engine "xelatex" -V CJKmainfont="HiraginoSans-W4"
|
BIN
examples/language-japanese/document.pdf
Normal file
BIN
examples/language-japanese/preview.png
Normal file
After Width: | Height: | Size: 510 KiB |
Before Width: | Height: | Size: 213 KiB |
Before Width: | Height: | Size: 271 KiB |
1
examples/page-background/build.sh
Normal file
@ -0,0 +1 @@
|
||||
pandoc "document.md" -o "document.pdf" --from markdown --template "../../eisvogel.tex" --listings
|
Before Width: | Height: | Size: 259 KiB |
BIN
examples/page-background/preview.png
Normal file
After Width: | Height: | Size: 260 KiB |
1
examples/title-page-background/build.sh
Normal file
@ -0,0 +1 @@
|
||||
pandoc "document.md" -o "document.pdf" --from markdown --template "../../eisvogel.tex" --listings
|
BIN
examples/title-page-background/preview.png
Normal file
After Width: | Height: | Size: 276 KiB |
1
examples/title-page-custom/build.sh
Normal file
@ -0,0 +1 @@
|
||||
pandoc "document.md" -o "document.pdf" --from markdown --template "../../eisvogel.tex" --listings
|
Before Width: | Height: | Size: 2.9 KiB After Width: | Height: | Size: 2.9 KiB |
BIN
examples/title-page-custom/preview.png
Normal file
After Width: | Height: | Size: 279 KiB |