lualatex and pdflatex: lmr and cmr

1,444

You get the warning as soon as the default family is not cmr, whatever engine you use.

You can get rid of the warning by using substitutefont:

\documentclass{article}
\usepackage{phaistos} % font package defining \PHplumedHead below
\usepackage{substitutefont}

\substitutefont{LPH}{\familydefault}{cmr}

\begin{document}

\PHplumedHead

\end{document}

Don't do it with pdflatex if you don't load some font package that sets a new default font.

Much preferable would be if the phaistos package didn't try and define the font to belong to the cmr family.

\documentclass{article}

\DeclareFontFamily{U}{phaistos}{}
\DeclareFontShape{U}{phaistos}{m}{n}{ <-> phaistos }{}

\newcommand{\newphaistossymbol}[2]{\newcommand#1{\phaistossymbol{#2}}}
\newcommand{\phaistossymbol}[1]{{\usefont{U}{phaistos}{m}{n}\symbol{#1}}}

\newphaistossymbol{\PHpedestrian}{"41}
\newphaistossymbol{\PHplumedHead}{"42}
\newphaistossymbol{\PHtattooedHead}{"43}
\newphaistossymbol{\PHcaptive}{"44}
\newphaistossymbol{\PHchild}{"45}
\newphaistossymbol{\PHwoman}{"46}
\newphaistossymbol{\PHhelmet}{"47}
\newphaistossymbol{\PHgaunlet}{"48}
\newphaistossymbol{\PHtiara}{"49}
\newphaistossymbol{\PHarrow}{"4A}
\newphaistossymbol{\PHbow}{"4B}
\newphaistossymbol{\PHshield}{"4C}
\newphaistossymbol{\PHclub}{"4D}
\newphaistossymbol{\PHmanacles}{"4E}
\newphaistossymbol{\PHmattock}{"4F}
\newphaistossymbol{\PHsaw}{"50}
\newphaistossymbol{\PHlid}{"51}
\newphaistossymbol{\PHboomerang}{"52}
\newphaistossymbol{\PHcarpentryPlane}{"53}
\newphaistossymbol{\PHdolium}{"54}
\newphaistossymbol{\PHcomb}{"55}
\newphaistossymbol{\PHsling}{"56}
\newphaistossymbol{\PHcolumn}{"57}
\newphaistossymbol{\PHbeehive}{"58}
\newphaistossymbol{\PHship}{"59}
\newphaistossymbol{\PHhorn}{"5A}
\newphaistossymbol{\PHhide}{"61}
\newphaistossymbol{\PHbullLeg}{"62}
\newphaistossymbol{\PHcat}{"63}
\newphaistossymbol{\PHram}{"64}
\newphaistossymbol{\PHeagle}{"65}
\newphaistossymbol{\PHdove}{"66}
\newphaistossymbol{\PHtunny}{"67}
\newphaistossymbol{\PHbee}{"68}
\newphaistossymbol{\PHplaneTree}{"69}
\newphaistossymbol{\PHvine}{"6A}
\newphaistossymbol{\PHpapyrus}{"6B}
\newphaistossymbol{\PHrosette}{"6C}
\newphaistossymbol{\PHlily}{"6D}
\newphaistossymbol{\PHoxBack}{"6E}
\newphaistossymbol{\PHflute}{"6F}
\newphaistossymbol{\PHgrater}{"70}
\newphaistossymbol{\PHstrainer}{"71}
\newphaistossymbol{\PHsmallAxe}{"72}
\newphaistossymbol{\PHwavyBand}{"73}

\begin{document}

\PHplumedHead

\end{document}

The above will work independently of the engine, with no warning.

Share:
1,444

Related videos on Youtube

Matti
Author by

Matti

Updated on July 27, 2020

Comments

  • Matti
    Matti over 3 years

    Switching pdflatex to lualatex gives the following warning message with some rare font packages (see the MWE):

    LaTeX Font Warning: Font shape `LPH/lmr/m/n' undefined (Font) using `LPH/cmr/m/n'
    instead (Font) for symbol `PHplumedHead' on input line 9.
    

    I understand the warning, but can someone briefly explain why this warning is not given with pdflatex? Does lualatex use cmr (Computer Modern Roman) as default instead of lmr (Latin Modern Roman) as opposed to pdflatex?

    How to get rid of the warnings with lualatex?

    \documentclass{article}
    \usepackage{phaistos} % font package defining \PHplumedHead below
    \begin{document}
    \PHplumedHead
    \end{document}
    
    • cfr
      cfr over 6 years
      Don't use minimal for examples: it is not suitable. Both engines use CMR by default. Usually, you want to use fontspec with LuaLaTeX, though, which switches the default to LMR. EDIT: Apparently it uses LMR even without fontspec.
    • Matti
      Matti over 6 years
      @cfr: fixed the minimal. Adding \usepackage{fontspec} does not remove the warning tho.
    • cfr
      cfr over 6 years
      No. It won't. The question is whether you want to be using standard font encodings with LuaTeX. If you do, can't you just ignore the warning? It's only a warning.
    • Ulrike Fischer
      Ulrike Fischer over 6 years
      It is the other way round: the default family of pdflatex is cmr, and as the font exist it works, but with lualatex the default family is lmr. Add \makeatletter\show\f@family to see it.
    • Matti
      Matti over 6 years
      @cfr: I know this is a limited, silly little question. I have ignored the warning for several years. Now that I am on my summer leave I finally had time to gain some understanding and try to rid of it.
  • Matti
    Matti over 6 years
    Ah, this gave me the idea to go see the .sty file of the package. From there I replaced all the DeclareFont-commands with cmr with lmr. Perhaps not preferable, but now I understand more about how the fonts are defined.
  • egreg
    egreg over 6 years
    @Mappi I think it was a very bad idea of the package author to define the font as belonging to the cmr package. I added an independent version that will produce no warning and the same output.