0

I decided to try using some new fonts and LuaLaTeX, and so I downloaded some fonts and installed them using the instructions from the first answer in this post. I put the setup into my preamble and compilation with LuaTeX worked, but what I got was Computer Modern instead of the installed fonts, so I'm not sure what's happening.

I also tried using mkluatexfontdb --force --verbose=-1 -vvv, but what happened was a mkluatexfontdb: command not found error, so I had to do it all manually by linking the correct folder.

Here is the font part of the setup in my preamble:

% Font / LuaLaTeX setup
\RequirePackage{iftex}
\ifpdftex
\ifluatex
    \RequirePackage{fontspec}
    \RequirePackage{unicode-math} 
    \unimathsetup{math-style=TeX}
    \RequirePackage[english]{babel}
    \defaultfontfeatures{Ligatures=TeX, Scale=MatchLowercase}
    \setmainfont[
    Path=/usr/share/fonts/opentype/linux-libertine/,
    Extension=.otf,
    BoldFont=LinLibertine_RB,
    ItalicFont=LinLibertine_RI,
    BoltItalicFont=LinLibertine_RBI,
    ]{LinLibertine_R}
    \setsansfont[
    Path=/mnt/c/Users/user/Appdata/Local/Microsoft/Windows/Fonts, % yes I also added Windows fonts to the font dir and it appears when doing fc-list | grep -i <windows font>
    Extension=.otf,
    BoldFont=Kurier-Bold,
    ItalicFont=Kurier-Italic,
    BoldItalicFont=Kurier-BoldItalic,
    ]{Kurier-Regular}
    \setmonofont[
    Path=/mnt/c/Users/user/Appdata/Local/Microsoft/Windows/Fonts,
    Extension=.ttf,
    BoldFont=Inconsolata-Bold,
    ]{Inconsolata-Regular}
\else 
% regular times
\RequirePackage[T1]{fontenc}
\RequirePackage{newtxtext}
\RequirePackage[smallerops]{newtxmath}
\fi
\fi

Perhaps there's something in my preamble that I missed, or perhaps it's something else entirely. If someone knows how to solve this problem, it would be great. Thanks!

Revise
  • 365
  • 1
    9 years are long time. the tool is now call luaotfload-tool. And your \if switches are wrong, you are actually excluding all the code. – Ulrike Fischer Aug 01 '22 at 17:48
  • I'm not quite sure what you meant about the first sentence - did I load the fonts incorrectly? Additionally, I will check my \if switches right now - I tried something which uses nested \if and \else, but that could be wrong. – Revise Aug 01 '22 at 17:53
  • \ifpdftex is false if you use luatex. – Ulrike Fischer Aug 01 '22 at 17:54
  • Yep, that was it. I ran a test on a small tex file which outputs LuaLaTeX and some other test words if there is luatex and LaTeX with pdftex - only the first test worked. I changed that and made a few other changes which I didn't notice were causing errors and most of it worked. Thanks for the insight! – Revise Aug 01 '22 at 18:08
  • 1
    @UlrikeFischer means there is no command mkluatexfontdb it is called luaotfload-tool but you rarely need to run it directly, luatex updates its files automatically – David Carlisle Aug 01 '22 at 18:09

0 Answers0