0

How can I use the MS Trebuchet font in LaTeX, or in this case, tikzposter? I have tried the awnser from How to use the MS Trebuchet font? with this code:

\usepackage[T1]{fontenc} % https://tex.stackexchange.com/questions/33739/how-to-use-the-ms-trebuchet-font
\pdfmapfile{+winfonts.map}
\renewcommand\rmdefault{trebuchet}

But I just get a warning like this:

LaTeX Font Warning: Font shape `T1/trebuchet/m/n' undefined

The formatting does then not work with bold or italic text anymore.

Ingmar
  • 6,690
  • 5
  • 26
  • 47
KGB91
  • 145
  • It seems to be a general problem. – KGB91 Oct 27 '23 at 13:34
  • I am sure it exists on my computor since I can use it with R. – KGB91 Oct 27 '23 at 13:49
  • I think it's the same issue as in https://tex.stackexchange.com/q/339253/82917. The question you linked is from 2011, Windows font support broke around 2018. – campa Oct 27 '23 at 14:44
  • 1
    Just use LuaLaTeX and use Trebuchet like any other .ttf font. – Ingmar Oct 27 '23 at 14:53
  • @Ingmar how do I do that? – KGB91 Oct 27 '23 at 14:55
  • 1
    While waiting for @Ingmar to post as an answer... Add \usepackage{fontspec} just below document class. Then add \setmainfont{MS Trebuchet} just below that. Do not use fontenc or rmdefault (already invoked by fontspec). Not sure about the pdfmapfile, but I think it should be omitted. Then compile with lualatex. Command line lualatex yourdocument.tex so that you are compiling with utf8 encoding (known as TU within TeX). – rallg Oct 27 '23 at 16:02
  • @rallg Definitely drop the map file addition. OP: also, if you are loading inputenc, drop that, too, and drop textcomp, if you use that. If you're using other font packages, drop if not compatible. You can keep maths fonts traditional and just change the text fonts to fontspec, which is probably the path of least resistance. – cfr Oct 27 '23 at 17:21
  • I did that, but I still get the error Font shapeT1/aer/b/sc' undefined` and the font does not change.

    edit: now it says: ! Fatal Package fontspec Error: The fontspec package requires either XeTeX or(fontspec) LuaTeX.(fontspec)(fontspec) You must change your typesetting engine to,(fontspec) e.g., "xelatex" or "lualatex" instead of(fontspec) "latex" or "pdflatex".Type <return> to continue.... \msg_fatal:nn {fontspec} {cannot-use-pdftex}

    – KGB91 Oct 27 '23 at 18:00
  • And yes, I selected LuaTeX in Texmaker – KGB91 Oct 27 '23 at 18:19
  • Select lualatex not luatex. If your system does not have lualatex (it is probably a softlink to luahbtex) then create the softlink yourself. – rallg Oct 27 '23 at 18:39
  • Ok, that did not work either. How do I create the softlink? Sorry for questions, but I am new to this – KGB91 Oct 27 '23 at 18:43
  • Are you using Windows? You did not say. If so, I will defer to others, regarding softlink (if needed there). Meanwhile: Consider using font Fira Sans instead of Trebuchet. It is available as a TeX package, and includes a file format that does not reuire fontspec or lualatex. Instructions are in the LaTeX font catalog, at this page: https://tug.org/FontCatalogue/firasans/ – rallg Oct 27 '23 at 18:56
  • Thanks, yes I am using Windows. Unfortunately, I cannot use anything else than trebuchet since it is a part of a theme I must follow imposed by my employer. – KGB91 Oct 27 '23 at 19:04

1 Answers1

2

Note it's Trebuchet MS not MS Trebuchet. then, with lualatex:

\documentclass{article}

\usepackage{fontspec}

\setmainfont{Trebuchet MS}

\begin{document}

One two \textbf{three} \textit{four}.

\end{document}

enter image description here

David Carlisle
  • 757,742
  • Ah, good catch! Possibly the OP is also having trouble launching lualatex from the GUI? – rallg Oct 27 '23 at 20:26
  • @rallg what's a GUI?:-) I launch lualatex by typing lualatex on the commandline... – David Carlisle Oct 27 '23 at 20:27
  • If I put a cheeseburger in the microwave for too long, then the cheese becomes very GUI. I also use command line (Linux). – rallg Oct 27 '23 at 20:29
  • I manged to use the commandline, thanks for suggesting that. However, the font does not change as far as I can tell. I get the error LaTeX Font Warning: Some font shapes were not available, defaults substituted.

    edit: It was a typo by me. Problem solved. Thanks a lot for the help!

    – KGB91 Oct 27 '23 at 23:44