[XeTeX] fontspec and hyperref

Ross Moore ross at ics.mq.edu.au
Thu Sep 24 01:43:07 CEST 2009

Hi Michael,

On 24/09/2009, at 9:26 AM, Michiel Kamermans wrote:

> Fr. Michael Gilmary wrote:
>> It looks like a problem with using the \section command with  
>> \fontspec inside while using hyperref --- judging from the input  
>> lines referred to in the warning above.
>> I don't think the \section command likes the ruby stack stuff  
>> you've got in there. I'm sure there's a work-around, though. But  
>> I've got to run ....
> Actually, the ruby commands are deemed safe; if I remove the  
> fontspec commands, all is well and the document compiles without  
> any warnings outside of underfull/overfull hbox notices (although  
> of course the japanese will show up as "I do not know this  
> character" glyphs in the final pdf).
> Oddly enough though, if I remove the fontspec commands from the  
> \section commands, but leave the rest in, I'm still left with the  
> hyperref error on line 86, which doesn't even have anything  
> bookmarkable =/

All of your \ruby commands are fragile,
so at the very least you'll need to use  \DeclareRobustCommand
with these, if you want to use them within section-titles.

To do sensible things with bookmarks, you'll also need
to make use of  \pdfstringdefDisableCommands .

Once you've mastered those, you'll be flying.

> - Mike

Hope this helps,


Ross Moore                                       ross at maths.mq.edu.au
Mathematics Department                           office: E7A-419
Macquarie University                             tel: +61 (0)2 9850 8955
Sydney, Australia  2109                          fax: +61 (0)2 9850 8114

More information about the XeTeX mailing list