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 have text with some non-ascii characters in chapters, sections... which I'd like to see in bookmarks displayed correctly. I noticed that,

  • If I run xelatex, everything is fine, no need to set \hypersetup{unicode=true} to get this working
  • If I run lualatex, I have these issues:

    1. If unicode=false, then bookmarks containing non-ascii characters have strange unreadable symbols instead of those chars, but everything else is fine

    2. If unicode=true, then bookmarks are just fine, but page numbers in resulting PDF file are garbled in Adobe Reader 9 on Linux (and Okular shows some strange symbols in bookmark pane too)

Is it a driver issue? Any suggestion how to overcome this problem?

Here's a MWE:

\documentclass{article}    
\usepackage{hyperref} 
%\hypersetup{unicode=true}

\begin{document}  

\section{Test 1 čćžđš}    
Some text.\clearpage  

\section{Test 2 šđžćč}    
Some text.

\end{document}

A notice: I tried to post this question on comp.text.tex earlier, but something went wrong and it didn't show up. Anyway, if the post shows up later, I'll post the link here.

share|improve this question
    
it is on c.t.t. –  Herbert Jul 29 '11 at 19:42
    
I can't find it :( –  Meho R. Jul 29 '11 at 21:35
    
the answer from Heiko is also there –  Herbert Jul 29 '11 at 21:36
1  
Is there a link? And if you're referring to this post (groups.google.com/group/comp.text.tex/browse_thread/thread/…), no, there is no answer which solves this issue. –  Meho R. Jul 29 '11 at 22:55
    
@Meho: yes, it would be great if you would post that as answer and accept it. –  Stefan Kottwitz Aug 20 '11 at 14:28

2 Answers 2

up vote 8 down vote accepted

I received an email from Heiko suggesting that I try auto pdfencoding which worked indeed. So, the solution is:

\hypersetup{pdfencoding=auto}

And corrected MWE from above:

\documentclass{article}    
\usepackage{hyperref} 
\hypersetup{%
    pdfencoding=auto,
    pdfauthor={Author Test ČĆŽĐŠ},
    pdftitle={Title test, čćžđš}
    }

\begin{document}  

\section{Test 1 čćžđš}    
Some text.\clearpage  

\section{Test 2 šđžćč}    
Some text.

\end{document}

Complete Heiko's answer can be found on comp.text.tex.

share|improve this answer

Even with pdfencoding=auto, I had trouble with either the bookmarks or the metadata or the page numbers. But all three come out perfectly if I use the navigator package rather than hyperref.

share|improve this answer
2  
Yes, I noticed that metadata gets messed up sometimes. The solution might be to use \hypersetup locally, that is, e.g., \hypersetup{pdfencoding=utf8} before specifying author name, title and other metadata stuff, then \hypersetup{pdfencoding=auto} after that, to get bookmarks and numbers displayed correctly. –  Meho R. Oct 28 '11 at 0:46
1  
This solution breaks my metadata. Putting pdfencoding=auto on first place in the package option (\usepackage[pdfencoding=auto]{hyperref}) does everything right. Is that kind of a bug in hyperref? Shouldn't "auto" be default? –  LaRiFaRi Jul 19 '13 at 13:48

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.