diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..372ce04 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,63 @@ +name: Build + +# Controls when the action will run. Triggers the workflow on push or pull request +# events but only for the master branch +on: + push: + paths: + - "**.tex" + - "**.yml" + branches: [ master ] + pull_request: + paths: + - "**.tex" + - "**.yml" + branches: [ master ] + + +# A workflow run is made up of one or more jobs that can run sequentially or in parallel +jobs: + build: + name: Build all files + runs-on: ubuntu-latest + container: + image: xucheng/texlive-small:latest + defaults: + run: + shell: sh + steps: + - name: Set up repo + uses: actions/checkout@v2 + - name: Install missing packages + run: | + tlmgr install silence appendixnumberbeamer fira fontaxes mwe + - name: Build minimal examples + working-directory: minimal_examples/ + run: | + ln -s ../*.sty ./ + ln -s ../logos ./ + latexmk -pdf -file-line-error -interaction=nonstopmode *.tex + - name: Build compare examples + working-directory: compare_examples/ + run: | + ln -s ../*.sty ./ + ln -s ../logos ./ + latexmk -pdf -file-line-error -interaction=nonstopmode *example*.tex + - name: Build demo document + run: | + latexmk -pdf -file-line-error -interaction=nonstopmode demo.tex + - name: PDFs to PNGs + uses: docker://frapsoft/fish:latest + with: + args: fish ./.github/workflows/convert_pdf_to_png.fish + if: github.event_name == 'push' + - name: Sync docs + uses: kai-tub/external-repo-sync-action@v1 + with: + source-directory: "./" + include-patterns: "demo.pdf *.png" + exclude-patterns: "*.tmp.png logos" + commit-message: "Updating LaTeX documentation files" + env: + GH_ACCESS_TOKEN: ${{ secrets.GH_ACCESS_TOKEN }} + if: github.event_name == 'push' diff --git a/.github/workflows/convert_pdf_to_png.fish b/.github/workflows/convert_pdf_to_png.fish new file mode 100644 index 0000000..90455ee --- /dev/null +++ b/.github/workflows/convert_pdf_to_png.fish @@ -0,0 +1,37 @@ +#!/bin/fish + +function convert_minimal_examples + set files (find ./minimal_examples -type d -path '*/.git' -prune -o -name '*.pdf' -print) + for file_ in $files + echo "$file_" + set target (string replace '.pdf' '.png' "$file_") + convert -density 500 "$file_"[0] "$target" + end +end + +function convert_compare_examples + set files (find ./compare_examples -type d -path '*/.git' -prune -o -name '*example*.pdf' -print) + + for file_ in $files + echo "$file_" + set convert_target (string replace -r '(.*)\.pdf' '$1-%02d.tmp.png' "$file_") + set montage_source (string replace -r '(.*)\.pdf' '$1-*.png' "$file_") + set montage_target (string replace -r '(.*)\.pdf' '$1.tmp.png' "$file_") + convert -density 300 "$file_" "$convert_target" + montage "$montage_source" -geometry +10+10 -tile 1x -background gray -colorspace RGB "$montage_target" + # maybe next to each other + end + montage ./compare_examples/pureminimalistic_example_dark.tmp.png ./compare_examples/defaultbeamer_example.tmp.png -geometry +2+2 -tile 2x -background gray ./compare_examples/comparison_dark.png + montage ./compare_examples/pureminimalistic_example_light.tmp.png ./compare_examples/defaultbeamer_example.tmp.png -geometry +2+2 -tile 2x -background gray ./compare_examples/comparison_light.png +end + +function convert_demo + convert -density 300 demo.pdf demo-%02d.tmp.png + montage demo-*.png -geometry +10+10 -tile 4x -background gray demo.png +end + +apk add --no-cache imagemagick + +convert_demo +convert_minimal_examples +convert_compare_examples diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 5c3a4dd..2c3fb35 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -35,14 +35,6 @@ jobs: asset_path: ./pureminimalistic.tar.gz asset_name: pureminimalistic.tar.gz asset_content_type: application/tar.gz - # Then this action has to first download the pdf - # - name: Upload pdf - # uses: actions/upload-release-asset@v1 - # with: - # upload_url: ${{ steps.release.outputs.upload_url }} - # asset_path: ./demo.pdf - # asset_name: demo.pdf - # asset_content_type: application/pdf - name: Action tagger uses: Actions-R-Us/actions-tagger@latest with: diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml deleted file mode 100644 index 9e1d96a..0000000 --- a/.github/workflows/tests.yml +++ /dev/null @@ -1,83 +0,0 @@ -name: tests - -# Controls when the action will run. Triggers the workflow on push or pull request -# events but only for the master branch -on: - push: - paths: - - "**.tex" - branches: [ master ] - pull_request: - paths: - - "**.tex" - - "**.yml" - branches: [ master ] - - -# A workflow run is made up of one or more jobs that can run sequentially or in parallel -jobs: - # This workflow contains a single job called "build_latex" - build_and_run_tests: - name: Build and run tests - runs-on: ubuntu-latest - container: - image: xucheng/texlive-small:latest - defaults: - run: - shell: sh - steps: - - name: Set up repo - uses: actions/checkout@v2 - - name: Build test files - run: | - python3 tests/generate_all_options.py --ci-mode - - name: Install missing packages - run: | - tlmgr install silence - tlmgr install appendixnumberbeamer - - name: Run tests - working-directory: tests/tmp/ - run: | - latexmk -pdf -file-line-error -interaction=nonstopmode *.tex - - name: Build demo document - run: | - latexmk -pdf -file-line-error -interaction=nonstopmode demo.tex - - name: Upload demo document as artifact - uses: actions/upload-artifact@v2 - with: - name: demo.pdf - path: demo.pdf - - build_docs: - name: Build documentation - runs-on: ubuntu-latest - needs: build_and_run_tests - steps: - - name: Set up repo - uses: actions/checkout@v2 - with: - ref: ${{ github.head_ref }} - - name: Download demo.pdf - uses: actions/download-artifact@v2 - with: - name: demo.pdf - - name: Build images for docs - run: | - mkdir -p demo-screenshots - sudo mv /etc/ImageMagick-6/policy.xml /etc/ImageMagick-6/policy.xmlout - convert -density 500 demo.pdf[0] demo-screenshots/example00.png - convert -density 500 demo.pdf[4] demo-screenshots/example01.png - convert -density 500 demo.pdf[12] demo-screenshots/example02.png - - name: Move to docs folder - run: | - mkdir -p docs - mv demo-screenshots docs/ - mv demo.pdf docs/ - - name: Upload Documentation to wiki - uses: kai-tub/external-repo-sync-action@v1 - with: - source-directory: "docs/" - include-pattern: "*.png *.pdf " - commit-message: "Updating LaTeX documentation" - env: - GH_ACCESS_TOKEN: ${{ secrets.GH_ACCESS_TOKEN }} diff --git a/.gitignore b/.gitignore index b16aeda..9a93236 100644 --- a/.gitignore +++ b/.gitignore @@ -289,4 +289,5 @@ TSWLatexianTemp* *.tar.gz *.zip tmp/ -latex-beamer-pure-minimalistic.wiki/ \ No newline at end of file +latex-beamer-pure-minimalistic.wiki/ +__latexindent_temp.tex \ No newline at end of file diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index ae98bbd..21fc7b2 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -13,13 +13,17 @@ If you find a typo in the documentation, do not hesitate to submit a GitHub pull go ahead and implement it. ## PR guide -If you implemented a new feature, which uses a new option argument, you are likely required to change the tests. -Don't worry it is very easy to integrate the test. Simply open the [generate_all_options.py](tests/generate_all_options.py) and -add the new option with a descriptive name to the `OPTIONS` dictionary. What will happen in your PR now is that the -[template document](tests/template.tex) will be compiled once with all options. This ensures that there are no other +If you implemented a new feature, you should add a new minimal example +in the [minimal_examples](./minimal_examples/) folder. +Then the [demo.tex](demo.tex) file should be modified to explain +how the option should be used and what the effect is. + +In the PR all minimal examples will be compiled automatically. +This ensures that there are no other breaking changes to other options. To speed up the tests, a minimal `texlive` distribution is used. If your changes -require new packages, they have to be added to the [workflow file](.github/workflows/main.yml). -(This may change in the future) +require new packages, they have to be added to the +[build file](.github/workflows/build.yml). + If anything is unclear, feel free to start the PR and mention the part that is hard to understand. I am happy to help. :) If everything is OK, and all the tests are passing for the PR, I will reproduce and inspect the new feature locally, @@ -31,4 +35,5 @@ If you are not familiar with creating a Pull Requeest, here are some guides: Afterwards you will be added to the list of contributers. -Thanks for your hard work and for sticking around until the end of the guide! :tada::tada::tada: \ No newline at end of file +Thanks for your hard work and for sticking around until +the end of the guide! :tada::tada::tada: diff --git a/README.md b/README.md index 7481981..d9deb8f 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@
-![Pure Minimalistic Theme](logos/institute_logo_darkmode.png) +![Pure Minimalistic Theme](logos/institute_logo_darkmode.png) [![Release](https://badgen.net/github/tag/kai-tub/latex_beamer_pure_minimalistic/?label=Newest%20release)](https://github.com/kai-tub/latex_beamer_pure_minimalistic/releases) [![GitHub license](https://badgen.net/github/license/kai-tub/latex_beamer_pure_minimalistic/)](https://github.com/kai-tub/latex_beamer_pure_minimalistic/blob/master/LICENSE) [![Contributor Covenant](https://img.shields.io/badge/Contributor%20Covenant-v2.0%20adopted-ff69b4.svg?color=blue)](CODE_OF_CONDUCT.md) @@ -15,9 +15,16 @@ not on the slides. **Table of contents:** - [Main goals](#main-goals) - [Demo](#demo) +- [Comparison](#comparison) + - [Dark mode](#dark-mode) + - [Light mode](#light-mode) - [Download](#download) - [Instructions](#instructions) - [Customize Logos](#customize-logos) +- [Options](#options) + - [Color](#color) + - [Fonts](#fonts) + - [Footer options](#footer-options) - [Release status](#release-status) - [License](#license) - [Contributing](#contributing) @@ -33,8 +40,9 @@ not on the slides. # Demo -A sample document can be seen in [demo.pdf](demo.pdf), produced -from [demo.tex](demo.tex). +A sample document can be seen in the +[demo.pdf](https://github.com/kai-tub/latex-beamer-pure-minimalistic/wiki/demo.pdf), +produced from [demo.tex](demo.tex). The document shows all of the design decisions, as well as some packages and commands that work well for presentations. For example, starting the @@ -44,13 +52,30 @@ Please use [demo.tex](demo.tex) as a starting point, as exhaustive comments were added to hopefully make everything very clear. +Here is a short *inline teaser* version of the [demo.pdf](https://github.com/kai-tub/latex-beamer-pure-minimalistic/wiki/demo.pdf). + +![demo.pdf](https://github.com/kai-tub/latex-beamer-pure-minimalistic/wiki/demo.png) + +Please look at the [PDF](https://github.com/kai-tub/latex-beamer-pure-minimalistic/wiki/demo.pdf) version for high resulition images. :) + To add videos to the presentation, [pympress](https://github.com/Cimbali/pympress) is highly recommended. This presentation tool works perfectly with Beamer presentations and is available on all major OS! -![example-slide00](https://raw.githubusercontent.com/wiki/kai-tub/latex-beamer-pure-minimalistic/demo-screenshots/example00.png) -![example-slide01](https://raw.githubusercontent.com/wiki/kai-tub/latex-beamer-pure-minimalistic/demo-screenshots/example01.png) -![example-slide02](https://raw.githubusercontent.com/wiki/kai-tub/latex-beamer-pure-minimalistic/demo-screenshots/example02.png) +# Comparison +To show some differences between the default LaTeX beamer +theme and the pure minimalistic beamer theme: + +## Dark mode +On the left is the pure minimalistic theme in dark mode, +and on the right is the default beamer theme. +![comparison-dark](https://raw.githubusercontent.com/wiki/kai-tub/latex-beamer-pure-minimalistic/compare_examples/comparison_dark.png) + +## Light mode +On the left is the pure minimalistic theme in light mode, +and on the right is the default beamer theme. + +![comparison-light](https://raw.githubusercontent.com/wiki/kai-tub/latex-beamer-pure-minimalistic/compare_examples/comparison_light.png) # Download Download the latest release by going to the [release page](https://github.com/kai-tub/latex_beamer_pure_minimalistic/releases). @@ -67,11 +92,104 @@ LaTeX source file. Then include the theme by writing # Customize Logos Right now the theme expects the logos to be present in a -folder `logos` with the names: `header_logo`, `header_logo_darkmode`, `institute_logo` and `institute_logo_darkmode`. Currently, the best way to include +folder `logos` with the names: `header_logo`, `header_logo_darkmode`, `institute_logo` and `institute_logo_darkmode`. +Currently, the best way to include your logo is to replace these files and, if necessary, modify the code where the figures are included in the `beamerouterthemepureminimalistic.sty` file. +# Options + +All options are also described in detail in the +[demo.pdf](https://github.com/kai-tub/latex-beamer-pure-minimalistic/wiki/demo.pdf). + +## Color +The theme includes two default color options. +The default color theme is a light color theme. +The alternative color theme is the dark color theme, enabled with: + +```latex +\usetheme[darkmode]{pureminimalistic} +``` + +To customize the colors, the themes color commands can +be redefined. Please set these *after* loading the theme +and *before* `\begin{document}` for the changes to take effect. + +The following theme color commands exist: +- `\beamertextcolor` +- `\beamerbgcolor` +- `\beamerfootertextcolor` +- `\beamertitlecolor` + +To redefine the background, for example, the following commands +could be used: +```latex +\usetheme{pureminimalistic} +\definecolor{textcolor}{RGB}{0, 0, 120} +\definecolor{title}{RGB}{0, 0, 0} +\definecolor{footercolor}{RGB}{133, 133, 133} +\definecolor{bg}{RGB}{25, 116, 210} + +\renewcommand{\beamertextcolor}{textcolor} +\renewcommand{\beamerbgcolor}{bg} +\renewcommand{\beamerfootertextcolor}{footercolor} +\renewcommand{\beamertitlecolor}{title} +``` + +![custom-color](https://raw.githubusercontent.com/wiki/kai-tub/latex-beamer-pure-minimalistic/minimal_examples/custom_color.png) + +## Fonts +The default fonts are the [Fira Fonts](https://bboxtype.com/typefaces/FiraSans/#!layout=specimen). +This decision was inspired from another awesome beamer theme, +the [Focus beamer theme](https://github.com/elauksap/focus-beamertheme). + +![fira-fonts](https://raw.githubusercontent.com/wiki/kai-tub/latex-beamer-pure-minimalistic/minimal_examples/fira_font.png) + +Some dislike the Fira Fonts. As an alternative this +theme also integrates the *Helvetica* fonts. +The Helvetica fonts are a classical font choice for presentations. + +To use the Helvetica fonts: + +```latex +\usetheme[helvetica, darkmode]{pureminimalistic} +``` + +![helvetica-fonts](https://raw.githubusercontent.com/wiki/kai-tub/latex-beamer-pure-minimalistic/minimal_examples/helvetica_font.png) + +If you prefer the default fonts, disable the Fira Fonts with: + +```latex +\usetheme[nofirafonts, darkmode]{pureminimalistic} +``` + +![helvetica-fonts](https://raw.githubusercontent.com/wiki/kai-tub/latex-beamer-pure-minimalistic/minimal_examples/default_font.png) + +## Footer options + +**Show max slide numbers** + +To show the maximum number of slides, enable the +`showmaxslides` option: + +```latex +\usetheme[showmaxslides, darkmode]{pureminimalistic} +``` + +![show-max-slides](https://raw.githubusercontent.com/wiki/kai-tub/latex-beamer-pure-minimalistic/minimal_examples/show_max_slides.png) + +**Disable footer** + +To disable the footer altogether, including the institute image, +set the `nofooter` option: + +```latex +\usetheme[nofooter, darkmode]{pureminimalistic} +``` + +![no-footer](https://raw.githubusercontent.com/wiki/kai-tub/latex-beamer-pure-minimalistic/minimal_examples/no_footer.png) + # Release status The next steps and thoughts about the next release with possible features can be seen on the [project diff --git a/beamercolorthemepureminimalistic.sty b/beamercolorthemepureminimalistic.sty index 3aba651..6c7bb11 100644 --- a/beamercolorthemepureminimalistic.sty +++ b/beamercolorthemepureminimalistic.sty @@ -32,23 +32,25 @@ \definecolor{pureminimalistic@text@black}{RGB}{0,0,0} \definecolor{pureminimalistic@text@gray}{RGB}{113,113,113} \definecolor{pureminimalistic@text@whiter_gray}{RGB}{200,200,200} -\definecolor{pureminimalistic@text@red}{RGB}{197,14,31} +\definecolor{pureminimalistic@text@red}{RGB}{190,15,30} \definecolor{pureminimalistic@text@white}{RGB}{255, 255, 255} +\newcommand{\beamertitlecolor}{pureminimalistic@text@red} + \ifthenelse{\boolean{darkmode}}{ - \newcommand{\beamerfgcolor}{pureminimalistic@text@white}% + \newcommand{\beamertextcolor}{pureminimalistic@text@white}% \newcommand{\beamerbgcolor}{pureminimalistic@text@black}% - \newcommand{\footergray}{pureminimalistic@text@whiter_gray}% + \newcommand{\beamerfootertextcolor}{pureminimalistic@text@whiter_gray}% }{% - \newcommand{\beamerfgcolor}{pureminimalistic@text@black}% + \newcommand{\beamertextcolor}{pureminimalistic@text@black}% \newcommand{\beamerbgcolor}{pureminimalistic@text@white}% - \newcommand{\footergray}{pureminimalistic@text@gray}% + \newcommand{\beamerfootertextcolor}{pureminimalistic@text@gray}% } -\setbeamercolor*{normal text}{fg=\beamerfgcolor, bg=\beamerbgcolor} -\setbeamercolor*{alerted text}{fg=pureminimalistic@text@red, bg=\beamerbgcolor} -\setbeamercolor*{footline}{fg=\footergray, bg=\beamerbgcolor} -\setbeamercolor*{frametitle}{fg=pureminimalistic@text@red, bg=\beamerbgcolor} +\setbeamercolor*{normal text}{fg=\beamertextcolor, bg=\beamerbgcolor} +\setbeamercolor*{alerted text}{fg=\beamertitlecolor, bg=\beamerbgcolor} +\setbeamercolor*{footline}{fg=\beamerfootertextcolor, bg=\beamerbgcolor} +\setbeamercolor*{frametitle}{fg=\beamertitlecolor, bg=\beamerbgcolor} \setbeamercolor*{author}{parent=normal text} \setbeamercolor*{title}{parent=frametitle} diff --git a/beamerfontthemepureminimalistic.sty b/beamerfontthemepureminimalistic.sty index f22a683..5a18ad0 100644 --- a/beamerfontthemepureminimalistic.sty +++ b/beamerfontthemepureminimalistic.sty @@ -20,13 +20,36 @@ % me over: https://github.com/kai-tub/latex-beamer-pure-minimalistic \ProvidesPackage{beamerfontthemepureminimalistic} +\RequirePackage{ifthen} +\mode + +\newboolean{nofirafonts} +\setboolean{nofirafonts}{false} +\newboolean{helvetica} +\setboolean{helvetica}{false} + +\DeclareOptionBeamer{nofirafonts}{\setboolean{nofirafonts}{true}} +\DeclareOptionBeamer{helvetica}{\setboolean{helvetica}{true}} +\ProcessOptionsBeamer \RequirePackage{silence} % I have no clue how I can fix this warning \WarningFilter{latex}{Font shape declaration has incorrect series value} -\RequirePackage[T1]{fontenc} -\RequirePackage[scaled]{helvet} -\mode + +\ifthenelse{\boolean{helvetica}}{% + % If Helvetica overwrites the fira fonts settings + \RequirePackage[T1]{fontenc} + \RequirePackage[scaled]{helvet} +}{% + \ifthenelse{\boolean{nofirafonts}}{% + % Load default fonts + }{% + % By default load Fira + \RequirePackage[T1]{fontenc} + \RequirePackage[sfdefault]{FiraSans} + \RequirePackage{FiraMono} + } +} \renewcommand\normalsize{\fontsize{12pt}{14pt}\selectfont} \renewcommand\small{\fontsize{10pt}{12pt}\selectfont} @@ -54,6 +77,8 @@ \setbeamerfont*{institute}{parent=normal text} \setbeamerfont{frametitle}{parent=alerted text,size*={16pt}{18pt}} +\setbeamerfont{caption}{series=\normalfont, size=\small} +\setbeamerfont{caption name}{series=\normalfont, size=\small} \setbeamerfont*{itemize/enumerate body}{parent=normal text} \setbeamerfont*{itemize/enumerate subbody}{parent=itemize/enumerate body} diff --git a/beamerinnerthemepureminimalistic.sty b/beamerinnerthemepureminimalistic.sty index b2684d7..abd65bd 100644 --- a/beamerinnerthemepureminimalistic.sty +++ b/beamerinnerthemepureminimalistic.sty @@ -58,6 +58,13 @@ \insertbiblabel } +\setlength{\abovecaptionskip}{0ex} +\setlength{\belowcaptionskip}{1ex} + +\setbeamertemplate{caption}{% + \insertcaption% +} + \defbeamertemplate*{title page}{pureminimalistic}[1][] { \usebeamerfont{title} diff --git a/beamerouterthemepureminimalistic.sty b/beamerouterthemepureminimalistic.sty index d275e62..1c02007 100644 --- a/beamerouterthemepureminimalistic.sty +++ b/beamerouterthemepureminimalistic.sty @@ -29,7 +29,12 @@ \newboolean{showmaxslides} \setboolean{showmaxslides}{false} +\newboolean{nofooter} +\setboolean{nofooter}{false} + \DeclareOptionBeamer{showmaxslides}{\setboolean{showmaxslides}{true}} +\DeclareOptionBeamer{nofooter}{\setboolean{nofooter}{true}} + \ProcessOptionsBeamer % invertcolor is already processed in colortheme @@ -84,18 +89,19 @@ }% \defbeamertemplate*{footline}{pureminimalisticfooter}{% - \leavevmode - \begin{beamercolorbox}[sep=0pt, wd=\myleftmargin, ht=\myfooterheight, dp=1ex]{footline} - \end{beamercolorbox}% - \begin{beamercolorbox}[sep=0pt, wd=\mytextlength, ht=\myfooterheight, dp=1ex]{footline} - \parbox{\linewidth}% - % Don't ask me why I had to insert a space/character after \usebeamercolor - % for it to have an effect on \hrule. Same goes for \color{white} \hrule - { \usebeamercolor[fg]{normal text}\ \hrule } + \ifthenelse{\boolean{nofooter}}{}{% \leavevmode - \begin{beamercolorbox}[sep=0mm, wd=.6\paperwidth, ht=\myfooterheight]{footline}% - \usebeamerfont{footline}% - \vbox to\myfooterheight{% + \begin{beamercolorbox}[sep=0pt, wd=\myleftmargin, ht=\myfooterheight, dp=1ex]{footline} + \end{beamercolorbox}% + \begin{beamercolorbox}[sep=0pt, wd=\mytextlength, ht=\myfooterheight, dp=1ex]{footline} + \parbox{\linewidth}% + % Don't ask me why I had to insert a space/character after \usebeamercolor + % for it to have an effect on \hrule. Same goes for \color{white} \hrule + { \usebeamercolor[fg]{normal text}\ \hrule } + \leavevmode + \begin{beamercolorbox}[sep=0mm, wd=.6\paperwidth, ht=\myfooterheight]{footline}% + \usebeamerfont{footline}% + \vbox to\myfooterheight{% \vfil% \insertshorttitle{} $~|~$ % \insertshortauthor{} $\quad$ % @@ -106,19 +112,20 @@ {}\par% \vfil% \vfil% - }% + }% \end{beamercolorbox}% \begin{beamercolorbox}[sep=0mm, wd=.275\paperwidth,right, ht=\myfooterheight]{footline} \vbox to\myfooterheight{% - \vfil% - \logofootercommand - \vfil% - \vfil% + \vfil% + \logofootercommand + \vfil% + \vfil% }% \end{beamercolorbox}% \end{beamercolorbox}% - \begin{beamercolorbox}[sep=0pt, wd=\myrightmargin, dp=1ex, ht=\myfooterheight]{footline} - \end{beamercolorbox} -} - + \begin{beamercolorbox}[sep=0pt, wd=\myrightmargin, dp=1ex, ht=\myfooterheight]{footline} + \end{beamercolorbox} + } + } + \mode \ No newline at end of file diff --git a/beamerthemepureminimalistic.sty b/beamerthemepureminimalistic.sty index c35f58b..c9bebe8 100644 --- a/beamerthemepureminimalistic.sty +++ b/beamerthemepureminimalistic.sty @@ -21,11 +21,12 @@ \mode -% Requirements -\RequirePackage{tikz} - \DeclareOptionBeamer{darkmode}{\PassOptionsToPackage{darkmode}{beamercolorthemepureminimalistic}} \DeclareOptionBeamer{showmaxslides}{\PassOptionsToPackage{showmaxslides}{beamerouterthemepureminimalistic}} +\DeclareOptionBeamer{nofooter}{\PassOptionsToPackage{nofooter}{beamerouterthemepureminimalistic}} +\DeclareOptionBeamer{nofirafonts}{\PassOptionsToPackage{nofirafonts}{beamerfontthemepureminimalistic}} +\DeclareOptionBeamer{helvetica}{\PassOptionsToPackage{helvetica}{beamerfontthemepureminimalistic}} + \ProcessOptionsBeamer % Settings diff --git a/compare_examples/README.md b/compare_examples/README.md new file mode 100644 index 0000000..2bd414d --- /dev/null +++ b/compare_examples/README.md @@ -0,0 +1,5 @@ +# Compare Examples + +These examples require the pure-minimalistic theme to be +either moved next to the source files, or requires +the theme to be set over the `TEXINPUTS` path. diff --git a/tests/template.tex b/compare_examples/common_header_input.tex similarity index 62% rename from tests/template.tex rename to compare_examples/common_header_input.tex index 1154ab7..18ee3c8 100644 --- a/tests/template.tex +++ b/compare_examples/common_header_input.tex @@ -25,42 +25,21 @@ % \documentclass{beamer} \usepackage[utf8]{inputenc} \usepackage[T1]{fontenc} -\usetheme[]{pureminimalistic} -% \usepackage[backend=biber, doi=false, maxbibnames=2, maxcitenames=2,% -% style=numeric, sorting=none, url=false, eprint=false]{biblatex} -% \addbibresource{demo_bib.bib} + +\usepackage[backend=biber, doi=false, maxbibnames=2, maxcitenames=2,% +style=numeric, sorting=none, url=false, eprint=false]{biblatex} +\addbibresource{demo_bib.bib} % this makes it possible to add backup slides, without counting them \usepackage{appendixnumberbeamer} \renewcommand{\appendixname}{\texorpdfstring{\translate{appendix}}{appendix}} +\usepackage{graphicx} +\usepackage{float} + % if loaded after begin{document} a warning will appear: "pdfauthor already used" -\title[short title]{Test template} +\title[Short title]{This is the normal length of a research paper: +always longer than you would expect} \author{Kai Norman Clasen} -\institute{Testing} +\institute{Insitute name} \date{\today} -\begin{document} -% has to be loaded outside of a frame to work! -\maketitle - -\begin{frame}[fragile]{Testing fragile frame} - \begin{verbatim} - Use the provided \vfilleditems environment to create - nicely spaced bullet points. - - \begin{vfilleditems} - \item In my opinion, I like it to have my bullet points - \item evenly spaced from one another - \item then few bullet points, are not crammed on - the upper part of the slide - \end{vfilleditems} - \end{verbatim} -\end{frame} - -\begin{frame}{Normal frame} - This will show how a normal frame looks like -\end{frame} - - - -\end{document} diff --git a/compare_examples/common_slides_input.tex b/compare_examples/common_slides_input.tex new file mode 100644 index 0000000..21fea41 --- /dev/null +++ b/compare_examples/common_slides_input.tex @@ -0,0 +1,58 @@ +\maketitle + +\begin{frame}{Text} + \begin{columns}[T] + \begin{column}{.48\linewidth} + Lorem ipsum dolor sit amet, consetetur sadipscing elitr, + sed diam nonumy eirmod tempor invidunt ut labore et dolore + magna aliquyam erat, sed diam voluptua. + \end{column} + \begin{column}{.48\linewidth} + \texttt{Lorem ipsum dolor sit amet, + consetetur sadipscing elitr, + sed diam nonumy eirmod tempor invidunt ut labore et dolore + magna aliquyam erat, sed diam voluptua.} + \end{column} + \end{columns} +\end{frame} + +\begin{frame}{Itemize} + Using \texttt{normal itemize} environment: + \begin{itemize} + \item Item 1 + \item Item 2 + \item Item 3 + \item Item 4 + \end{itemize} +\end{frame} + +\begin{frame}{Figures} + \begin{figure}[H] + \centering + \begin{columns}[T] + \begin{column}{.4\linewidth} + \includegraphics[width=\linewidth]{example-image-a} + \caption{Example A} + \end{column} + \begin{column}{.4\linewidth} + \includegraphics[width=\linewidth]{example-image-b} + \caption{Example B} + \end{column} + \end{columns} + \end{figure} +\end{frame} + +\begin{frame}{Show citation} + Cite something \cite{AlexNet} + \vfill + \printbibliography +\end{frame} + +\section*{Backup Slides} +\begin{frame}[plain, noframenumbering] + \centering + \vfill + {\fontsize{30}{40}\selectfont Thanks for considering the pure-minimalistic theme :)} + \vfill +\end{frame} + diff --git a/compare_examples/defaultbeamer_example.tex b/compare_examples/defaultbeamer_example.tex new file mode 100644 index 0000000..31db499 --- /dev/null +++ b/compare_examples/defaultbeamer_example.tex @@ -0,0 +1,5 @@ +\input{common_header_input.tex} + +\begin{document} + \input{common_slides_input.tex} +\end{document} diff --git a/compare_examples/demo_bib.bib b/compare_examples/demo_bib.bib new file mode 100644 index 0000000..a60ab76 --- /dev/null +++ b/compare_examples/demo_bib.bib @@ -0,0 +1,11 @@ +% Encoding: UTF-8 +@InCollection{AlexNet, + author = {Alex Krizhevsky and Ilya Sutskever and Geoffrey E. Hinton}, + title = {{ImageNet} Classification with Deep Convolutional Neural Networks}, + booktitle = {Advances in Neural Information Processing Systems 25}, + publisher = {Curran Associates, Inc.}, + year = {2012}, + pages = {1097--1105}, +} + +@Comment{jabref-meta: databaseType:bibtex;} diff --git a/compare_examples/pureminimalistic_example_dark.tex b/compare_examples/pureminimalistic_example_dark.tex new file mode 100644 index 0000000..e81723a --- /dev/null +++ b/compare_examples/pureminimalistic_example_dark.tex @@ -0,0 +1,6 @@ +\input{common_header_input.tex} +\usetheme[darkmode]{pureminimalistic} + +\begin{document} + \input{common_slides_input.tex} +\end{document} diff --git a/compare_examples/pureminimalistic_example_light.tex b/compare_examples/pureminimalistic_example_light.tex new file mode 100644 index 0000000..da0bd4f --- /dev/null +++ b/compare_examples/pureminimalistic_example_light.tex @@ -0,0 +1,6 @@ +\input{common_header_input.tex} +\usetheme{pureminimalistic} + +\begin{document} + \input{common_slides_input.tex} +\end{document} diff --git a/demo.tex b/demo.tex index 7626fb4..7ee080a 100644 --- a/demo.tex +++ b/demo.tex @@ -26,6 +26,7 @@ \usepackage[utf8]{inputenc} \usepackage[T1]{fontenc} \usetheme[showmaxslides, darkmode]{pureminimalistic} + \usepackage[backend=biber, doi=false, maxbibnames=2, maxcitenames=2,% style=numeric, sorting=none, url=false, eprint=false]{biblatex} \addbibresource{demo_bib.bib} @@ -34,10 +35,10 @@ \renewcommand{\appendixname}{\texorpdfstring{\translate{appendix}}{appendix}} % if loaded after begin{document} a warning will appear: "pdfauthor already used" -\title[short title]{this is the normal length of a research paper: +\title[short title]{This is the normal length of a research paper: always longer than you would expect} \author{Kai Norman Clasen} -\institute{insitute name} +\institute{Insitute name} \date{\today} \begin{document} @@ -55,7 +56,7 @@ \section{Aspect ratio} This pdf uses a 16:9 aspect ratio. To utilize this version, simply use: \begin{verbatim} - \documentclass[aspectratio=169]{beamer} + \documentclass[aspectratio=169]{beamer} \end{verbatim} \vfill The default is a 4:3 aspect ratio. @@ -64,15 +65,14 @@ \section{Aspect ratio} \end{verbatim} \end{frame} - \section{vfilleditems} \begin{frame}[fragile]{Using vfilleditems} \begin{verbatim} - Use the provided \vfilleditems environment to create - nicely spaced bullet points. + Use the provided \vfilleditems environment + to create nicely spaced bullet points. \begin{vfilleditems} - \item In my opinion, I like it to have my bullet points + \item I like it to have my bullet points \item evenly spaced from one another \item then few bullet points, are not crammed on the upper part of the slide @@ -82,29 +82,13 @@ \section{vfilleditems} \begin{frame}{Using vfilleditems} \begin{vfilleditems} - \item In my opinion, I like it to have my bullet points + \item I like it to have my bullet points \item evenly spaced from one another \item then few bullet points, are not crammed on the upper part of the slide \end{vfilleditems} \end{frame} -\begin{frame}{Example of the maximum number of bullet points before getting a warning} - \begin{vfilleditems} - \item This also - \item shows the - \item use of a - \item too - \item long - \item title - \item in - \item the - \item header - \item The logo stays in the same position - \item and the text is moved upwards to fit. - \end{vfilleditems} -\end{frame} - \section{Fonts} \begin{frame}[fragile]{Fonts} Fonts: @@ -115,19 +99,46 @@ \section{Fonts} {\large This is large} \vfill - Per default the \emph{helvet} Font Package is - used, as I find it easier to read for presentations. + Per default the \emph{Fira Font} Package is + used. The \emph{Helvetica Font} is also bundled into this + package. +\end{frame} + +\begin{frame}[fragile]{Fonts} + To use \emph{Helvetica} instead of \emph{Fira Fonts} + \begin{verbatim} + \usetheme[helvetica]{pureminimalistic} + \end{verbatim} + \vfill + To disable the \emph{Fira Fonts} and use the default font + \begin{verbatim} + \usetheme[nofirafonts]{pureminimalistic} + \end{verbatim} \end{frame} -\begin{frame}{Text to review the font} - Lorem ipsum dolor sit amet, consetetur sadipscing elitr, - sed diam nonumy eirmod tempor invidunt ut labore et dolore magna - aliquyam erat, sed diam voluptua. At vero eos et accusam et justo - duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata - sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, - consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt - ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero - eos et accusam et justo duo dolores et ea rebum. Stet clita kasd +\section{Color} +\begin{frame}[fragile]{Color} + To overwrite the theme color + \begin{enumerate} + \item Define a new color + \item redefine the themes color (before document begins) + \end{enumerate} +\end{frame} + +\begin{frame}[fragile]{Change color example} + \small + \begin{verbatim} + \usetheme{pureminimalistic} + \definecolor{textcolor}{RGB}{0, 0, 120} + \definecolor{title}{RGB}{0, 0, 0} + \definecolor{footercolor}{RGB}{133, 133, 133} + \definecolor{bg}{RGB}{25, 116, 210} + + \renewcommand{\beamertextcolor}{textcolor} + \renewcommand{\beamerbgcolor}{bg} + \renewcommand{\beamerfootertextcolor}{footercolor} + \renewcommand{\beamertitlecolor}{title} + \end{verbatim} \end{frame} \begin{frame}[fragile]{Dark mode} @@ -142,7 +153,7 @@ \section{Fonts} files if \texttt{darkmode} is used. \end{frame} -\section{Logos} +\section{Graphics} \begin{frame}[fragile]{Logos} I've tried to come up with an easy to use interface on how a user could modify the logos parameters @@ -155,13 +166,38 @@ \section{Logos} in the \texttt{beamerouterthemepureminimalist}-file. \end{frame} +\begin{frame}{Figures} + \begin{figure}[H] + \centering + \begin{columns}[T] + \begin{column}{.4\linewidth} + \includegraphics[width=\linewidth]{example-image-a} + \caption{Example A} + \end{column} + \begin{column}{.4\linewidth} + \includegraphics[width=\linewidth]{example-image-b} + \caption{Example B} + \end{column} + \end{columns} + \end{figure} +\end{frame} + + +\section{Footer options} +\begin{frame}[fragile]{Disable footer} + If you do not want to use a footer, disable it with: + \begin{verbatim} + \usetheme[nofooter]{pureminimalistic} + \end{verbatim} +\end{frame} + \begin{frame}[fragile]{Show max slide numbers} - In this presentation, I used the option to + For these slides, I used the option to show the maximum number of slides. To activate it one has to activate it with: \begin{verbatim} \usetheme[showmaxslides]{pureminimalistic} - \end{verbatim} + \end{verbatim} Usually, I prefer to not show the maximum number of slides, as the people tend to lose focus if they know the last few slides are shown. @@ -172,12 +208,7 @@ \section{Citations} I've also changed the bibliography options to be minimalistic: Just showing a simple \texttt{\textbackslash{}cite} \cite{AlexNet} -\end{frame} - -\section*{Sources} -% Maybe use plain option if the page becomes too messy -\begin{frame}[allowframebreaks]{Sources} - \small + \vfill \printbibliography \end{frame} diff --git a/minimal_examples/README.md b/minimal_examples/README.md new file mode 100644 index 0000000..ac68633 --- /dev/null +++ b/minimal_examples/README.md @@ -0,0 +1,5 @@ +# Minimal Examples + +These examples require the pure-minimalistic theme to be +either moved next to the source files, or requires +the theme to be set over the `TEXINPUTS` path. diff --git a/minimal_examples/custom_color.tex b/minimal_examples/custom_color.tex new file mode 100644 index 0000000..70ab2ac --- /dev/null +++ b/minimal_examples/custom_color.tex @@ -0,0 +1,30 @@ +\documentclass[aspectratio=169]{beamer} +\usepackage[utf8]{inputenc} +\usepackage[T1]{fontenc} +\usetheme{pureminimalistic} + +\definecolor{textcolor}{RGB}{0, 0, 120} +\definecolor{title}{RGB}{0, 0, 0} +\definecolor{footercolor}{RGB}{133, 133, 133} +\definecolor{bg}{RGB}{25, 116, 210} + +\renewcommand{\beamertextcolor}{textcolor} +\renewcommand{\beamerbgcolor}{bg} +\renewcommand{\beamerfootertextcolor}{footercolor} +\renewcommand{\beamertitlecolor}{title} + +\title[Custom color]{Long title} +\author{Kai Norman Clasen} +\institute{} +\date{\today} + +\begin{document} + \begin{frame}{Custom color} + Lorem ipsum dolor sit amet, consetetur sadipscing elitr, + sed diam nonumy eirmod tempor invidunt ut labore et dolore + magna aliquyam erat, sed diam voluptua. + At vero eos et accusam et justo duo dolores et ea rebum. + Stet clita kasd gubergren, no sea takimata sanctus est + Lorem ipsum dolor sit amet. + \end{frame} +\end{document} diff --git a/minimal_examples/default.tex b/minimal_examples/default.tex new file mode 100644 index 0000000..d2bb5b3 --- /dev/null +++ b/minimal_examples/default.tex @@ -0,0 +1,20 @@ +\documentclass[aspectratio=169]{beamer} +\usepackage[utf8]{inputenc} +\usepackage[T1]{fontenc} +\usetheme{pureminimalistic} + +\title[Default Options]{Long title} +\author{Kai Norman Clasen} +\institute{} +\date{\today} + +\begin{document} + \begin{frame}{Default Options} + Lorem ipsum dolor sit amet, consetetur sadipscing elitr, + sed diam nonumy eirmod tempor invidunt ut labore et dolore + magna aliquyam erat, sed diam voluptua. + At vero eos et accusam et justo duo dolores et ea rebum. + Stet clita kasd gubergren, no sea takimata sanctus est + Lorem ipsum dolor sit amet. + \end{frame} +\end{document} diff --git a/minimal_examples/default_font.tex b/minimal_examples/default_font.tex new file mode 100644 index 0000000..7c93ea7 --- /dev/null +++ b/minimal_examples/default_font.tex @@ -0,0 +1,20 @@ +\documentclass[aspectratio=169]{beamer} +\usepackage[utf8]{inputenc} +\usepackage[T1]{fontenc} +\usetheme[darkmode, nofirafonts]{pureminimalistic} + +\title[\LaTeX{} Font]{Long title} +\author{Kai Norman Clasen} +\institute{} +\date{\today} + +\begin{document} + \begin{frame}{\LaTeX{} Font} + Lorem ipsum dolor sit amet, consetetur sadipscing elitr, + sed diam nonumy eirmod tempor invidunt ut labore et dolore + magna aliquyam erat, sed diam voluptua. + At vero eos et accusam et justo duo dolores et ea rebum. + Stet clita kasd gubergren, no sea takimata sanctus est + Lorem ipsum dolor sit amet. + \end{frame} +\end{document} diff --git a/minimal_examples/fira_font.tex b/minimal_examples/fira_font.tex new file mode 100644 index 0000000..1acb6cd --- /dev/null +++ b/minimal_examples/fira_font.tex @@ -0,0 +1,20 @@ +\documentclass[aspectratio=169]{beamer} +\usepackage[utf8]{inputenc} +\usepackage[T1]{fontenc} +\usetheme[darkmode]{pureminimalistic} + +\title[Fira Font]{Long title} +\author{Kai Norman Clasen} +\institute{} +\date{\today} + +\begin{document} + \begin{frame}{Fira Font} + Lorem ipsum dolor sit amet, consetetur sadipscing elitr, + sed diam nonumy eirmod tempor invidunt ut labore et dolore + magna aliquyam erat, sed diam voluptua. + At vero eos et accusam et justo duo dolores et ea rebum. + Stet clita kasd gubergren, no sea takimata sanctus est + Lorem ipsum dolor sit amet. + \end{frame} +\end{document} diff --git a/minimal_examples/helvetica_font.tex b/minimal_examples/helvetica_font.tex new file mode 100644 index 0000000..b486e5f --- /dev/null +++ b/minimal_examples/helvetica_font.tex @@ -0,0 +1,20 @@ +\documentclass[aspectratio=169]{beamer} +\usepackage[utf8]{inputenc} +\usepackage[T1]{fontenc} +\usetheme[darkmode, helvetica]{pureminimalistic} + +\title[Helvetica Font]{Long title} +\author{Kai Norman Clasen} +\institute{} +\date{\today} + +\begin{document} + \begin{frame}{Helvetica Font} + Lorem ipsum dolor sit amet, consetetur sadipscing elitr, + sed diam nonumy eirmod tempor invidunt ut labore et dolore + magna aliquyam erat, sed diam voluptua. + At vero eos et accusam et justo duo dolores et ea rebum. + Stet clita kasd gubergren, no sea takimata sanctus est + Lorem ipsum dolor sit amet. + \end{frame} +\end{document} diff --git a/minimal_examples/no_footer.tex b/minimal_examples/no_footer.tex new file mode 100644 index 0000000..153aff6 --- /dev/null +++ b/minimal_examples/no_footer.tex @@ -0,0 +1,20 @@ +\documentclass[aspectratio=169]{beamer} +\usepackage[utf8]{inputenc} +\usepackage[T1]{fontenc} +\usetheme[darkmode, nofooter]{pureminimalistic} + +\title[No footer]{Long title} +\author{Kai Norman Clasen} +\institute{} +\date{\today} + +\begin{document} + \begin{frame}{No Footer} + Lorem ipsum dolor sit amet, consetetur sadipscing elitr, + sed diam nonumy eirmod tempor invidunt ut labore et dolore + magna aliquyam erat, sed diam voluptua. + At vero eos et accusam et justo duo dolores et ea rebum. + Stet clita kasd gubergren, no sea takimata sanctus est + Lorem ipsum dolor sit amet. + \end{frame} +\end{document} diff --git a/minimal_examples/show_max_slides.tex b/minimal_examples/show_max_slides.tex new file mode 100644 index 0000000..aedd0ea --- /dev/null +++ b/minimal_examples/show_max_slides.tex @@ -0,0 +1,20 @@ +\documentclass[aspectratio=169]{beamer} +\usepackage[utf8]{inputenc} +\usepackage[T1]{fontenc} +\usetheme[darkmode, showmaxslides]{pureminimalistic} + +\title[Show Max Number of Slides]{Long title} +\author{Kai Norman Clasen} +\institute{} +\date{\today} + +\begin{document} + \begin{frame}{Show Max Number of Slides} + Lorem ipsum dolor sit amet, consetetur sadipscing elitr, + sed diam nonumy eirmod tempor invidunt ut labore et dolore + magna aliquyam erat, sed diam voluptua. + At vero eos et accusam et justo duo dolores et ea rebum. + Stet clita kasd gubergren, no sea takimata sanctus est + Lorem ipsum dolor sit amet. + \end{frame} +\end{document} diff --git a/tests/generate_all_options.py b/tests/generate_all_options.py deleted file mode 100644 index 534cd79..0000000 --- a/tests/generate_all_options.py +++ /dev/null @@ -1,93 +0,0 @@ -import shutil -import argparse -import subprocess -from pathlib import Path -from typing import Optional - -OPTIONS = { - "Default": "", - "MaxSlidesOption": "showmaxslides", - "DarkModeOption": "darkmode", -} - - -def parse_args(): - parser = argparse.ArgumentParser( - description="Test builder for all possible theme options." - ) - parser.add_argument( - "--build-command", - type=str, - default="latexmk -interaction=nonstopmode -file-line-error -pdf", - help="Command which will be run in shell to build template document. The document will be appended to end of command!", - ) - parser.add_argument( - "--ci-mode", - action="store_true", - help="If set, build-command will be ignored and only the .tex files will be generated", - ) - return parser.parse_args() - - -def build_tmp() -> Path: - tmp = Path(__file__).parent / "tmp" - tmp.mkdir(exist_ok=True) - return tmp - - -def copy_source_files(src: Path, dst: Path): - for theme_file in src.glob("*.sty"): - shutil.copy(theme_file, dst) - - -def copy_logo_dir(src: Path, dst: Path): - logos_path_name = "logos" - logos_src = src / logos_path_name - logos_dst = dst / logos_path_name - # Make sure to always us up-to-date version - shutil.rmtree(logos_dst, ignore_errors=True) - shutil.copytree( - logos_src, logos_dst, - ) - - -def build_documents( - dst: Path, build_command: Optional[str] = None, template_name: str = "template.tex" -): - cwd = Path(__file__).parent - template_file = cwd / template_name - template_code = template_file.read_text() - cd_work_dir = f"cd {dst.absolute()}" - - for name, option in OPTIONS.items(): - test_file = dst / f"test_{name}.tex" - target_code = template_code.replace( - r"\usetheme[]{pureminimalistic}", - rf"\usetheme[{option}]{{pureminimalistic}}", - ) - test_file.write_text(target_code) - - if build_command is not None: - subprocess.run( - f"{cd_work_dir} && {build_command} {test_file.name}", - shell=True, - check=True, - ) - - -def main(): - args = parse_args() - tmp_path = build_tmp() - src_path = Path(__file__).parent / ".." - src_path = src_path.resolve() - copy_source_files(src_path, tmp_path) - copy_logo_dir(src_path, tmp_path) - if args.ci_mode: - build_command = None - else: - build_command = args.build_command - build_documents(tmp_path, build_command) - - -if __name__ == "__main__": - main()