I am getting the error shown in the title five times in a row at the beginning of the logs when trying to compile my document with XeLaTex through TexStudio (command used: xelatex -synctex=1 -interaction=nonstopmode %.tex
).
I am compiling this document:
%%% demothesis.tex ---
\documentclass[msc,lith,english]{liuthesis}
%% Settings go in settings.tex
\include{settings}
\usepackage{rotating}
\usepackage{color}
\usepackage{multicol}
% \usepackage{changebar}
\department{Institutionen för datavetenskap}
\departmentenglish{Department of Computer and Information Science}
\departmentshort{IDA}
\externalsupervisor{Anonymous}
\supervisor{Anonymous}
\examiner{Anonymous}
\titleenglish{Something}
%\subtitleenglish{with a subtitle}
\titleswedish{En himla bra svensk titel}
\thesissubject{Datateknik}
\publicationyear{2018}
\currentyearthesisnumber{001}
\dateofpublication{2018-06-29}
\author{Anonymous}
\begin{document}
\chapterstyle{VZ43}
\include{intro}
\include{theory}
\include{method}
\include{results}
\include{discussion}
\include{conclusion}
\printbibliography
\include{appendix}
\end{document}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%% demothesis.tex ends here
As can be noticed, I am using a custom class, liuthesis. The file liuthesis.cls is in the same folder as the file I try to compile. The only place where bodyfont is set in this cls file is there:
\def\tryfonts#1#2{
\ifxetex
\def\primaryfont{"#1"} % first preferred font
\def\secondaryfont{"#2"} % if first font not avaliable
\count255=\interactionmode
\batchmode
\font\bodyfont=\primaryfont\space at 10pt
\ifx\bodyfont\nullfont
\font\bodyfont=\secondaryfont\space at 10pt
\ifx\bodyfont\nullfont
\errorstopmode
\errmessage{Neither #1 or #2 fonts installed, quitting..}
\else
\fontspec{#2}
\setmainfont{#2}
\fi
\else
\fontspec{#1}
\setmainfont{#1}
\fi
\interactionmode=\count255
\else
\typeout{ **** Please use XeTeX and install Calibri for correct typesetting ***}
\fi
}
All the tryfonts commands are as follows: \tryfonts{Calibri}{Carlito}
The error does not appear in the full logs (messages tab in TexStudio), but only in the summed up version (log tab in TexStudio). It says it happens at \begin{document}
, line 65.
Here is the log output, too big to fit in the post: logs
When encountering this error, most of the times the people solved the problem installing texlive-fonts-recommended
. However, using this script shows me that it is already installed (confirmed by apt-get when I try to install it).
I can't find any solution. Does any of you have an idea ? Thank you in advance for your help !
fontspec
to load an opentype font into xelatex but\bodyfont
does not sound like a fontspec font name. – David Carlisle Sep 19 '18 at 14:12\tryfonts
command is run somewhere but not in the log you showed) and on linux it will be expected to fail on Calibri and then presumably use the next font it tries instead. – David Carlisle Sep 19 '18 at 15:34