Getting fontspec Fonts with pdfLaTeX
Clash Royale CLAN TAG#URR8PPP
up vote
1
down vote
favorite
I have to make a document, which was originally written in LuaLaTeX, compatible for both pdfLaTeX and LuaLaTeX. Everything works except that the fonts differ. How can I force pdfLaTeX/fontenc to use the same fonts as fontspec?
Minimal example (omitted ifluatex to avoid clutter):
documentclass[fontsize=11pt]scrreprt
% usepackagefontspec
usepackagelmodern
usepackage[T1]fontenc
usepackage[utf8]inputenc
begindocument
chapterChapter
sectionSection
Text with some formulas: $a=1$.
enddocument
By using lmodern
, the fonts of the text seem to almost coincide, but the math fonts differ:
# pdffonts output for pdflatex with lmodern, fontenc and inputenc:
name type encoding emb sub uni object ID
------------------------------------ ----------------- ---------------- --- --- --- ---------
ZGMFNK+LMSans10-Bold Type 1 Custom yes yes no 4 0
YIMXCY+LMRoman10-Regular Type 1 Custom yes yes no 5 0
GXEVRM+LMMathItalic10-Regular Type 1 Custom yes yes no 6 0
YIMXCY+LMRoman10-Regular Type 1 Custom yes yes no 7 0
# pdffonts output for lualatex with fontspec:
name type encoding emb sub uni object ID
------------------------------------ ----------------- ---------------- --- --- --- ---------
SSPBGH+LMSans10-Bold CID Type 0C Identity-H yes yes yes 4 0
XXBUAG+LMRoman10-Regular CID Type 0C Identity-H yes yes yes 5 0
EDWHGC+CMMI10 Type 1 Builtin yes yes no 6 0
HVZLMP+CMR10 Type 1 Builtin yes yes no 7 0
So, the type and encoding differs, and the math fonts.
fonts pdftex luatex fontspec font-encodings
add a comment |Â
up vote
1
down vote
favorite
I have to make a document, which was originally written in LuaLaTeX, compatible for both pdfLaTeX and LuaLaTeX. Everything works except that the fonts differ. How can I force pdfLaTeX/fontenc to use the same fonts as fontspec?
Minimal example (omitted ifluatex to avoid clutter):
documentclass[fontsize=11pt]scrreprt
% usepackagefontspec
usepackagelmodern
usepackage[T1]fontenc
usepackage[utf8]inputenc
begindocument
chapterChapter
sectionSection
Text with some formulas: $a=1$.
enddocument
By using lmodern
, the fonts of the text seem to almost coincide, but the math fonts differ:
# pdffonts output for pdflatex with lmodern, fontenc and inputenc:
name type encoding emb sub uni object ID
------------------------------------ ----------------- ---------------- --- --- --- ---------
ZGMFNK+LMSans10-Bold Type 1 Custom yes yes no 4 0
YIMXCY+LMRoman10-Regular Type 1 Custom yes yes no 5 0
GXEVRM+LMMathItalic10-Regular Type 1 Custom yes yes no 6 0
YIMXCY+LMRoman10-Regular Type 1 Custom yes yes no 7 0
# pdffonts output for lualatex with fontspec:
name type encoding emb sub uni object ID
------------------------------------ ----------------- ---------------- --- --- --- ---------
SSPBGH+LMSans10-Bold CID Type 0C Identity-H yes yes yes 4 0
XXBUAG+LMRoman10-Regular CID Type 0C Identity-H yes yes yes 5 0
EDWHGC+CMMI10 Type 1 Builtin yes yes no 6 0
HVZLMP+CMR10 Type 1 Builtin yes yes no 7 0
So, the type and encoding differs, and the math fonts.
fonts pdftex luatex fontspec font-encodings
add a comment |Â
up vote
1
down vote
favorite
up vote
1
down vote
favorite
I have to make a document, which was originally written in LuaLaTeX, compatible for both pdfLaTeX and LuaLaTeX. Everything works except that the fonts differ. How can I force pdfLaTeX/fontenc to use the same fonts as fontspec?
Minimal example (omitted ifluatex to avoid clutter):
documentclass[fontsize=11pt]scrreprt
% usepackagefontspec
usepackagelmodern
usepackage[T1]fontenc
usepackage[utf8]inputenc
begindocument
chapterChapter
sectionSection
Text with some formulas: $a=1$.
enddocument
By using lmodern
, the fonts of the text seem to almost coincide, but the math fonts differ:
# pdffonts output for pdflatex with lmodern, fontenc and inputenc:
name type encoding emb sub uni object ID
------------------------------------ ----------------- ---------------- --- --- --- ---------
ZGMFNK+LMSans10-Bold Type 1 Custom yes yes no 4 0
YIMXCY+LMRoman10-Regular Type 1 Custom yes yes no 5 0
GXEVRM+LMMathItalic10-Regular Type 1 Custom yes yes no 6 0
YIMXCY+LMRoman10-Regular Type 1 Custom yes yes no 7 0
# pdffonts output for lualatex with fontspec:
name type encoding emb sub uni object ID
------------------------------------ ----------------- ---------------- --- --- --- ---------
SSPBGH+LMSans10-Bold CID Type 0C Identity-H yes yes yes 4 0
XXBUAG+LMRoman10-Regular CID Type 0C Identity-H yes yes yes 5 0
EDWHGC+CMMI10 Type 1 Builtin yes yes no 6 0
HVZLMP+CMR10 Type 1 Builtin yes yes no 7 0
So, the type and encoding differs, and the math fonts.
fonts pdftex luatex fontspec font-encodings
I have to make a document, which was originally written in LuaLaTeX, compatible for both pdfLaTeX and LuaLaTeX. Everything works except that the fonts differ. How can I force pdfLaTeX/fontenc to use the same fonts as fontspec?
Minimal example (omitted ifluatex to avoid clutter):
documentclass[fontsize=11pt]scrreprt
% usepackagefontspec
usepackagelmodern
usepackage[T1]fontenc
usepackage[utf8]inputenc
begindocument
chapterChapter
sectionSection
Text with some formulas: $a=1$.
enddocument
By using lmodern
, the fonts of the text seem to almost coincide, but the math fonts differ:
# pdffonts output for pdflatex with lmodern, fontenc and inputenc:
name type encoding emb sub uni object ID
------------------------------------ ----------------- ---------------- --- --- --- ---------
ZGMFNK+LMSans10-Bold Type 1 Custom yes yes no 4 0
YIMXCY+LMRoman10-Regular Type 1 Custom yes yes no 5 0
GXEVRM+LMMathItalic10-Regular Type 1 Custom yes yes no 6 0
YIMXCY+LMRoman10-Regular Type 1 Custom yes yes no 7 0
# pdffonts output for lualatex with fontspec:
name type encoding emb sub uni object ID
------------------------------------ ----------------- ---------------- --- --- --- ---------
SSPBGH+LMSans10-Bold CID Type 0C Identity-H yes yes yes 4 0
XXBUAG+LMRoman10-Regular CID Type 0C Identity-H yes yes yes 5 0
EDWHGC+CMMI10 Type 1 Builtin yes yes no 6 0
HVZLMP+CMR10 Type 1 Builtin yes yes no 7 0
So, the type and encoding differs, and the math fonts.
fonts pdftex luatex fontspec font-encodings
fonts pdftex luatex fontspec font-encodings
asked 3 hours ago
Cari Baur
112116
112116
add a comment |Â
add a comment |Â
1 Answer
1
active
oldest
votes
up vote
3
down vote
It is not possible to get the same font encodings for LuaTeX and pdfTeX, for the simple reason that LuaTeX with fontspec
uses OpenType fonts, whereas pdfTeX uses Type 1 fonts. It is possible to get the same math fonts, though, by passing the option nomath
to lmodern
.
If you are using the 2018 version of LaTeX, you can remove usepackage[utf8]inputenc
because UTF-8 is now the standard encoding.
documentclass[fontsize=11pt]scrreprt
ifdefineddirectlua
usepackagefontspec
else
usepackage[T1]fontenc
usepackage[nomath]lmodern
fi
begindocument
chapterChapter
sectionSection
Text with some formulas: $a=1$.
enddocument
Run through pdflatex
I get this
$ pdflatex test.tex
$ pdffonts test.pdf
name type encoding emb sub uni object ID
------------------------------------ ----------------- ---------------- --- --- --- ---------
ZGMFNK+LMSans10-Bold Type 1 Custom yes yes no 4 0
KOIJYY+LMRoman10-Regular Type 1 Custom yes yes no 5 0
EDWHGC+CMMI10 Type 1 Builtin yes yes no 6 0
HVZLMP+CMR10 Type 1 Builtin yes yes no 7 0
Run through lualatex
I get this
$ lualatex test.tex
$ pdffonts test.pdf
name type encoding emb sub uni object ID
------------------------------------ ----------------- ---------------- --- --- --- ---------
SSPBGH+LMSans10-Bold CID Type 0C Identity-H yes yes yes 4 0
HXVMKT+LMRoman10-Regular CID Type 0C Identity-H yes yes yes 5 0
EDWHGC+CMMI10 Type 1 Builtin yes yes no 6 0
HVZLMP+CMR10 Type 1 Builtin yes yes no 7 0
add a comment |Â
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
3
down vote
It is not possible to get the same font encodings for LuaTeX and pdfTeX, for the simple reason that LuaTeX with fontspec
uses OpenType fonts, whereas pdfTeX uses Type 1 fonts. It is possible to get the same math fonts, though, by passing the option nomath
to lmodern
.
If you are using the 2018 version of LaTeX, you can remove usepackage[utf8]inputenc
because UTF-8 is now the standard encoding.
documentclass[fontsize=11pt]scrreprt
ifdefineddirectlua
usepackagefontspec
else
usepackage[T1]fontenc
usepackage[nomath]lmodern
fi
begindocument
chapterChapter
sectionSection
Text with some formulas: $a=1$.
enddocument
Run through pdflatex
I get this
$ pdflatex test.tex
$ pdffonts test.pdf
name type encoding emb sub uni object ID
------------------------------------ ----------------- ---------------- --- --- --- ---------
ZGMFNK+LMSans10-Bold Type 1 Custom yes yes no 4 0
KOIJYY+LMRoman10-Regular Type 1 Custom yes yes no 5 0
EDWHGC+CMMI10 Type 1 Builtin yes yes no 6 0
HVZLMP+CMR10 Type 1 Builtin yes yes no 7 0
Run through lualatex
I get this
$ lualatex test.tex
$ pdffonts test.pdf
name type encoding emb sub uni object ID
------------------------------------ ----------------- ---------------- --- --- --- ---------
SSPBGH+LMSans10-Bold CID Type 0C Identity-H yes yes yes 4 0
HXVMKT+LMRoman10-Regular CID Type 0C Identity-H yes yes yes 5 0
EDWHGC+CMMI10 Type 1 Builtin yes yes no 6 0
HVZLMP+CMR10 Type 1 Builtin yes yes no 7 0
add a comment |Â
up vote
3
down vote
It is not possible to get the same font encodings for LuaTeX and pdfTeX, for the simple reason that LuaTeX with fontspec
uses OpenType fonts, whereas pdfTeX uses Type 1 fonts. It is possible to get the same math fonts, though, by passing the option nomath
to lmodern
.
If you are using the 2018 version of LaTeX, you can remove usepackage[utf8]inputenc
because UTF-8 is now the standard encoding.
documentclass[fontsize=11pt]scrreprt
ifdefineddirectlua
usepackagefontspec
else
usepackage[T1]fontenc
usepackage[nomath]lmodern
fi
begindocument
chapterChapter
sectionSection
Text with some formulas: $a=1$.
enddocument
Run through pdflatex
I get this
$ pdflatex test.tex
$ pdffonts test.pdf
name type encoding emb sub uni object ID
------------------------------------ ----------------- ---------------- --- --- --- ---------
ZGMFNK+LMSans10-Bold Type 1 Custom yes yes no 4 0
KOIJYY+LMRoman10-Regular Type 1 Custom yes yes no 5 0
EDWHGC+CMMI10 Type 1 Builtin yes yes no 6 0
HVZLMP+CMR10 Type 1 Builtin yes yes no 7 0
Run through lualatex
I get this
$ lualatex test.tex
$ pdffonts test.pdf
name type encoding emb sub uni object ID
------------------------------------ ----------------- ---------------- --- --- --- ---------
SSPBGH+LMSans10-Bold CID Type 0C Identity-H yes yes yes 4 0
HXVMKT+LMRoman10-Regular CID Type 0C Identity-H yes yes yes 5 0
EDWHGC+CMMI10 Type 1 Builtin yes yes no 6 0
HVZLMP+CMR10 Type 1 Builtin yes yes no 7 0
add a comment |Â
up vote
3
down vote
up vote
3
down vote
It is not possible to get the same font encodings for LuaTeX and pdfTeX, for the simple reason that LuaTeX with fontspec
uses OpenType fonts, whereas pdfTeX uses Type 1 fonts. It is possible to get the same math fonts, though, by passing the option nomath
to lmodern
.
If you are using the 2018 version of LaTeX, you can remove usepackage[utf8]inputenc
because UTF-8 is now the standard encoding.
documentclass[fontsize=11pt]scrreprt
ifdefineddirectlua
usepackagefontspec
else
usepackage[T1]fontenc
usepackage[nomath]lmodern
fi
begindocument
chapterChapter
sectionSection
Text with some formulas: $a=1$.
enddocument
Run through pdflatex
I get this
$ pdflatex test.tex
$ pdffonts test.pdf
name type encoding emb sub uni object ID
------------------------------------ ----------------- ---------------- --- --- --- ---------
ZGMFNK+LMSans10-Bold Type 1 Custom yes yes no 4 0
KOIJYY+LMRoman10-Regular Type 1 Custom yes yes no 5 0
EDWHGC+CMMI10 Type 1 Builtin yes yes no 6 0
HVZLMP+CMR10 Type 1 Builtin yes yes no 7 0
Run through lualatex
I get this
$ lualatex test.tex
$ pdffonts test.pdf
name type encoding emb sub uni object ID
------------------------------------ ----------------- ---------------- --- --- --- ---------
SSPBGH+LMSans10-Bold CID Type 0C Identity-H yes yes yes 4 0
HXVMKT+LMRoman10-Regular CID Type 0C Identity-H yes yes yes 5 0
EDWHGC+CMMI10 Type 1 Builtin yes yes no 6 0
HVZLMP+CMR10 Type 1 Builtin yes yes no 7 0
It is not possible to get the same font encodings for LuaTeX and pdfTeX, for the simple reason that LuaTeX with fontspec
uses OpenType fonts, whereas pdfTeX uses Type 1 fonts. It is possible to get the same math fonts, though, by passing the option nomath
to lmodern
.
If you are using the 2018 version of LaTeX, you can remove usepackage[utf8]inputenc
because UTF-8 is now the standard encoding.
documentclass[fontsize=11pt]scrreprt
ifdefineddirectlua
usepackagefontspec
else
usepackage[T1]fontenc
usepackage[nomath]lmodern
fi
begindocument
chapterChapter
sectionSection
Text with some formulas: $a=1$.
enddocument
Run through pdflatex
I get this
$ pdflatex test.tex
$ pdffonts test.pdf
name type encoding emb sub uni object ID
------------------------------------ ----------------- ---------------- --- --- --- ---------
ZGMFNK+LMSans10-Bold Type 1 Custom yes yes no 4 0
KOIJYY+LMRoman10-Regular Type 1 Custom yes yes no 5 0
EDWHGC+CMMI10 Type 1 Builtin yes yes no 6 0
HVZLMP+CMR10 Type 1 Builtin yes yes no 7 0
Run through lualatex
I get this
$ lualatex test.tex
$ pdffonts test.pdf
name type encoding emb sub uni object ID
------------------------------------ ----------------- ---------------- --- --- --- ---------
SSPBGH+LMSans10-Bold CID Type 0C Identity-H yes yes yes 4 0
HXVMKT+LMRoman10-Regular CID Type 0C Identity-H yes yes yes 5 0
EDWHGC+CMMI10 Type 1 Builtin yes yes no 6 0
HVZLMP+CMR10 Type 1 Builtin yes yes no 7 0
answered 2 hours ago
Henri Menke
65.1k7144253
65.1k7144253
add a comment |Â
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f453034%2fgetting-fontspec-fonts-with-pdflatex%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password