[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
XeTeX PDF outline support
From: |
Masamichi HOSODA |
Subject: |
XeTeX PDF outline support |
Date: |
Wed, 03 Feb 2016 23:03:58 +0900 (JST) |
I've made XeTeX PDF outline support patch.
ChangeLog:
Add PDF outline support for XeTeX
2016-02-XX Masamichi Hosoda <address@hidden>
* doc/texinfo.tex:
Add PDF outline support for XeTeX.
(\pdfdest): set destination.
(\pdfmkdest): set destination.
(\dopdfoutline): make outline element.
(\pdfmakeoutlines): make PDF outline.
--- texinfo.tex.org 2016-02-03 22:33:14.500957900 +0900
+++ texinfo.tex 2016-02-03 22:45:51.999474500 +0900
@@ -1450,6 +1450,65 @@
\fi % \ifx\pdfoutput
%
+% PDF outline support for XeTeX
+%
+\ifx\XeTeXrevision\thisisundefined
+\else
+ \pdfmakepagedesttrue \relax
+ \def\pdfdest name#1 xyz{%
+ \special{pdf:dest (name#1) address@hidden /XYZ @xpos @ypos]}%
+ }
+ \def\pdfmkdest#1{%
+ \special{pdf:dest (name#1) address@hidden /XYZ @xpos @ypos]}%
+ }
+ %
+ \def\dopdfoutline#1#2#3#4{%
+ \edef\pdfoutlinedest{#3}%
+ \ifx\pdfoutlinedest\empty
+ \def\pdfoutlinedest{#4}%
+ \fi
+ %
+ \edef\pdfoutlinetext{#1}%
+ %
+ \special{pdf:out [-] #2 << /Title (#1) /A << /S /GoTo /D
(name\pdfoutlinedest) >> >> }%
+ }
+ %
+ \def\pdfmakeoutlines{%
+ \begingroup
+ \def\partentry##1##2##3##4{}% ignore parts in the outlines
+ \def\numchapentry##1##2##3##4{%
+ \dopdfoutline{##1}{1}{##3}{##4}}%
+ \def\numsecentry##1##2##3##4{%
+ \dopdfoutline{##1}{2}{##3}{##4}}%
+ \def\numsubsecentry##1##2##3##4{%
+ \dopdfoutline{##1}{3}{##3}{##4}}%
+ \def\numsubsubsecentry##1##2##3##4{%
+ \dopdfoutline{##1}{4}{##3}{##4}}%
+ %
+ \def\appentry{\numchapentry}%
+ \def\appsecentry{\numsecentry}%
+ \def\appsubsecentry{\numsubsecentry}%
+ \def\appsubsubsecentry{\numsubsubsecentry}%
+ \def\unnchapentry{\numchapentry}%
+ \def\unnsecentry{\numsecentry}%
+ \def\unnsubsecentry{\numsubsecentry}%
+ \def\unnsubsubsecentry{\numsubsubsecentry}%
+ %
+ \indexnofonts
+ \setupdatafile
+ %
+ \def\{{\lbracecharliteral}%
+ \def\}{\rbracecharliteral}%
+ \catcode`\\=\active \otherbackslash
+ \input \tocreadfilename
+ \endgroup
+ }
+
+ \special{pdf:docview << /PageMode /UseOutlines >> }
+ \special{pdf:tounicode UTF8-UTF16 }
+\fi
+
+%
% @image support for XeTeX
%
\newif\ifxeteximgpdf
\input texinfo.tex @c -*- coding: utf-8 -*-
@documentencoding UTF-8
@contents
@node node-fur
@chapter für
für
@node node-hello1
@section hello1
@node node-world1
@subsection world1
@node node-world2
@subsubsection world2
† ‡ § ¶
@node node-hello2
@section hello2
foobar
@node node-chapter2
@chapter chapter2
@node node-chapter2section
@section chapter2section
barbaz
@bye
Re: XeTeX @image support, Gavin Smith, 2016/02/05