[XeTeX] Fontspec question

Will Robertson wspr81 at gmail.com
Tue Jan 8 06:22:24 CET 2008


Hi David,

On Jan 8, 2008 8:06 AM, David Denton <ddenton at lino.com> wrote:
> My main font is established as follows:
> \setmainfont[Mapping=tex-text]{LMRoman12}

This shouldn't be necessary -- Latin Modern is chosen by default by
fontspec anyway :)

> But how can I easily switch back and forth between the main font and the
> alternate font without having to redefine the main font each time.

You want to do something like this:
  some words {\otherfont alternate font} more words

If you would be prefer a more direct command, you can do
  \newcommand\alt[#1]{{\otherfont #1}}
and then write
  some words \alt{alternate font} more words

(By the way, \cr is probably a bad choice because it's a TeX
primitive. I'm surprised that fontspec doesn't check for that... I
should revisit that code sometime.)

Hope this helps,
Will


More information about the XeTeX mailing list