[OS X TeX] Intermingling fonts using Fontspec
Signups
signups at norvelle.org
Sun Feb 18 18:57:32 CET 2007
Thanks to Jonathan and Ross,
I've implemented your suggestions, and they work excellently.
Apropos of this issue, I'm wondering if there's a good online LaTeX
command reference, where I might be able to look up these kinds of
commands instead of pestering folks on this list. I've got "A Not So
Short Introduction" and a number of individual package manuals, but I
haven't found anything that provides a more complete reference. In
particular, which describes how to create new commands (including the
difference between single and double curly braces, and \newcommand and
\DeclareRobustCommand)
Thanks again for your help!
Erik Norvelle
Ross Moore wrote:
> Hi Jonathan, and Erik,
>
> On 18/02/2007, at 6:48 AM, Jonathan Kew wrote:
>
>> On 17 Feb 2007, at 7:18 pm, Signups wrote:
>>
>>> Greetings,
>>>
>>> I've just figured out the answer to my own question. If I define
>>> the command \gk{} as follows,
>>>
>>> \newcommand{\gk}[1]{\fontspec{Porson}#1\rmfamily}
>>>
>>> things turn out much better.
>>
>> I think a better answer is probably:
>>
>> \newcommand{\gk}[1]{{\fontspec{Porson}#1}}
>>
>> (Note the extra set of braces.)
>>
>> Better still, if you're doing this often, I believe you could say:
>>
>> \newfontfamily{\porson}{Porson}
>> \newcommand{\gk}[1]{{\porson #1}}
>
> Even better is to have a robust markup command, as follows:
>
> \newfontfamily{\porson}{Porson}
> \DeclareRobustCommand{\grk}[1]{{\porson #1}}
>
> This means that if you use \grk within titles and headings,
> then you do not freeze the size and style into the Table of Contents,
> or otherwise upset Bookmarks listings.
> Similarly for figure & table captions, and any other special features
> that you might be using, which require writing information into
> auxiliary files.
>
> When such information is re-read for placing onto the PDF page,
> you can locally adjust the expansion of \grk to suit the actual
> situation.
>
>>
>> This saves fontspec having to re-evaluate the font name every time,
>> so it is more efficient.
>>
>> JK
>>
>
> Hope this helps,
>
> Ross
>
>
> ------------------------- Helpful Info -------------------------
> Mac-TeX Website: http://www.esm.psu.edu/mac-tex/
> TeX FAQ: http://www.tex.ac.uk/faq
> List Archive: http://tug.org/pipermail/macostex-archives/
> List Reminders & Etiquette: http://www.esm.psu.edu/mac-tex/list/
>
>
>
>
------------------------- Helpful Info -------------------------
Mac-TeX Website: http://www.esm.psu.edu/mac-tex/
TeX FAQ: http://www.tex.ac.uk/faq
List Archive: http://tug.org/pipermail/macostex-archives/
List Reminders & Etiquette: http://www.esm.psu.edu/mac-tex/list/
More information about the macostex-archives
mailing list