[XeTeX] italics / SeriaPro
Jonathan Kew
jonathan_kew at sil.org
Sun Oct 14 23:32:14 CEST 2007
On 13 Oct 2007, at 9:20 pm, uclhwis at ucl.ac.uk wrote:
> Hi, I finally succeeded in getting the italics of SeriaPro
> (=OpenType) in
> XeLaTeX's output. However, it only works with the (I thought obsolete)
> command {\it italics}. It does not work with \textit{italics}. I do
> not
> quite understand that. Is it possible that I am overlooking something?
>
> Willem
It looks to me like the preamble here shows some confusion and
redundancy....
> ____________
> %&program=xelatex
> %&encoding=UTF-8 Unicode
> \documentclass[twoside,executivepaper,openright]{book}
> \usepackage{array}
> \usepackage{epsf}
> \usepackage{float}
> \usepackage{afterpage}
> \usepackage{fontspec}
> \usepackage{xunicode}
> \usepackage{xkeyval} %required by fontspec
> \usepackage{calc} %required by fontspec
These should get loaded automatically by fontspec, though including
them explicitly like this ought to be harmless.
> \usepackage{xltxtra} %fixes for XeTeX/fontspec
> \fontspec[Italic={SeriaPro-Italic}]{SeriaPro} %xetex seems to require
> {\it } rather than \textit{}
The \fontspec command is for one-off font changes within the
document, it's not really suitable for use in the preamble like this.
> \setromanfont[ItalicFont=SeriaPro-Italic]{SeriaPro}
OK, this should configure LaTeX to use SeraiPro as the default Roman
font, with the proper italics (even if fontspec can't find the italic
face automatically). If you ended the preamble here, I believe you'd
be in good shape...
> \usepackage{pstricks}
>
> \font\rm="SeriaPro" at 14pt\rm
> \font\it="SeriaPro-Italic" at 14pt\rm
These are "primitive" TeX font definitions for a fixed face at a
fixed size; this doesn't belong in a typical LaTeX document (though I
guess the \font\it=... declaration here is what's making \it appear
to work for you). Note that with this, \it will always produce a
fixed size, regardless of the environment where you use it (e.g.,
headings, footnotes, etc). This is not usually what you want.
> \font\textit="SeriaPro-Italic" at 14pt\rm
This similarly defines \textit as a fixed-size italic face, but I
suspect it gets overridden by the next thing....
> \setmainfont[Mapping=tex-text]{SeriaPro}
\setmainfont is a synonym for \setromanfont, so this overrides the
earlier \setromanfont definition, as well as (I assume) the \textit
definition above. So your document will end up defaulting to
SeriaPro, but apparently fontspec can't automatically find the italic
face, and this time you didn't specify it explicitly.
So to sum up, you should remove all the primitive \font\xx=
commands shown here, and remove this duplicate command, and then I
think you'll have better success.
HTH,
JK
> \begin{document}
>
>
> _______________________________________________
> XeTeX mailing list
> postmaster at tug.org
> http://tug.org/mailman/listinfo/xetex
More information about the XeTeX
mailing list