1

I'm using a custom style (not made by me) for a report and when I compile it using PdfLatex it works fine. However, when I want to use the house style fonts I have to compile it with XeLatex and I get an error:

! fontspec error: "font-not-found"
!
! The font "BookmanOldStyle" cannot be found.

(I get this error for multiple font styles but I won't include them here for brevity)

I've looked at similar questions but none of the answers have been able to help me or steer me in the right direction.

A MWE:

\documentclass[print]{tudelft-report}

\begin{document}

\chapter{Font test}
House style

\end{document}

! Note that you need this custom style! (see line 61)

3

This is because different fonts are used when compiling using PDFLaTeX or XeLaTeX. Quoting from the style definition file:

\ifxetex
    %% If the document is compiled with XeLaTeX, we load the TU Delft house
    %% style fonts: Bookman Old Style (serif) for titles and Tahoma (sans-serif)
    %% for text. Even if the nativefonts option was specified, we need these
    %% fonts for the cover.
    \newfontfamily\tudrmfamily[
        Path = fonts/,
        Extension = .ttf,
        BoldFont = *-Bold,
        ItalicFont = *-Italic,
        BoldItalicFont = *-BoldItalic
    ]{BookmanOldStyle}
    \newfontfamily\tudsffamily[
        Path = fonts/,
        Extension = .ttf,
        BoldFont = *-Bold,
        ItalicFont = *,
        ItalicFeatures = FakeSlant,
        BoldItalicFont = *-Bold,
        BoldItalicFeatures = FakeSlant
    ]{Tahoma} \else
    %% If the document is not compiled with XeLaTeX, we need to use the native
    %% fonts.
    \@nativefontstrue
    \newcommand*\tudrmfamily{\rmfamily}
    \newcommand*\tudsffamily{\sffamily} \fi

The error you get suggests the specified font is not installed on your system. A casual Google search hints that you might be able to download it, e.g. from http://fontzone.net/font-details/bookman-old-style . Additionally, fonts are provided in the subfolder of the one you linked: https://github.com/praseodym/tudelft-report-latex

  • Thanks for your help! Do you know if it is possible to check if I already have the font on my system (ubuntu). If not, is there a specific path where I should save the .ttf? – MichaelDeSanta Apr 7 '15 at 13:30
  • Found the answer to the first question myself, it is not installed – MichaelDeSanta Apr 7 '15 at 13:32
  • @MichaelDeSanta You might try suggestions in this post: How to install fonts fast and easy? – Fato39 Apr 7 '15 at 13:33
  • Sorry, I was too quick to accept the answer. I've downloaded the fonts and added them to the path /usr/share/fonts (used fc-list|grep BookmanOldStyle to verify this). However, the font-spec error remains. – MichaelDeSanta Apr 7 '15 at 13:50
  • 1
    Ok very simple solution; the .ttf files have to be put in the /fonts path (see line 67) – MichaelDeSanta Apr 7 '15 at 14:19

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.