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 --- 

%% Settings go in settings.tex

% \usepackage{changebar}

\department{Institutionen för datavetenskap}
\departmentenglish{Department of Computer and Information Science}

%\subtitleenglish{with a subtitle}
\titleswedish{En himla bra svensk titel}







%%% 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\primaryfont{"#1"} % first preferred font
    \def\secondaryfont{"#2"} % if first font not avaliable
    \font\bodyfont=\primaryfont\space at 10pt
      \font\bodyfont=\secondaryfont\space at 10pt
        \errmessage{Neither #1 or #2 fonts installed, quitting..}
    \typeout{ **** Please use XeTeX and install Calibri for correct typesetting ***}

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 !

  • 1
    you have not shown your input which makes it hard for anyone to tell you what is wrong. You should be using 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
  • also you have posted a very long log file which shows no errors in particular it does not show the error in the title. (texstudio must be showing an error from a different document) – David Carlisle Sep 19 '18 at 14:15
  • Thank you for your comments, I fixed my post according to what you said. I used to be able to compile without any problem using texstudio and xelatex on a different computer running W10 (I am running Ubuntu on the one with the problem). – V. Déhaye Sep 19 '18 at 15:11
  • Oh well that is the answer then: Calibri is a microsoft font not licenced for use on linux. – David Carlisle Sep 19 '18 at 15:29
  • you still haven't provided an example that anyone can run, presumably that \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

Calibri is a Microsoft font not available on linux (unless you have bought it).

You have not shown the use of the \tryfonts command but presumably in your document it tries Calibri and then some other font. On linux the test for Calibri will fail and it will use whatever font you specified for #2 instead. The test itself will place a warning in the log that the font is not found but it is not actually a problem that is the intended behaviour of the test.

  • Thank you for your answer. The tryfonts command is as follows: \tryfonts{Calibri}{Carlito}. The weird thing is it should try to find the replacement font, which seems to be Carlito in this case, but it doesn't. Either way, as I am on a dual-boot Windows/Linux, I have Calibri available on the other partition. I followed the instructions in doc.ubuntu-fr.org/msttcorefonts section 2 to make it available to Linux. I did both the solutions with the symbolic link and copying the folder, but still the same error message. The calibri.ttf files are present in the folder, I checked. – V. Déhaye Sep 19 '18 at 16:24
  • @V.Déhaye without a example I can't really say more, failing on calibri and loading carlito would be the expected behaviour, the log file you originally showed had no errors and a completed pdf file, do you really get an error? TeX would not care of course but using the calibri from windows on your linux system is almost certainly not allowed by its end user licence. – David Carlisle Sep 19 '18 at 16:30
  • You're right it does compile, but it still gives me the error (not warning). You can see it in the log file I attached. – V. Déhaye Sep 19 '18 at 16:49
  • @V.Déhaye yes as I say that is just the test for calibri failing then it loads carlito, the test is run in \batchmode so failing tests in \tryfonts do not stop tex and are not shown on the terminal but it is the expected behaviour. if tryfonts ever uses the second font it will show the failure to find the first in the log. – David Carlisle Sep 19 '18 at 17:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.