# Custom title font in LyX

(My first problem of compiling at all is solved, so I'm now posing a slightly different question).

Hi, I'd like some help with producing handouts for my students. I'm using LyX as I'm far from fluent in LaTeX. I find the default fonts very serious, and would prefer to use something unusual on the title and footer, to make the document a little friendlier. I followed these instructions for installing XeTeX: http://wiki.lyx.org/LyX/XeTeX, and for changing the fonts manually with fontspec in ERT. I checked that the installation is fine: if I don't use any fontspec commands, it doesn't compile within LyX but does work if I use the command line. But when I try it with the fontspec, I don't get a PDF.

My LyX file: http://math.stanford.edu/~amyp/test2.lyx

The .tex file that LyX generated: http://math.stanford.edu/~amyp/test2.tex

The font I tried here is located at C:\Windows\Fonts\PRISTINA.TTF on my computer, Windows tells me it's an Open Type font. I'm not too particular about the font (just that it's non-standard and readable).

-
You can select your code here and hit Ctrl-K (or the fifth button from the left in the edit box) so that it is formatted as code, which would be more readable. Makes it easier for others to read your code and see what's wrong. – ShreevatsaR Aug 5 '10 at 2:43
I've edited the post to do this – Joseph Wright Aug 5 '10 at 5:23
thanks ShreevatsaR and Joseph! My first time here, so I didn't know how to format. – Amy Pang Aug 5 '10 at 5:34
The code compiles fine with xelatex for me. – kennytm Aug 5 '10 at 10:48
Amy, to try to isolate your problem, could you try to compile this code with xelatex from the command line and see if it works for you? This way you can find if the problem is with LyX or your compile engines. – Juan A. Navarro Aug 5 '10 at 11:48

It sounds like LyX is not running XeTeX at all. Here’s a simple way to check it: run the following document in Lyx

\documentclass{minimal}

\usepackage{ifxetex}

\begin{document}

\ifxetex{I'm running XeTeX}\else{I'm \textbf{not} running XeTeX}\fi

\end{document}


and see if the output file contains “I’m running XeTeX” or “I’m not running XeTeX”. In the latter case, you should go again through the instructions to set up LyX to use XeTeX and not pdfTeX (or whatever it’s using); I can’t really help you there, as I’ve never used LyX.

Also, if you’re going to use XeTeX and fontspec and use system fonts, you should absolutely not use the fontenc package. It’s not compatible with XeTeX. The line above it in your code (\renewcommand{\familydefault}{\rmdefault}) may also cause problems, and interacts anyway with what fontspec does, so you’re better off deleting it.

-
Thanks for helping me. I followed your instructions and the output said "I'm running XeTeX". I'm trying to find out how to remove fontspec, because LyX writes that automatically. – Amy Pang Aug 5 '10 at 20:00
OK, that's one step. Can you then please post the extract of the log with the exact error message (the one with \RequireXeTeX)? It's best to edit you original message in that case. – Arthur Reutenauer Aug 5 '10 at 20:08
I compile using LyX, so it gives me dialog boxes instead of a log. The only clue about \RequireXeTeX it gives me is that "This error message was generated by an \errmessage command". I also tried compiling with the command line, and I posted the start of the resulting .txt file in a comment on my question. I'll upload the entire log tomorrow. – Amy Pang Aug 6 '10 at 2:07
Arthur, one more thing: I came across this: latex-community.org/forum/… and followed the instructions in the second post to make a converter from plain LaTeX to xelatex, then when I compile, I don't get any error messages, but I don't get output either. – Amy Pang Aug 6 '10 at 2:10
We can’t make much out of the error LyX reports, as you may guess. Do upload the entire log file when you’re able to, it should contain helpful information. – Arthur Reutenauer Aug 6 '10 at 2:55