bug-texinfo
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: PDF destination names for pdfTeX and LuaTeX


From: Masamichi Hosoda
Subject: Re: PDF destination names for pdfTeX and LuaTeX
Date: Fri, 05 Aug 2016 22:15:46 +0900 (JST)

> Yes, I'm happy for you to commit it. I couldn't find any problems with
> the testing I did with pdftex. Specifically, the problems I reported
> at http://lists.gnu.org/archive/html/help-texinfo/2016-06/msg00014.html
> didn't reappear.

I've committed it.
Thank you.

> However, I don't understand the change or it's purpose. Can you help
> me to understand it by giving an example of the problem this change is
> supposed to fix?

My patch mainly fixed a LuaTeX problem.
LuaTeX and pdfTeX use the same code for PDF destination names and outlines.
So I rewrote the code considering encodings and both TeX engines.

My PDF destination sample sources are attached to this mail.
You can generate sample PDFs by `generatepdfs.sh'.
My environment is TeX Live 2016.

Without my patch:
(texinfo.tex ver. 2016-08-04.15, svn rev. 7303)

  luatex/aaa-latin15.pdf
  'Euro sign' in PDF outline's text is broken.

With my patch:
http://lists.gnu.org/archive/html/bug-texinfo/2016-08/msg00002.html

  luatex/aaa-latin15.pdf
  The PDF outline's text is fixed.

> If I understand correctly, the destname is just used internally for
> cross-references within a PDF file, and it doesn't really matter
> what's in it, as long as it is unique.

Most destination names are used internally.
But, it can be used for remote links (between PDFs links).
aaa.pdf and bbb.pdf in my samples use the remote links like the following.

  See Section "foo" in bar

Moreover, most web browser can handle remote links like the following.

  http://example.com/bar.pdf#nameddest=foo

But, there is a remaining problem.

mix/aaa.pdf (generated by XeTeX)
mix/bbb.pdf (generated by LuaTeX)

Some remote links do not work fine.
Between XeTeX and LuaTeX, we use different encodings for PDF destination names.
I'd like to use UTF-8 destination names for consistency with XeTeX and LuaTeX.
I'll make a patch.

> I wonder if it's possible to put the code for getting the "destination
> name" in a macro (a \def) so that it can be used when outputting a
> target (e.g. @node) and when referring to a target (e.g. @xref or the
> PDF sidebar). That could simplify the code and reduce duplication.

Sounds good.

> This part of the patch looks confusing:
> 
> +     \iftxiuseunicodedestname
> +       \ifx \declaredencoding \latone
> +         % Pass through Latin-1 characters.
> +       \else
> 
> If we're using Unicode, then how can we be using Latin-1 at the same time?

LuaTeX with byte wise I/O converts Latin-1 characters to Unicode.
I've added some comments.

Attachment: samplepdfs.tar.gz
Description: Binary data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]