tudace / tuda_latex_templates

LaTeX Templates for TU Darmstadt
LaTeX Project Public License v1.3c
213 stars 71 forks source link

Math fonts #30

Closed pfetsch closed 5 years ago

pfetsch commented 5 years ago

In the beamer version, the math fonts use serifs and are too small. I recommend to change the math font to some font similar to helvetica.

I am not sure whether the same problem appears in the other classes.

marklaz commented 5 years ago

For TUDaBeamer sans serif math fonts seem to be good option. Probably, we could add a general option for sans serif math for all TUDa classes? @TeXhackse: Do you think that is feasible?

Looking at https://tug.org/FontCatalogue/mathfonts.html for sans serif math fonts, which are available in type1 and otf/ttf, leaves three choices:

pfetsch commented 5 years ago

Beamer allows to use sans serif via the font theme themes/font/beamerfontthemeserif.sty. I am not sure whether this is compatible, but one could copy code from there. As it seems to me the basis is a helvetica font, but i might be computer modern sans serif.

TeXhackse commented 5 years ago

Default math font

Beamer allows to use sans serif via the font theme themes/font/beamerfontthemeserif.sty.

This is not true. This theme allows you to set the default to serif fonts. The sans serif is usually the dafault. I fixed the bug, which was disabling font mixing, as it's default in beamer. So the default is now the same setup as beamer would provide.

I now implemented an serif Option similar to the old template, which would load the serif font theme and not set the default family to \sfdefault.

Sans serif math

Problem with math fonts here is the same as mentioned in #19. Especially for sans serif. Therefore I'd suggest the following setup with lualatex:

\setmathfont{Fira Math}
\setmathfont[range=up]{Roboto}
\setmathfont[range=it]{Roboto-Italic}
\setmathfont[range=\int]{Fira Math}

Since it's compiler dependent I'd suggest to add a note on that to the documentation and would not enable it by default. But it would take the Roboto letters and use the sans serif Symbols from Fira Math.

Resizing Math Fonts

The base fontsize is equal to the text font. This size is usually large enough. You could either use the beamer Options 11pt/larger or even 12pt to increase the fontsize in general.

Beside this, if you only want to increase the math fonts, it's possible to adjust the MathSizes, the default setting in readible variant is:

\DeclareMathSizes{10}{10}{7}{5}

So for a fontsize of 10pt the math base font will also be sized to 10, scripsize is 7 and scripscriptsize is 5. This default setting can be found in kpsewhich fontmath.ltx (usually something like texlive-root-dir/2019/texmf-dist/tex/latex/base/fontmath.ltx)

I hope this information helps out.

pfetsch commented 5 years ago

This looks good now - thank you. I recommend to add a math formula in the demos, though. Apart from this, the issue can be closed from my side.

TeXhackse commented 5 years ago

I leave it open until the math demo is added. thank you

jorickert commented 1 year ago

@TeXhackse Using LuaLatex and the beamer template available on sharelatex, selecting the fonts like decribed in this issue and the beamer example results in the following Warnings:


Package fontspec Warning: Font "Roboto" does not contain requested Script "Math".
Package fontspec Warning: OpenType feature 'Style=MathScript' (ssty) not available for font 'Roboto' with script 'CustomDefault' and language 'Default'.
Package fontspec Warning: OpenType feature 'Style=MathScriptScript' (ssty) not available for font 'Roboto' with script 'CustomDefault' and language 'Default'.
Package fontspec Warning: Font "Roboto-Italic" does not contain requested Script "Math".
Package fontspec Warning: OpenType feature 'Style=MathScript' (ssty) not available for font 'Roboto-Italic' with script 'CustomDefault' and language 'Default'.
Package fontspec Warning: OpenType feature 'Style=MathScriptScript' (ssty) not available for font 'Roboto-Italic' with script 'CustomDefault' and language 'Default'.```
TeXhackse commented 1 year ago

I know. This is only telling you that Roboto is not supporting math spacing itself. It's not a good option at all. Best would be to have a matching math font, but we dont.