1

Lualatex allows to load fonts directly and without packages and other dependencies.

The problem I see is that the usage is well documented for pdflatex and the old style and not documented for lualatex using fontspec commands. For most users it would be the best way to still load a package, but this does not seem to exist.

Here some examples I have for pdflatex for which I want to know the correct lualatex way. The old code only works together with \usepackage[T1]{fontenc}

MWE Example

\documentclass[]{scrbook}

\usepackage{amsmath}
\usepackage{esint}
%\usepackage{unicode-math} % works not with old font loading
%\usepackage{fontspec}
\usepackage[T1]{fontenc} 

\usepackage{mathptmx}                 %% --- Times (incl math)
\usepackage[scaled=.90]{helvet}       %% --- Helvetica (Arial)
\usepackage{courier}                  %% --- Courier

\begin{document}
        
    \chapter*{Font Test}
    The text on these pages demonstrates the appearance of the used fonts for serif, \textsf{sans serif}, math and \texttt{typewriter fonts}. 
    %
    \subsection*{Green's theorem}
    \begin{equation}
        \underset{\mathcal{G}\quad}\iiint
        \left[u\nabla^{2}v+\left(\nabla  u,\nabla  v\right)\right]\mathrm{d}^{3}V
        =\underset{\mathcal{S}\quad}\oiint  u\,\frac{\partial v}{\partial n}
        \,\,\mathrm{d}^{2}A
    \end{equation}
    
\end{document}

enter image description here

And here some other font code combinations for which I am looking for fontspec definitions

% lmodern with sans math
\usepackage{lmodern}
\DeclareMathVersion{sans}
% Math letters from Latin Modern Sans
\SetSymbolFont{letters}{sans}{OML}{cmbr}{m}{it}
% Math operators
\SetSymbolFont{operators}{sans}{OT1}{lmss}{m}{n}
% Math symbols
\SetSymbolFont{symbols}{sans}{OMS}{lmsy}{m}{n}
% Large symbols
\SetMathAlphabet{\mathrm}{sans}{OT1}{lmr}{m}{n}
\SetMathAlphabet{\mathsf}{sans}{OT1}{lmss}{m}{n}
\SetMathAlphabet{\mathit}{sans}{OT1}{lmr}{m}{it}


% -> Palantino, Helvetica, Courier
\usepackage{mathpazo}                 %% --- Palantino (incl math)
\usepackage[scaled=.95]{helvet}       %% --- Helvetica (Arial)
\usepackage{courier}                  %% --- Courier


% -> Charter, Bera Sans, Luxi Mono
\usepackage{charter}\linespread{1.05} %% --- Charter
\renewcommand{\sfdefault}{fvs}        %% --- Bera Sans
\usepackage[charter]{mathdesign}      %% --- Charter (Math)
\usepackage[scaled=0.85]{luximono}    %% --- Luxi Mono (Typewriter)

% -> URW Garamond
\renewcommand{\rmdefault}{ugm}        %% --- URW Garamond
\renewcommand{\sfdefault}{fvs}        %% --- Bera Sans
\usepackage[Garamond]{mathdesign}     %% --- Garamond (Math)
\usepackage[scaled=0.85]{luximono}    %% --- Luxi Mono (Typewriter)


% -> Fourier (Utopia), Latin Modern (Sans and Typewriter)
\usepackage{lmodern}
\usepackage{fourier}
1
  • Well, most of the time they are documented, just that the documentation is difficult to find, and sometimes may be dense to read because the documentation writer assumes readers knows some low level details.
    – user202729
    Aug 13 at 12:16

1 Answer 1

1

As a replacement of your current fonts you could try this (uncommenting the set of fonts to test):

\documentclass[a4paper,openany]{scrbook}
\usepackage{amsmath}
\usepackage{unicode-math}

% -> Times, Arial, Courier (licence issues ???)
\setmainfont{TeX Gyre Termes X}
\setsansfont{Arial}[Scale=MatchLowercase]  % msttcorefonts on Debian
\setmonofont{Courier 10 Pitch}[Scale=MatchLowercase]
\setmathfont{Latin Modern Math}

% -> Times, Arial, Courier
%\setmainfont{TeX Gyre Termes X}
%\setsansfont{TeX Gyre Heros}[Scale=MatchLowercase]
%\setmonofont{TeX Gyre Cursor}[Scale=MatchLowercase]
%\setmathfont{TeX Gyre Termes Math}

% -> Palatino, Arial, Courier
%\setmainfont{TeX Gyre Pagella X}
%\setsansfont{TeX Gyre Heros}[Scale=MatchLowercase]
%\setmonofont{TeX Gyre Cursor}[Scale=MatchLowercase]
%\setmathfont{TeX Gyre Termes Math}

%-> Charter, Bera Sans, Luxi Mono
%\usepackage{xcharter-otf}
%\setsansfont{Cabin}[Scale=MatchLowercase]
%\setmonofont{Luxi Mono}[Scale=MatchLowercase]

% -> URW Garamond, Bera Sans, Luxi Mono
%\usepackage{ebgaramond}
%\setsansfont{Fira Sans}[Scale=MatchLowercase]
%\setmonofont{Luxi Mono}[Scale=MatchLowercase]
%\setmathfont{Garamond-Math}

% -> Fourier (Utopia), Latin Modern (Sans and Typewriter)
%\usepackage{fourier-otf}

\begin{document}
%\showoutput

\chapter*{Font Test}
The text on these pages demonstrates the appearance of the used fonts
for serif, \textsf{sans serif}, math and \texttt{typewriter fonts}.
%
\subsection*{Green's theorem}
\begin{equation}
    \underset{\mathcal{G}\quad}\iiint
    \left[u\nabla^{2}v+\left(\nabla  u,\nabla  v\right)\right] \mathrm{d}^{3}V
    =\underset{\mathcal{S}\quad}\oiint  u\,\frac{\partial v}{\partial n}
    \,\,\mathrm{d}^{2}A
\end{equation}

\end{document}

You can't expect one to one replacements for your Type1 fonts.There is already a large set of free OpenType text/math fonts available though.

Looking at these two documents (in French) might help: Text & Math combined and Various text fonts

3
  • It works, except for luxi mono. I installed it using getnonfreefonts. But \setmonofont{Luxi Mono} fails to find a font and \usepackage{luximono}` has no effect. Aug 14 at 20:20
  • Did you refresh the database? Mine are installed under /usr/local/texlive/texmf-local/fonts/truetype/Bigelow-Holmes/luxi/, you need to run mktexlsr command afterwards. Aug 14 at 23:15
  • I installed ttf fonts that I could find online and now it works. Aug 15 at 18:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.