LaTeX forum ⇒ XeTeXXeTeX + LyX + OpenType fonts

Information and discussion about XeTeX, an alternative for pdfTeX based on e-Tex
noranazmy
Posts: 4
Joined: Tue May 18, 2010 8:18 pm

XeTeX + LyX + OpenType fonts

Postby noranazmy » Wed May 19, 2010 12:44 pm

Hello,

I'm writing my masters thesis on LyX, using XeTeX for TeXLive, on Ubuntu.
For the first time I'd like to use my own fonts, which are OpenType fonts from Adobe. They are already installed on my system and in texmf. I have two problems.

(1) I configured LyX for XeTeX and it works if I don't use any custom fonts. When I try to include
  1. \fontspec{Chaparral Pro}
to use the custom font, I get an error. I realized this is because LyX adds the line
  1. \usepackage[T1]{fontenc}
.. There is no way I can get this line to be removed. I tried to put OT1 in there too and it still didn't work.

(2) When I remove this line manually and run XeTeX also manually, I get no errors and the PDF file appears with my custom font, but not for headings. When there is text that is not regular (e.g. bold or italic), XeTeX gives errors.

I'd like to get LyX to remove the fontenc line, or work my way around this. But more importantly, I would like to know how to apply the font to all headings, and also include bold, italic and smallcaps.

Appreciate your help,

User avatar
meho_r
Posts: 823
Joined: Tue Aug 07, 2007 5:28 pm

Postby meho_r » Thu May 20, 2010 1:16 pm

noranazmy wrote:...

(1) I configured LyX for XeTeX and it works if I don't use any custom fonts. When I try to include
  1. \fontspec{Chaparral Pro}
to use the custom font, I get an error. I realized this is because LyX adds the line
  1. \usepackage[T1]{fontenc}
.. There is no way I can get this line to be removed. I tried to put OT1 in there too and it still didn't work...

Since there is no MWE I guess you haven't configured it properly. Check your settings again comparing to the quick guide I've written some time ago (and which is compiled today with LyX and XeLaTeX so you may be sure it works. Both the source file and the PDF output are attached to this post).

EDIT: links removed and files uploaded directly here.
Attachments
XeLaTeX_and_LyX.zip
A quick guide to setting up XeLaTeX in LyX
(24.48 KiB) Downloaded 409 times
Last edited by meho_r on Thu May 20, 2010 7:11 pm, edited 2 times in total.

noranazmy
Posts: 4
Joined: Tue May 18, 2010 8:18 pm

Postby noranazmy » Thu May 20, 2010 3:27 pm

meho_r wrote:
noranazmy wrote:...

(1) I configured LyX for XeTeX and it works if I don't use any custom fonts. When I try to include
  1. \fontspec{Chaparral Pro}
to use the custom font, I get an error. I realized this is because LyX adds the line
  1. \usepackage[T1]{fontenc}
.. There is no way I can get this line to be removed. I tried to put OT1 in there too and it still didn't work...

Since there is no MWE I guess you haven't configured it properly. Check your settings again comparing to this quick guide I've written some time ago (and which is compiled today with LyX and XeLaTeX so you may be sure it works. Here is the source file).


Thanks so much. I reviewed the steps again and found a mistake. When I reconfigured it I still had a problem, but I discovered that's because of the font itself (I had to put extra options for fontspec to point out the italic variant). I also find the part about adding buttons to LyX very helpful! It wasn't in the original guide I read online. Thanks.


Return to “XeTeX”

Who is online

Users browsing this forum: No registered users and 1 guest