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'm trying to make pdflatex display non-ascii (cyrillic) characters in PDF metadata using hyperref's pdftitle and pdfauthor options. Here is my document:

\documentclass{article}

\usepackage[russian]{babel}
\usepackage[utf8]{inputenc}
% \usepackage[T2A]{fontenc} % if uncomment, pdf search stops working
\usepackage{longtable}
\usepackage{fancyhdr, doc, textcomp}
\usepackage{ifpdf}
\usepackage{cmap} % to activate pdf search

\usepackage{hyperref}
\hypersetup {
    pdftitle={Название документа},
    pdfauthor={Автор документа},
}

\begin{document}
Hello, world! Привет, мир!
\end{document}

This does not work, cyrillic characters are just omitted. If I replace \usepackage{hyperref} to \usepackage[unicode]{hyperref}, it starts working as expected. But what surprised me is that if I set unicode=true option in \hypersetup (and remove unicode from \usepackage[unicode]{hyperref}), it does not work. Is it a bug or am I missing something?

share|improve this question
1  
Some hyperref options only have effect in the \usepackage command, see the hyperref manual. Could this be the case? –  Andrey Vihrov Oct 31 '12 at 20:04
    
Perhaps my answer if off the mark as you already mentioned that with the unicode option it worked. Some years ago, even with a TeX source in iso-latin-1, in order to get the Latin letters such as éèùç to appear in the pdf info, I had to use pdfencoding=pdfdoc as option to hyperref so all my files have it. Much to my surprise through testing I discover tonight that it is not necessary after all for latin1 encode input to say anything to hyperref, so indeed I wonder why one would have to for utf8. –  jfbu Oct 31 '12 at 20:31
    
I think I should withdraw my answer as you had already found that passing some option to hyperref in the package loading solved the problem. Indeed it is surprising that cyrillic letters disappear whereas letters such as éèù, etc.. make their way (without any need for an option - much to my surprise!) into the info fields of the pdf. –  jfbu Oct 31 '12 at 20:58
add comment

1 Answer 1

Add pdfencoding=unicode to the loading of hyperref

\documentclass{article}

\usepackage[russian]{babel}
\usepackage[utf8]{inputenc}
% \usepackage[T2A]{fontenc} % if uncomment, pdf search stops working
\usepackage{longtable}


\usepackage{fancyhdr, doc, textcomp}
\usepackage{ifpdf}
\usepackage{cmap} % to activate pdf search

\usepackage[pdfencoding=unicode]{hyperref}
\hypersetup {
    pdftitle={Название документа},%
    pdfauthor={Автор документа},%
}

\begin{document}
Hello, world! Привет, мир!
\end{document}
share|improve this answer
    
Thanks for the answer. I don't think you should withdraw it, though it resembles the solution I've found. I asked the question to share the solution and to learn why this is happening. BTW, I wonder what is the difference between pdfencoding=unicode and unicode options? –  Denis Golomazov Nov 1 '12 at 19:44
    
I am unable to fing pdfencoding=unicode or even pdfencoding documented in the hyperref documentation. I am just too old I guess... and use deprecated things. Perhaps hyperref salvaged my ignorant manners and decided to just do as if I had said unicode... –  jfbu Nov 1 '12 at 20:47
add comment

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.