[texworks] PDF ToC doesn't show correct unicode characters on Linux

Johannes Knaus knauslists at freenet.de
Wed Oct 19 15:15:50 CEST 2011


Am 18.10.2011 um 16:19 schrieb Herbert Schulz:

> 
> On Oct 18, 2011, at 7:11 AM, Johannes Knaus wrote:
> 
>> Hi,
>> 
>> When I'm compiling a PDF on my Ubuntu (11.04, now 11.10 but the problem persists) netbook with TeXworks, ToC-entries (i.e. sections and chapter titles) that contain special characters don't appear correctly, instead a number of chinese (or japanese?) glyphs appear where for example an é or ß should appear.
>> 
>> Strangely, this only happens with TeXworks on Ubuntu while the PDF-ToC appears correctly when I typeset the document on my Mac.
>> 
>> I compile with the following command:
>> 
>> Command: 
>> latexmk
>> Arguments: 
>> -e
>> $pdflatex=q/xelatex -synctex=1 %O %S/
>> -pdf
>> $fullname
>> 
>> Is this a known bug in the Linux-Version of TeXworks (xelatex related?)?
>> Are there any possible workarounds?
>> 
>> Thanks for your help.
>> Johannes
> 
> Howdy,
> 
> Are you sure the file is UTF-8 Unicode on that system?
> 
> Good Luck,
> 
> Herb Schulz
> (herbs at wideopenwest dot com)
> 
> 
> 
> 

Hello again,

Well, I solved it but I don't know how and why. ;-)
As regards encoding, yes the file is UTF-8 on both systems.
I found out by try and error, that the relevant thing is tweaking the hyperref option [unicode=true|false].

What happened (a friend of mine was looking on the screen when I did that, so I have a witness):

1. I first created a dummy xelatex document (scrbook, hyperref, polyglossia) with \usepackage[unicode=true, bookmarks=true]{hyperref}. Two chapters in it. Both chapter headings contained é and ß.
2. The output showed incorrect characters (an A with a bar on top for both characters) in the PDF-ToC.
3. I changed the option to unicode=false and recompiled.
4. The output showed the correct characters.

So I thought this would be the solution. 
1. I opened the xelatex document that I originally worked on and changed the option to unicode=false.
2. Nothing changed in the output. Still those chinese glyphs appear instead of é and ß in the PDF-ToC (BTW all the problems pertain to the ToC that you can make visible in the sidebar of most PDF-viewers, not to the document itself (or the table of contents therein) -- these are set correctly anyway).
3. So I changed the option back to unicode=true again and recompiled.
4. TaDa!! The output showed the correct characters.

I really don't believe that computers have a life on their own, but still… 
Do you have any explanation for that? 

Greetings,
Johannes




More information about the texworks mailing list