[XeTeX] How to enable hyperlinks with hyperref

Wilfred van Rooijen wvanrooijen at yahoo.com
Mon Nov 23 03:07:00 CET 2009


Hi,
 
> \documentclass[12pt,draft]{article}
> 
> \usepackage[canadien,english]{babel}
> 
> \usepackage[letterpaper,margin=2.5cm,headheight=15pt]{geometry}
> 
> \usepackage{fancyhdr}
> 
> \usepackage[fixlanguage]{babelbib}
> 
> \usepackage{hyperref}
> 

As a tip for future reference, you can also use the memoir class with the option [article]. This will generate a document which looks very similar to the standard article class. The advantage of using memoir is that many things for which you are currently using a package are built into the class, so geometry and fancyhdr for example are not required.
> 
> \renewcommand{\baselinestretch}{1.5}
> 

The memoir class also allows various line-spacings in the document. As discussed in the memoir manual (file called memman.pdf on your computer), manually fiddling around with the various parameters that govern line spacing may give strange results.

> 
> After 2 hours trying to find what was not right with my
> code... It turns out that the hyperref cannot generate links
> when my document is in draft mode. Changing
> \documentclass[12pt,draft]{article} to
> \documentclass[12pt]{article} allowed XeTeX to generate
> the hyperlinks.
> 
> 
> 
> I'll remember it for a long time. May the draft mode be
> damn. Wouldn't this be a bug? I haven't entirely
> RTFM, but it seems a bit weird to me.

No it's not a bug. I think it is in fact mentioned in the hyperref manual. Basically, if the draft option is given, hyperref does not do anything. 

The draft option is very practical. For example, you can use it to automatically include a message in each page header that the document is a draft. Another example, the package showkeys allows one to show the \label of any element in the output (PDF) file. This makes it very easy to find back the label of an equation, for instance. If the draft option is on, showkeys will put the labels, but when you switch to final, the keys are automatically turned off.

In draft mode, your latex document will show little black boxes for each element that is 
uch easier to spot than going through the logfile hunting for "overfull \hbox" messages. Also note that in draft mode, any figures will not show in the text, but only their bounding box. If you use for instance a very large, high resolution bitmap in the document, the file size will be small in draft mode, and everything will work much quicker.

Cheers,
Wilfred


      New Email names for you! 
Get the Email name you've always wanted on the new @ymail and @rocketmail. 
Hurry before someone else does!
http://mail.promotions.yahoo.com/newdomains/aa/


More information about the XeTeX mailing list