kai-tub / latex-beamer-pure-minimalistic

A true minimalistic LaTeX beamer template
https://github.com/kai-tub/latex-beamer-pure-minimalistic
GNU General Public License v3.0
147 stars 11 forks source link

customized font applies to everything *but* normal text #58

Closed ExecutorElassus closed 4 years ago

ExecutorElassus commented 4 years ago

I modified beamerfontthemepureminimalistic.sty to have the following code in place of its default font selection:

\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}
%}{%
%    \ifthenelse{\boolean{nofirafonts}}{%
%        % Load default fonts
%    }{%
%        % By default load Fira
%        \RequirePackage[T1]{fontenc}
%        \RequirePackage[sfdefault]{FiraSans}
%        \RequirePackage{FiraMono}
%    }
%}

\usepackage{microtype}
\usepackage{polyglossia}
\setdefaultlanguage[variant=german]{german}
\setotherlanguage[variant=american]{english}
\setotherlanguage[variant=ancient]{greek}
\setotherlanguage[variant=poly]{greek}
\usepackage{luatexja-fontspec}
\defaultfontfeatures{Ligatures={Historic,Rare,Discretionary,TeX}}
\setmainfont[Ligatures={Historic,Rare,Discretionary,TeX}]{Linux Libertine}
\newfontfamily\englishfont[Ligatures={Historic,Rare,Discretionary,TeX},Contextuals=Swash]{Linux Libertine}
\renewcommand\normalsize{\fontsize{12pt}{14pt}\selectfont}
\renewcommand\small{\fontsize{10pt}{12pt}\selectfont}
\renewcommand\large{\fontsize{14pt}{16pt}\selectfont}
\renewcommand\Large{\fontsize{16pt}{18pt}\selectfont}

\setbeamerfont{normal text}{family=\fontspec{Linux Libertine},series=\mdseries}
\setbeamerfont{alerted text}{parent=normal text}

This works for the titles, TOC, footers, eumerated lists, etc. The only thing it doesn't work on is plain unformatted text, and citations/footnotes.

Is there some way to get this working? Is this a bug, or did I do something wrong here?

welcome[bot] commented 4 years ago

Thanks for opening your first issue here! πŸ’– Be sure to follow the issue template. Then the issue will be worked on in no time. πŸ‘

kai-tub commented 4 years ago

I will take a closer look at this issue in the next couple of days. But just to be sure, are you using the latest release?

ExecutorElassus commented 4 years ago

of beamer, or the PM package? I just synced my texlive tree, and downloaded the PM package yesterday.

kai-tub commented 4 years ago

For the PM package. The issue with CTAN / texlive is that each upload is manually reviewed and published. To reduce the stress on CTAN, as I use continuous deployments, I upload my updates very infrequently to the website.

In the case of templates it more common to download them directly from GitHub: github releases

It is worth a try :)

kai-tub commented 4 years ago

I was just able to reproduce the behavior. So the newest version is also broken... As I said, I will look into this issue in the next couple of days. πŸ‘

kai-tub commented 4 years ago

I must say, this seems to be an interesting issue. I cannot find an option to only change the font of the frame's content via a \setbeamerfont

So the user is always required to also set the "default" font and the font family. Your issue should be solved by using \setsansfont and not \setmainfont in addition to the redefinition of normal text. Beamer favors sans serif fonts. If you want to use a serif font, use \usefonttheme{serif}, but this may come with some side-effects.

ExecutorElassus commented 4 years ago

I set the \usefonttheme{serif} option in beamerfontthemepureminimalistic.sty, and that set the fonts all to my specified font (with ligatures and everything), so I imagine that can serve as a workaround for now.

I'm not sure of the logic in preferring sans fonts for presentations. Is there some design guideline that recommends that? I suppose I could always switch to one of TeX Gyre's rather nice-looking sans families if that were a better choice (which I might suggest as another option for font selection booleans anyway).

Cheers.

kai-tub commented 4 years ago

I do not have a reliable source for why sans serif fonts are recommended but as these fonts have no serifs, they are usually easier to read than their serif counterparts. See here for example. So I would also generally recommend to use sans serif fonts. The font shouldn't make the presentation harder to read, especially when it is not uncommon for people to sit further away, looking at dim beamers in a bright room. But then again, the presenter decides.

Thanks for the recommendation! I will consider adding it. But as I am transitioning to lualatex (#57) to have better font/mulit-language support, it might take a while before the next release.

ExecutorElassus commented 4 years ago

OK, I'm looking at reconsidering my font choices.

However, now I have an issue. Let's say I want the {alert text} (ie, slide titles) to be my serif font, Libertine, and everything else to be the sans font, defined as TeX Gyre Heros in that file. Now I'm running into the problem that one of my slide titles has Greek script in it, and for some reason it's not managing the font switching like it's supposed to. If I leave the font specifications as they are now (ie, as at the top post but with \usefonttheme{serif} set to force it to use Libertine, it works fine. But if I comment out that line, it no longer switches to the specified Greek script.

Is there some workaround for this? Am I doing something wrong?

And thank you for transitioning to lualatex. I've been told by several sources that it's the best variant to use for language support.

kai-tub commented 4 years ago

I've just started to work with lualatex so it is hard for me to help you. But if you are willing to share a full minimal example with all the necessary files to compile it, I am happy to take look at it :)

kai-tub commented 4 years ago

And thank you for transitioning to lualatex. I've been told by several sources that it's the best variant to use for language support.

πŸ‘

I fully agree. lualatex is soo much better with fonts than pdflatex. But because the languages I am using had good support, I simply missed that others are having issues.

kai-tub commented 4 years ago

New version supports lualatex. README will be updated in the following days.