Skip to content

Commit

Permalink
_Support_ all pdf engines by not requiring anything (#60)
Browse files Browse the repository at this point in the history
* The `helvet` package doesn't work nicely with LuaLaTeX and renamed the `nofirafonts` option to the more meaningful name `customfonts`
    * Requires a major change in the API

* Fixed small error in font size of institute and author

* Support for the big three TeX engines 🎉

* Add Arabic font

* Add `Noto Sans JP`

The key is to simply not require anything.
The final user should be responsible for correctly loading their font settings.
I Will update documentation shortly!
  • Loading branch information
kai-tub authored Nov 13, 2020
1 parent 93bf58b commit f7fa8b5
Show file tree
Hide file tree
Showing 20 changed files with 604 additions and 215 deletions.
27 changes: 21 additions & 6 deletions .github/workflows/build_and_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,18 +31,33 @@ jobs:
uses: actions/checkout@v2
- name: Install missing packages
run: |
tlmgr update --self && tlmgr install silence appendixnumberbeamer fira fontaxes mwe
- name: Build minimal examples
tlmgr update --self && tlmgr install silence appendixnumberbeamer fira fontaxes mwe noto csquotes fontspec babel luatexja haranoaji haranoaji-extra
- name: Build minimal examples with pdfLaTeX
working-directory: minimal_examples/
run: |
ln -s ../*.sty ./
ln -s ../logos ./
ln -sf ../*.sty ./
ln -sf ../logos ./
latexmk -pdf -file-line-error -interaction=nonstopmode *.tex
- name: Remove pdfLaTeX results if compilation succeeds
working-directory: minimal_examples/
run: rm *.pdf
- name: Build minimal examples with LuaLaTeX
working-directory: minimal_examples/
run: |
ln -sf ../*.sty ./
ln -sf ../logos ./
latexmk -lualatex -file-line-error -interaction=nonstopmode *.tex
- name: Build multi-language examples with LuaLaTeX
working-directory: multi_lang_examples/
run: |
ln -sf ../*.sty ./
ln -sf ../logos ./
latexmk -lualatex -file-line-error -interaction=nonstopmode *.tex
- name: Build compare examples
working-directory: compare_examples/
run: |
ln -s ../*.sty ./
ln -s ../logos ./
ln -sf ../*.sty ./
ln -sf ../logos ./
latexmk -pdf -file-line-error -interaction=nonstopmode *example*.tex
- name: Build demo document
run: |
Expand Down
15 changes: 15 additions & 0 deletions .github/workflows/convert_pdf_to_png.fish
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,20 @@ function convert_compare_examples
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_multi_lang_examples
set files (find ./multi_lang_examples -type d -path '*/.git' -prune -o -name '*.lua.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"
end
montage ./multi_lang_examples/*.pdf -geometry +2+2 -tile 2x -background gray ./multi_lang_examples/lang_comparison.png
end

function convert_demo
convert -density 300 beamertheme-pure-minimalistic-demo.pdf beamertheme-pure-minimalistic-demo-%02d.tmp.png
montage beamertheme-pure-minimalistic-demo-*.png -geometry +10+10 -tile 4x -background gray beamertheme-pure-minimalistic-demo.png
Expand All @@ -35,3 +49,4 @@ apk add --no-cache imagemagick
convert_demo
convert_minimal_examples
convert_compare_examples
convert_multi_lang_examples
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
*.cb2
.*.lb

*old.*
*.old.*
*.svg
## Intermediate documents:
*.dvi
Expand Down
17 changes: 8 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,12 @@ To build the [beamertheme-pure-minimalistic-demo.tex](beamertheme-pure-minimalis
- [Other great beamer themes](#other-great-beamer-themes)

# Main goals
- The theme produces no warnings
- It should be looking *good* in a 4:3 and 16:9 aspect ratio, without the need to change anything.
- Provides an environment for vertical-spaced items
- Easy option to either use light- or dark-mode
- Is designed to be purely minimalistic without any distractions
- Easily use own logos
- Should support different languages without too many changes

# Demo
A sample document can be seen in the
Expand Down Expand Up @@ -194,24 +194,23 @@ 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.
theme also integrates the *Noto* fonts.

To use the Helvetica fonts:
To use the Noto fonts:

```latex
\usetheme[helvetica, darkmode]{pureminimalistic}
\usetheme[noto, darkmode]{pureminimalistic}
```

![helvetica-fonts](https://raw.githubusercontent.com/wiki/kai-tub/latex-beamer-pure-minimalistic/minimal_examples/helvetica_font.png)
![noto-fonts](https://raw.githubusercontent.com/wiki/kai-tub/latex-beamer-pure-minimalistic/minimal_examples/noto_font.png)

If you prefer the default fonts, disable the Fira Fonts with:
If you prefer the default fonts _or_ load your own fonts, disable the Fira Fonts with:

```latex
\usetheme[nofirafonts, darkmode]{pureminimalistic}
\usetheme[customfont, darkmode]{pureminimalistic}
```

![helvetica-fonts](https://raw.githubusercontent.com/wiki/kai-tub/latex-beamer-pure-minimalistic/minimal_examples/default_font.png)
![default-fonts](https://raw.githubusercontent.com/wiki/kai-tub/latex-beamer-pure-minimalistic/minimal_examples/default_font.png)

## Footer options

Expand Down
68 changes: 38 additions & 30 deletions beamerfontthemepureminimalistic.sty
Original file line number Diff line number Diff line change
Expand Up @@ -21,67 +21,75 @@

\ProvidesPackage{beamerfontthemepureminimalistic}[v1.3.0]
\RequirePackage{ifthen}
% Adds micro-typographical enhancements
% Has no significant impact on presentation slides
% Adds issues to japanese packages...
% \RequirePackage{microtype}
\mode<presentation>

\newboolean{nofirafonts}
\setboolean{nofirafonts}{false}
\newboolean{helvetica}
\setboolean{helvetica}{false}
\newboolean{customfont}
\setboolean{customfont}{false}
\newboolean{noto}
\setboolean{noto}{false}

\DeclareOptionBeamer{nofirafonts}{\setboolean{nofirafonts}{true}}
\DeclareOptionBeamer{helvetica}{\setboolean{helvetica}{true}}
\DeclareOptionBeamer{customfont}{\setboolean{customfont}{true}}
\DeclareOptionBeamer{noto}{\setboolean{noto}{true}}
\ProcessOptionsBeamer

\RequirePackage{silence}
% I have no clue how I can fix this warning
\WarningFilter{latex}{Font shape declaration has incorrect series value}
% TODO: #52 Maybe use different font for math mode; Doesn't look clean
\ifthenelse{\boolean{helvetica}}{%
% If Helvetica overwrites the fira fonts settings
\RequirePackage[T1]{fontenc}
\RequirePackage[scaled]{helvet}
\RequirePackage{iftex}

\ifpdftex
\RequirePackage[T1]{fontenc}
\fi

\ifthenelse{\boolean{noto}}{%
% If Noto overwrites the fira fonts settings
\RequirePackage{noto}
}{%
\ifthenelse{\boolean{nofirafonts}}{%
\ifthenelse{\boolean{customfont}}{%
% Load default fonts
}{%
% By default load Fira
\RequirePackage[T1]{fontenc}
\RequirePackage[sfdefault]{FiraSans}
\RequirePackage{FiraMono}
}
}

\renewcommand\normalsize{\fontsize{12pt}{14pt}\selectfont}
\renewcommand\footnotesize{\fontsize{8pt}{10pt}\selectfont}
\renewcommand\small{\fontsize{10pt}{12pt}\selectfont}
\renewcommand\normalsize{\fontsize{12pt}{14pt}\selectfont}
\renewcommand\large{\fontsize{14pt}{16pt}\selectfont}
\renewcommand\Large{\fontsize{16pt}{18pt}\selectfont}

\setbeamerfont{normal text}{family=\sffamily,size=\normalsize,series=\mdseries}
\setbeamerfont{normal text}{family=\sffamily, size=\normalsize, series=\mdseries}
\setbeamerfont{alerted text}{parent=normal text}

\setbeamerfont{structure}{parent=normal text,series=\mdseries}
\setbeamerfont{structure}{parent=normal text}

\setbeamerfont{footline}{parent=structure,size*={8pt}{10pt}}
\setbeamerfont{all titles}{parent=normal text}
\setbeamerfont{presentation title}{parent=all titles, size=\large, shape=\scshape}
\setbeamerfont{subtitle}{parent=all titles, shape=\upshape}
\setbeamerfont{frametitle}{parent=all titles, size=\Large}

\setbeamerfont{title}{size*={14pt}{16pt},parent=alerted text,shape=\scshape}
\setbeamerfont{title in head/foot}{parent=footline,series=\bfseries}

\setbeamerfont{subtitle}{parent=title,shape=\upshape}
\setbeamerfont{footline}{parent=structure,size=\footnotesize}
\setbeamerfont{title in head/foot}{parent=footline, series=\bfseries}
\setbeamerfont{author in head/foot}{parent=footline}

\setbeamerfont{section in toc}{parent=normal text}
\setbeamerfont{subsection in toc}{parent=section in toc}
\setbeamerfont{subsubsection in toc}{parent=subsection in toc}

\setbeamerfont{author}{parent=normal text}
\setbeamerfont{author in head/foot}{parent=footline}
\setbeamerfont*{institute}{parent=normal text}
\setbeamerfont{author}{parent=normal text, size=\small}
\setbeamerfont{institute}{parent=normal text, size=\small}

\setbeamerfont{frametitle}{parent=alerted text,size*={16pt}{18pt}}
\setbeamerfont{caption}{series=\normalfont, size=\small}
\setbeamerfont{caption name}{series=\normalfont, size=\small}
\setbeamerfont{caption}{parent=normal text, size=\small}
\setbeamerfont{caption name}{series=normal text, size=\small}

\setbeamerfont*{itemize/enumerate body}{parent=normal text}
\setbeamerfont*{itemize/enumerate subbody}{parent=itemize/enumerate body}
\setbeamerfont*{itemize/enumerate subsubbody}{parent=itemize/enumerate subbody}
\setbeamerfont{itemize/enumerate body}{parent=normal text}
\setbeamerfont{itemize/enumerate subbody}{parent=itemize/enumerate body}
\setbeamerfont{itemize/enumerate subsubbody}{parent=itemize/enumerate subbody}

\mode<all>
2 changes: 1 addition & 1 deletion beamerinnerthemepureminimalistic.sty
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@

\begin{beamercolorbox}[wd=\textwidth,dp=1ex]{author}%
\vskip 3pt
\small\usebeamerfont{author}\usebeamercolor{author}\insertauthor $\quad$
\usebeamerfont{author}\usebeamercolor{author}\insertauthor $\quad$
\ifx\insertinstitute\@empty%
\else%
{\usebeamerfont{institute}\insertinstitute $\quad$}%
Expand Down
Loading

0 comments on commit f7fa8b5

Please sign in to comment.