2

I am trying to typeset a document that contains monospaced text with Greek-letter Unicode glyphs, e.g. alpha, beta, etc. To do so, I'm using the JuliaMono font, which has extensive support for mathy Unicode glyphs.

Strangely, the same LaTeX code correctly produces the desired Unicode output in XeLaTeX but not in LuaLaTeX (where many glyphs are replaced with "no glyph" rectangles). Here is the code:

\documentclass{article}

\usepackage{fontspec}
\setmonofont{JuliaMono}

\begin{document}
\ttfamily α β δ σ π γ ϵ ε η ς θ ϑ ϕ φ ψ
\end{document}
  • Here is the XeLaTeX output:

    xelatex-output-correct

  • Here is the LuaLaTeX output:

    lualatex-output-incorrect

Does anybody know what's going on? Why does LuaLaTeX fail to load certain glyphs (and oddly enough is OK loading pi) compared to XeLaTeX? Is this a bug or intended restriction of LuaLaTeX, and is there a way to fix the difference (e.g., explicitly tell LuaLaTeX to load in all glyphs)?

2
  • on windows I have no problems. Can you show the lualatex log-file? Feb 7, 2022 at 23:31
  • @UlrikeFischer ix.io/3P0g here's a log, I'm on Linux, so that might account for one difference
    – Kye W Shi
    Feb 8, 2022 at 4:11

1 Answer 1

2

The fonts have a strange naming scheme. Call them explicitly.

\documentclass{article}

\usepackage{fontspec}
\setmonofont{JuliaMono}[
  Extension=.ttf,
  UprightFont=*-Regular,
  BoldFont=*-Bold,
  ItalicFont=*-RegularItalic,
  BoldItalicFont=*-BoldItalic,
]

\begin{document}
\ttfamily α β δ σ π γ ϵ ε η ς θ ϑ ϕ φ ψ ά έ ή ί ό ύ ώ
\end{document}

enter image description here

4
  • Thanks, this fixes it! But do you know why XeLaTeX doesn't suffer from the same issue, if the fault lies with the font files itself?
    – Kye W Shi
    Feb 7, 2022 at 22:34
  • @KyeWShi Different library to find the fonts?
    – egreg
    Feb 7, 2022 at 22:47
  • as in, LuaLaTeX's font-finder relies on (maybe hard-coded) naming schemes, whereas XeLaTeX's font-finder maybe uses some other mechanism not sensitive to naming schemes, e.g., fontconfig database or something?
    – Kye W Shi
    Feb 7, 2022 at 22:56
  • @KyeWShi The method used by LuaLaTeX uses fontconfig, but it creates its own database with its own rules. XeLaTeX uses fontconfig.
    – egreg
    Feb 7, 2022 at 23:10

You must log in to answer this question.

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