3

On my mac running OSX 11.0.1 and TeX Live 2020, I'm trying to find the fontspec-name for the default font used by latex so that I can increase the font size in some locations of my document.

By using \showthe\font in a latex document, I printed the default font used on my Mac: \TU/lmr/m/n/10 .

How do I find the fontspec name for lmr? grep lmr $(kpsewhich pdftex.map) returns 244 lines of output. How do I gather the exact font name for lmr? For e.g. from these three lines, I picked up LMRoman10-Regular as the possible fontspect-name:

ts1-lmr10 LMRoman10-Regular " enclmts1 ReEncodeFont " <lm-ts1.enc <lmr10.pfb
ts1-lmr12 LMRoman12-Regular " enclmts1 ReEncodeFont " <lm-ts1.enc <lmr12.pfb
ts1-lmr17 LMRoman17-Regular " enclmts1 ReEncodeFont " <lm-ts1.enc <lmr17.pfb

However, compiling my document fails when I use any variant of the names from the second column:

\documentclass{article}
\usepackage{fontspec}

% Tried LMRoman10, LMRoman, LMRoman10-Regular but nothing works
\setmainfont[Ligatures=TeX,Scale=1.0]{LMRoman10}
\begin{document}
% This text should be in normal size 
hello world

% Increase font size for this text
Print me in bigger size
\end{document}
3
  • 1
    What exactly are you trying to accomplish? Wouldn't \large, \Large or similar work? That said, yes, this is “Latin Modern”. If you want to access it via fontspec you'll probably need to install it on your system regularly, i.e. as a True/Open Type Font.
    – Ingmar
    Jan 16, 2021 at 8:11
  • 1
    Give \setmainfont{Latin Modern Roman} a try. Aside: You needn't know the name of the default font in order to execute {\large ...} or {\Huge ...}.
    – Mico
    Jan 16, 2021 at 8:59
  • 1
    what is wrong with \fontsize{3cm}{4cm}\selectfont ? why do you need to know th einternal names? Also latin modern is the default already in xelaetx so you do not need fontspec or the \setmainfont command. Jan 16, 2021 at 9:23

2 Answers 2

4

The names of the default serif, sans-serif, and monospaced fonts that are employed if fontspec is loaded are Latin Modern Roman, Latin Modern Sans, and Latin Modern Mono.

Take the following example:

\documentclass{article}
\usepackage{fontspec}
%\setmainfont{Latin Modern Roman} % that's the default
\begin{document}
% normal size 
Hello world

% Increase relative font size to "\Huge" (ca. 73% larger than "\normalsize")
{\Huge Print me in ``\textbackslash Huge'' size.}
\end{document}

If I compile this sample document with either LuaLaTeX or XeLaTEX -- aside: I run MacTeX2020 under MacOS 11.1 "Big Sur" -- and consult the log file, I find the following information close to the end of the file:

</Users/mico/Library/Fonts/lmroman17-regular.otf>
</Users/mico/Library/Fonts/lmroman10-regular.otf>

If I changed \documentclass{article} to \documentclass[12pt]{article}, the log file would provide the following information:

</Users/mico/Library/Fonts/lmroman17-regular.otf>
</Users/mico/Library/Fonts/lmroman12-regular.otf>

Observe that fontspec performs the required mapping from the font name to the files that contain the glyphs at various sizes automatically. Unless you have a truly unusual font face, no user-level knowledge of the file names that contain the glyphs at various sizes is needed.

0
3

Latin Modern is the default font in xelatex, and you should never need to know the internal font names, standard commands such as \large or \fontsize can be used without reference to internal names.

enter image description here

\documentclass{article}

\begin{document}
% This text should be in normal size 
hello world

% Increase font size for this text
\fontsize{3cm}{3.5cm}\selectfont
Print me in bigger size
\end{document}

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .