I'm absolutely new to LaTeX, so I decided to start working in LyX and have a look at the generated .tex file every now and then, until I understand everything better.

I'm writing my master thesis, and my university has a very fancy display font for titles etc. I'd like to write the title - and the title only! - in that special font. How do I do that? (I'm using the article document class.)

I suppose that LyX won't help me here, and it has to be done in LaTeX code. But as I said, I'm really not good at LaTeX yet, so please don't just answer something like: "Use package XYZ", because that won't help me much. I need rather detailed instructions.


Thanks to Henri Menke's little comment, I found a way to do this in LyX:

  1. Copy your .ttf file into the same directory as your .lyx file.
    (As an example, let's assume the font file is Custom-Font-File.ttf.)
  2. Go to Document > Settings... > Fonts and enable the Use non-TeX fonts checkbox.
  3. Still in the document settings, click LaTeX Preamble on the left and add the line:
    (replacing customfontname and Custom-Font-File with your own values, of course).
  4. Put the cursor directly in front of your main title and choose
    Insert > TeX code (or press Ctrl+L).
    Enter \customfontname  into the box that appears.

    Important: There must be a blank at the end! Otherwise you'll get an error. You can type the blank while still inside the red TeX code box, or you can put it behind the box.

That's it. LyX/MiKTeX installed all necessary packages by itself, so I didn't have to do anything else.

  • 1
    Excellent. You probably also had to check "Use non-TeX fonts" in the document preferences, had you not? Also, is step 4. really necessary? – G.M. Oct 12 '16 at 8:17
  • Thanks, you're right about both things: You have to "Use non-TeX fonts", and it seems you don't have to use \rmfamily . I'll edit that. :) – Ginchen Oct 12 '16 at 13:07

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.