1

Related question: XeLaTeX font rendering tend to be slightly bolder compared to PDFlatex

I am trying to use lualatex, because of the selnolig package.

I was recommended to use "Latin Modern Roman" instead of "cfr-lm" in the case of LuaLaTeX (see somehow How to use selnolig package together with default lualalatex font?). Note that lmodern is in the basic mode equal to cfr-lm. See Difference between cfr-lm and lm package.

% !TeX program = pdflatex
\documentclass{article}
\usepackage{blindtext}

\usepackage{ifluatex}
\ifluatex
  \usepackage{fontspec}
  \setmainfont{Latin Modern Roman}
\else
  \usepackage{lmodern}
\fi

\begin{document}
\blindtext
\end{document}

TexStudio

Rendered output with pdflatex in TeXStudio on Windows 10:

Rendered output with pdflatex

Rendered output with lualatex in TeXStudio on Windows 10:

Rendered output with lualatex

See that the lualatex output is thicker? How to have the output being rendered in equal thickness?

SumatraPDF

Rendered output in SumatraPDF:

pdflatex output

lualatex output


The other equivalent font settings are as follows (see What ist the fontspec equivalent for "variable=true"):

\setsansfont{Latin Modern Sans}
\setmonofont{Latin Modern Mono} % "variable=false"
%\setmonofont{Latin Modern Mono Prop} % "variable=true"
5
  • 1
    Is it really thicker or is it just artefact of different rendering and presence/absence (?) of hinting in one or the other? – wilx Mar 26 '18 at 13:12
  • 2
    latin modern is the default font family in lualatex so you don't need do anything at all. – David Carlisle Mar 26 '18 at 13:12
  • 1
    Note that pdflatex is using the type1 font format and lualatex the opentype format, the two versions of the font are derived from the same glyph definitions but the exact appearance in any particular rendering system may have slight variations depending on how font hinting and other things are implemented for each of the two formats. – David Carlisle Mar 26 '18 at 13:21
  • @wilx and DavidCarlisle I changed the question title, so you can convert your comment to an answer. – koppor Mar 26 '18 at 13:32
  • 2
    Related, maybe duplicate tex.stackexchange.com/questions/305258/… – Henri Menke Mar 26 '18 at 23:31
5

latin modern is the default font family in lualatex so you don't need do anything at all, you would get the same font without loading fontspec or specifying \setmainfont.

Note that pdflatex is using the type1 font format and lualatex the opentype format, the two versions of the font are derived from the same glyph definitions but the exact appearance in any particular rendering system may have slight variations depending on how font hinting and other things are implemented for each of the two formats.

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.