Skip to content

Commit

Permalink
feat: create single file templates (latex and beamer)
Browse files Browse the repository at this point in the history
  • Loading branch information
Wandmalfarbe committed Jan 10, 2025
1 parent 071d062 commit bd28515
Show file tree
Hide file tree
Showing 47 changed files with 69 additions and 30 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/build-examples.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ jobs:
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: Generate a temporary release with single file template versions
run: bash ./tools/release.sh 0.0.0
- name: Build examples
run: cd examples && bash build-examples.sh && cd ..
- name: Add generated example files
Expand Down
2 changes: 1 addition & 1 deletion examples/basic-example/build.sh
Original file line number Diff line number Diff line change
@@ -1 +1 @@
pandoc "document.md" -o "document.pdf" --from markdown --template "../../template/eisvogel.latex" --listings
pandoc "document.md" -o "document.pdf" --from markdown --template "../../dist/eisvogel.latex" --listings
Binary file modified examples/basic-example/document.pdf
Binary file not shown.
2 changes: 1 addition & 1 deletion examples/beamer/build.sh
Original file line number Diff line number Diff line change
@@ -1 +1 @@
pandoc "document.md" -o "document.pdf" --from markdown --to beamer --template "../../template/eisvogel.beamer" --listings
pandoc "document.md" -o "document.pdf" --from markdown --to beamer --template "../../dist/eisvogel.beamer" --listings
Binary file modified examples/beamer/document.pdf
Binary file not shown.
2 changes: 1 addition & 1 deletion examples/book/build.sh
Original file line number Diff line number Diff line change
@@ -1 +1 @@
pandoc "document.md" -o "document.pdf" --from markdown --template "../../template/eisvogel.latex" --listings --top-level-division="chapter"
pandoc "document.md" -o "document.pdf" --from markdown --template "../../dist/eisvogel.latex" --listings --top-level-division="chapter"
Binary file modified examples/book/document.pdf
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1 +1 @@
pandoc "document.md" -o "document.pdf" --from markdown --template "../../template/eisvogel.latex" --filter pandoc-latex-environment --listings
pandoc "document.md" -o "document.pdf" --from markdown --template "../../dist/eisvogel.latex" --filter pandoc-latex-environment --listings
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1 +1 @@
pandoc "document.md" -o "document.pdf" --from markdown --template "../../template/eisvogel.latex" --filter pandoc-latex-environment --listings
pandoc "document.md" -o "document.pdf" --from markdown --template "../../dist/eisvogel.latex" --filter pandoc-latex-environment --listings
Binary file not shown.
2 changes: 1 addition & 1 deletion examples/code-blocks-listings/build.sh
Original file line number Diff line number Diff line change
@@ -1 +1 @@
pandoc "document.md" -o "document.pdf" --from markdown --template "../../template/eisvogel.latex" --listings
pandoc "document.md" -o "document.pdf" --from markdown --template "../../dist/eisvogel.latex" --listings
Binary file modified examples/code-blocks-listings/document.pdf
Binary file not shown.
2 changes: 1 addition & 1 deletion examples/code-blocks-without-listings/build.sh
Original file line number Diff line number Diff line change
@@ -1 +1 @@
pandoc "document.md" -o "document.pdf" --from markdown --template "../../template/eisvogel.latex" --highlight-style kate
pandoc "document.md" -o "document.pdf" --from markdown --template "../../dist/eisvogel.latex" --highlight-style kate
Binary file modified examples/code-blocks-without-listings/document.pdf
Binary file not shown.
2 changes: 1 addition & 1 deletion examples/header-and-footer/build.sh
Original file line number Diff line number Diff line change
@@ -1 +1 @@
pandoc "document.md" -o "document.pdf" --from markdown --template "../../template/eisvogel.latex" --listings
pandoc "document.md" -o "document.pdf" --from markdown --template "../../dist/eisvogel.latex" --listings
Binary file modified examples/header-and-footer/document.pdf
Binary file not shown.
2 changes: 1 addition & 1 deletion examples/images-and-tables/build.sh
Original file line number Diff line number Diff line change
@@ -1 +1 @@
pandoc "document.md" -o "document.pdf" --from markdown --template "../../template/eisvogel.latex" --listings
pandoc "document.md" -o "document.pdf" --from markdown --template "../../dist/eisvogel.latex" --listings
Binary file modified examples/images-and-tables/document.pdf
Binary file not shown.
2 changes: 1 addition & 1 deletion examples/language-chinese/build.sh
Original file line number Diff line number Diff line change
@@ -1,2 +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 "../../template/eisvogel.latex" --listings --pdf-engine "xelatex" -V CJKmainfont="HiraginoSans-W4"
pandoc "document.md" -o "document.pdf" --from markdown --template "../../dist/eisvogel.latex" --listings --pdf-engine "xelatex" -V CJKmainfont="HiraginoSans-W4"
2 changes: 1 addition & 1 deletion examples/language-german/build.sh
Original file line number Diff line number Diff line change
@@ -1 +1 @@
pandoc "document.md" -o "document.pdf" --from markdown --template "../../template/eisvogel.latex" --listings
pandoc "document.md" -o "document.pdf" --from markdown --template "../../dist/eisvogel.latex" --listings
Binary file modified examples/language-german/document.pdf
Binary file not shown.
2 changes: 1 addition & 1 deletion examples/language-japanese/build.sh
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# No lang option (-V lang=jp) here because Japanese unsupported in polyglossia.
pandoc "document.md" -o "document.pdf" --from markdown --template "../../template/eisvogel.latex" --listings --pdf-engine "xelatex" -V CJKmainfont="HiraginoSans-W4"
pandoc "document.md" -o "document.pdf" --from markdown --template "../../dist/eisvogel.latex" --listings --pdf-engine "xelatex" -V CJKmainfont="HiraginoSans-W4"
2 changes: 1 addition & 1 deletion examples/page-background/build.sh
Original file line number Diff line number Diff line change
@@ -1 +1 @@
pandoc "document.md" -o "document.pdf" --from markdown --template "../../template/eisvogel.latex" --listings
pandoc "document.md" -o "document.pdf" --from markdown --template "../../dist/eisvogel.latex" --listings
Binary file modified examples/page-background/document.pdf
Binary file not shown.
2 changes: 1 addition & 1 deletion examples/table-of-contents/build.sh
Original file line number Diff line number Diff line change
@@ -1 +1 @@
pandoc "document.md" -o "document.pdf" --from markdown --template "../../template/eisvogel.latex"
pandoc "document.md" -o "document.pdf" --from markdown --template "../../dist/eisvogel.latex"
Binary file modified examples/table-of-contents/document.pdf
Binary file not shown.
2 changes: 1 addition & 1 deletion examples/title-page-background/build.sh
Original file line number Diff line number Diff line change
@@ -1 +1 @@
pandoc "document.md" -o "document.pdf" --from markdown --template "../../template/eisvogel.latex" --listings
pandoc "document.md" -o "document.pdf" --from markdown --template "../../dist/eisvogel.latex" --listings
Binary file modified examples/title-page-background/document.pdf
Binary file not shown.
2 changes: 1 addition & 1 deletion examples/title-page-custom/build.sh
Original file line number Diff line number Diff line change
@@ -1 +1 @@
pandoc "document.md" -o "document.pdf" --from markdown --template "../../template/eisvogel.latex" --listings
pandoc "document.md" -o "document.pdf" --from markdown --template "../../dist/eisvogel.latex" --listings
Binary file modified examples/title-page-custom/document.pdf
Binary file not shown.
2 changes: 1 addition & 1 deletion examples/title-page-default/build.sh
Original file line number Diff line number Diff line change
@@ -1 +1 @@
pandoc "document.md" -o "document.pdf" --from markdown --template "../../template/eisvogel.latex" --listings
pandoc "document.md" -o "document.pdf" --from markdown --template "../../dist/eisvogel.latex" --listings
Binary file modified examples/title-page-default/document.pdf
Binary file not shown.
2 changes: 1 addition & 1 deletion examples/title-page-green/build.sh
Original file line number Diff line number Diff line change
@@ -1 +1 @@
pandoc "document.md" -o "document.pdf" --from markdown --template "../../template/eisvogel.latex" --listings
pandoc "document.md" -o "document.pdf" --from markdown --template "../../dist/eisvogel.latex" --listings
Binary file modified examples/title-page-green/document.pdf
Binary file not shown.
2 changes: 1 addition & 1 deletion examples/title-page-logo/build.sh
Original file line number Diff line number Diff line change
@@ -1 +1 @@
pandoc "document.md" -o "document.pdf" --from markdown --template "../../template/eisvogel.latex" --listings
pandoc "document.md" -o "document.pdf" --from markdown --template "../../dist/eisvogel.latex" --listings
Binary file modified examples/title-page-logo/document.pdf
Binary file not shown.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ $eisvogel-added.latex()$

\begin{document}

$eisvogel-titlepage.latex()$
$eisvogel-title-page.latex()$

$if(has-frontmatter)$
\frontmatter
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
57 changes: 47 additions & 10 deletions tools/release.sh
Original file line number Diff line number Diff line change
@@ -1,16 +1,53 @@
#!/bin/bash

rm -rf "dist"
mkdir "dist"
distFolderName="dist"
archiveFolderName="Eisvogel-${1}"
archiveFolder="${distFolderName}/${archiveFolderName}"

cp "eisvogel.tex" "eisvogel.latex"
rm -rf "${distFolderName}"
mkdir "${distFolderName}"
mkdir "${distFolderName}/${archiveFolderName}"

# create .zip files
zip -r -X --exclude="*.DS_Store*" "dist/Eisvogel-${1}.zip" "examples" "eisvogel.latex" "icon.png" "LICENSE" "README.md" "CHANGELOG.md"
cp "dist/Eisvogel-${1}.zip" "dist/Eisvogel.zip"
# create single template file for latex
cp "template-multi-file/eisvogel.latex" "${distFolderName}/eisvogel.latex"

# create .tar.gz files
tar --exclude="*.DS_Store*" --include="examples" --include="eisvogel.latex" --include="icon.png" --include="LICENSE" --include="README.md" --include="CHANGELOG.md" -zcvf "dist/Eisvogel-${1}.tar.gz" *
cp "dist/Eisvogel-${1}.tar.gz" "dist/Eisvogel.tar.gz"
# replace partials (latex)
sed -e '/\$fonts\.latex()\$/ {' -e 'r template-multi-file/fonts.latex' -e 'd' -e '}' -i '' "${distFolderName}/eisvogel.latex"
sed -e '/\$common\.latex()\$/ {' -e 'r template-multi-file/common.latex' -e 'd' -e '}' -i '' "${distFolderName}/eisvogel.latex"
sed -e '/\$eisvogel-added\.latex()\$/ {' -e 'r template-multi-file/eisvogel-added.latex' -e 'd' -e '}' -i '' "${distFolderName}/eisvogel.latex"
sed -e '/\$eisvogel-title-page\.latex()\$/ {' -e 'r template-multi-file/eisvogel-title-page.latex' -e 'd' -e '}' -i '' "${distFolderName}/eisvogel.latex"
sed -e '/\$after-header-includes\.latex()\$/ {' -e 'r template-multi-file/after-header-includes.latex' -e 'd' -e '}' -i '' "${distFolderName}/eisvogel.latex"
sed -e '/\$hypersetup\.latex()\$/ {' -e 'r template-multi-file/hypersetup.latex' -e 'd' -e '}' -i '' "${distFolderName}/eisvogel.latex"
sed -e '/\$passoptions\.latex()\$/ {' -e 'r template-multi-file/passoptions.latex' -e 'd' -e '}' -i '' "${distFolderName}/eisvogel.latex"

rm "eisvogel.latex"
# create single template file for beamer
cp "template-multi-file/eisvogel.beamer" "${distFolderName}/eisvogel.beamer"

# replace partials (beamer)
sed -e '/\$fonts\.latex()\$/ {' -e 'r template-multi-file/fonts.latex' -e 'd' -e '}' -i '' "${distFolderName}/eisvogel.beamer"
sed -e '/\$common\.latex()\$/ {' -e 'r template-multi-file/common.latex' -e 'd' -e '}' -i '' "${distFolderName}/eisvogel.beamer"
# The beamer template has no eisvogel block $eisvogel-added.latex()$
# The beamer template has no eisvogel titlepage $eisvogel-titlepage.latex()$
sed -e '/\$after-header-includes\.latex()\$/ {' -e 'r template-multi-file/after-header-includes.latex' -e 'd' -e '}' -i '' "${distFolderName}/eisvogel.beamer"
sed -e '/\$hypersetup\.latex()\$/ {' -e 'r template-multi-file/hypersetup.latex' -e 'd' -e '}' -i '' "${distFolderName}/eisvogel.beamer"
sed -e '/\$passoptions\.latex()\$/ {' -e 'r template-multi-file/passoptions.latex' -e 'd' -e '}' -i '' "${distFolderName}/eisvogel.beamer"


# create folder for the release eisvogel (ZIP and tar.gz)
cp -r "examples" "${archiveFolder}/examples"
cp -r "template-multi-file" "${archiveFolder}/template-multi-file"
cp "dist/eisvogel.latex" "${archiveFolder}/eisvogel.latex"
cp "dist/eisvogel.beamer" "${archiveFolder}/eisvogel.beamer"
cp "icon.png" "${archiveFolder}/icon.png"
cp "LICENSE" "${archiveFolder}/LICENSE"
cp "README.md" "${archiveFolder}/README.md"
cp "CHANGELOG.md" "${archiveFolder}/CHANGELOG.md"


cd dist

# create .zip file
zip -r -X --exclude="*.DS_Store*" "Eisvogel-${1}.zip" "${archiveFolderName}"

# create .tar.gz file
tar --exclude="*.DS_Store*" -zcvf "Eisvogel-${1}.tar.gz" "Eisvogel-${1}"

0 comments on commit bd28515

Please sign in to comment.