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 am writing a document using LaTeX and generating PDF. Can anybody tell me how I can generate the PDF metadata, e.g. author or title, from LaTeX? On Windows XP, I am using MikTex's texify to generate the PDF. On linux, I am using pdflatex to generate the PDF. Any answers for either platform would be much appreciated!

share|improve this question

migrated from stackoverflow.com Aug 25 '11 at 17:06

This question came from our site for professional and enthusiast programmers.

3 Answers 3

up vote 37 down vote accepted

Use the hyperref package, included in pretty much every latex distribution these days.

\usepackage[pdftex,
            pdfauthor={Your Name},
            pdftitle={The Title},
            pdfsubject={The Subject},
            pdfkeywords={Some Keywords},
            pdfproducer={Latex with hyperref, or other system},
            pdfcreator={pdflatex, or other tool}]{hyperref}
share|improve this answer
1  
it might be worth adding a note that this is the better answer, especially if using Xe[La]TeX –  Brent.Longborough Aug 25 '11 at 23:38
2  
What's the difference between pdfproducer and pdfcreator? –  lpdbw Aug 10 '12 at 9:59
    
What's the difference between your two solutions? @Brent.Longborough why this solution is better? –  Red Jun 24 '13 at 15:33
    
@red The other one's in an alien format; one more piece of (IMO) unnecessary brain overload. –  Brent.Longborough Jun 25 '13 at 15:38

Use the \pdfinfo macro, where the contents are given in PDF notation:

\pdfinfo{
   /Author (Nicola Talbot)
   /Title  (Creating a PDF document using PDFLaTeX)
   /CreationDate (D:20040502195600)
   /Subject (PDFLaTeX)
   /Keywords (PDF;LaTeX)
}

(Source: http://theoval.cmp.uea.ac.uk/~nlct/latex/pdfdoc/pdfdoc/pdfdoc.html)

share|improve this answer
    
Wow, that's even more ugly than TeX :P –  naught101 Sep 6 '12 at 6:07

You explicitly asked for generating the metadata from LaTeX, and using one of the answers of Ken Bloom seems the right way for me.

For the case that you want to add metadata to a file not created with LaTex (or an existing pdf you do not want to recompile) I just wanted to point you to http://www.bureausoft.com/products.html#PDF%20Info%20%28Freeware%29 which is a free Windows programme to change the pdf metadata. (I do not recommend this instead of the pdfLaTeX way!)

share|improve this answer

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.