Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I once read about an option for hyperref that automatically takes the info provided via the standard \author and \title, and puts it into the pdfinfo. Now I want to implement it in my template and can't find it anywhere in the hyperref manual nor anywhere else.

Did I dream about this or can someone help me out here?

(A similar, but more general question: Is hyperref really the best way to add metadata to a TeX file?)

share|improve this question

2 Answers 2

up vote 32 down vote accepted

The option is pdfusetitle. It is described in the hyperref README file.

share|improve this answer
4  
Ah, that's where I saw it, thanks! For some reason it only seems to work as \usepackage[pdfusetitle]{hyperref} and not as \hypersetup{pdfusetitle} though. –  doncherry May 2 '11 at 22:11
    
@doncherry: Yeah, a few options are like that. I suppose they require special arrangements to be made at load time... –  SamB May 3 '11 at 3:58
5  
As of April 2012, this option is not described in the hyperref manual. Any reason for that? –  Olivier Jul 7 '12 at 10:13

You could also use

 \makeatletter
 \hypersetup{pdftitle={\@title},pdfauthor={\@author}}
 \makeatother

(edit: makeat* pointed out by Joseph Wright)

share|improve this answer
4  
This needs \makeatletter, of course. –  Joseph Wright May 3 '11 at 11:27
    
This might be a nice alternative if pdfusetitle fails -- the readme says it "tries to derive the values", so a failure for whatever reason apparently can't be excluded. –  doncherry May 3 '11 at 15:18
    
@Joseph: Would \makeatletter be called before (and \makeatother after) \hypersetup{...} or separately for each argument? Considering that I have up to nine or ten arguments for \hypersetup and considering how mighty and thus dangerous hyperref is, it might cause conflicts if placed around the entire command? –  doncherry May 3 '11 at 15:23
    
@doncherry: \makeatletter before \hypersetup and \makeatother after it. –  Joseph Wright May 3 '11 at 15:37

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.