[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[7308] pdfTeX and LuaTeX PDF destination name
From: |
trueroad |
Subject: |
[7308] pdfTeX and LuaTeX PDF destination name |
Date: |
Mon, 8 Aug 2016 23:10:43 +0000 (UTC) |
Revision: 7308
http://svn.sv.gnu.org/viewvc/?view=rev&root=texinfo&revision=7308
Author: trueroad
Date: 2016-08-08 23:10:43 +0000 (Mon, 08 Aug 2016)
Log Message:
-----------
pdfTeX and LuaTeX PDF destination name
Modified Paths:
--------------
trunk/ChangeLog
trunk/doc/texinfo.tex
Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog 2016-08-07 15:22:35 UTC (rev 7307)
+++ trunk/ChangeLog 2016-08-08 23:10:43 UTC (rev 7308)
@@ -1,3 +1,15 @@
+2016-08-08 Masamichi Hosoda <address@hidden>
+
+ * doc/texinfo.tex (\setpdfdestname): New macro for pdfTeX and LuaTeX.
+ (\pdfdestname): Escaped PDF destination name
+ is set by \setpdfdestname.
+ (\setpdfoutlinetext): New macro for pdfTeX and LuaTeX.
+ (\pdfoutlinetext): Converted and escaped outline text
+ is set by \setpdfoutlinetext.
+ (\pdfmkdest): Use \setpdfdestname.
+ (\dopdfoutline): Use \setpdfdestname and \setpdfoutlinetext.
+ (\xrefX): Use \setpdfdestname.
+
2016-08-07 Masamichi Hosoda <address@hidden>
* doc/texinfo.tex (\pdfescapestrutfsixteen):
Modified: trunk/doc/texinfo.tex
===================================================================
--- trunk/doc/texinfo.tex 2016-08-07 15:22:35 UTC (rev 7307)
+++ trunk/doc/texinfo.tex 2016-08-08 23:10:43 UTC (rev 7308)
@@ -3,7 +3,7 @@
% Load plain if necessary, i.e., if running under initex.
\expandafter\ifx\csname fmtname\endcsname\relax\input plain\fi
%
-\def\texinfoversion{2016-08-07.14}
+\def\texinfoversion{2016-08-08.22}
%
% Copyright 1985, 1986, 1988, 1990, 1991, 1992, 1993, 1994, 1995,
% 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006,
@@ -1338,7 +1338,7 @@
\pdfrefximage \pdflastximage
\fi}
%
- \def\pdfmkdest#1{{%
+ \def\setpdfdestname#1{{%
% We have to set dummies so commands such as @code, and characters
% such as \, aren't expanded when present in a section title.
\indexnofonts
@@ -1362,9 +1362,53 @@
\fi
\def\pdfdestname{#1}%
\txiescapepdf\pdfdestname
- \safewhatsit{\pdfdest name{\pdfdestname} xyz}%
}}
%
+ \def\setpdfoutlinetext#1{{%
+ \indexnofonts
+ \makevalueexpandable
+ \turnoffactive
+ \ifx \declaredencoding \latone
+ % The PDF format can use an extended form of Latin-1 in bookmark
+ % strings. See Appendix D of the PDF Reference, Sixth Edition, for
+ % the "PDFDocEncoding".
+ \passthroughcharstrue
+ % Pass through Latin-1 characters.
+ % LuaTeX: Convert to Unicode
+ % pdfTeX: Use Latin-1 as PDFDocEncoding
+ \def\pdfoutlinetext{#1}%
+ \else
+ \ifx \declaredencoding \utfeight
+ \ifx\luatexversion\thisisundefined
+ % For pdfTeX with UTF-8.
+ % TODO: the PDF format can use UTF-16 in bookmark strings,
+ % but the code for this isn't done yet.
+ % Use ASCII approximations.
+ \passthroughcharsfalse
+ \def\pdfoutlinetext{#1}%
+ \else
+ % For LuaTeX with UTF-8.
+ % Pass through Unicode characters for title texts.
+ \passthroughcharstrue
+ \def\pdfoutlinetext{#1}%
+ \fi
+ \else
+ % For non-Latin-1 or non-UTF-8 encodings.
+ % Use ASCII approximations.
+ \passthroughcharsfalse
+ \def\pdfoutlinetext{#1}%
+ \fi
+ \fi
+ % LuaTeX: Convert to UTF-16
+ % pdfTeX: Use Latin-1 as PDFDocEncoding
+ \txiescapepdfutfsixteen\pdfoutlinetext
+ }}
+ %
+ \def\pdfmkdest#1{%
+ \setpdfdestname{#1}%
+ \safewhatsit{\pdfdest name{\pdfdestname} xyz}%
+ }
+ %
% used to mark target names; must be expandable.
\def\pdfmkpgn#1{#1}
%
@@ -1392,72 +1436,13 @@
% page number. We could generate a destination for the section
% text in the case where a section has no node, but it doesn't
% seem worth the trouble, since most documents are normally structured.
- {
- \turnoffactive
- \ifx \declaredencoding \latone
- % The PDF format can use an extended form of Latin-1 in bookmark
- % strings. See Appendix D of the PDF Reference, Sixth Edition, for
- % the "PDFDocEncoding".
- \passthroughcharstrue
- % Pass through Latin-1 characters.
- % LuaTeX: Convert to Unicode
- % pdfTeX: Use Latin-1 as PDFDocEncoding
- \edef\pdfoutlinetext{#1}%
- \iftxiuseunicodedestname
- % Pass through Latin-1 characters.
- % LuaTeX with byte wise I/O converts Latin-1 characters to Unicode.
- \edef\pdfoutlinedest{#3}%
- \else
- % Use ASCII approximations in destination names.
- \passthroughcharsfalse
- \edef\pdfoutlinedest{#3}%
- \fi
- \else
- \ifx \declaredencoding \utfeight
- \ifx\luatexversion\thisisundefined
- % For pdfTeX with UTF-8.
- % TODO: the PDF format can use UTF-16 in bookmark strings,
- % but the code for this isn't done yet.
- % Use ASCII approximations.
- \passthroughcharsfalse
- \edef\pdfoutlinetext{#1}%
- \edef\pdfoutlinedest{#3}%
- \else
- % For LuaTeX with UTF-8.
- % Pass through Unicode characters for title texts.
- \passthroughcharstrue
- \edef\pdfoutlinetext{#1}%
- \iftxiuseunicodedestname
- % Pass through Unicode characters for destination names.
- \edef\pdfoutlinedest{#3}%
- \else
- % Use ASCII approximations in destination names.
- \passthroughcharsfalse
- \edef\pdfoutlinedest{#3}%
- \fi
- \fi
- \else
- % For non-Latin-1 or non-UTF-8 encodings.
- % Use ASCII approximations.
- \passthroughcharsfalse
- \edef\pdfoutlinetext{#1}%
- \edef\pdfoutlinedest{#3}%
- \fi
- \fi
- %
- \ifx\pdfoutlinedest\empty
- \def\pdfoutlinedest{#4}%
- \else
- % LuaTeX: Use UTF-8
- % pdfTeX: Use ASCII
- \txiescapepdf\pdfoutlinedest
- \fi
- % LuaTeX: Convert to UTF-16
- % pdfTeX: Use Latin-1 as PDFDocEncoding
- \txiescapepdfutfsixteen\pdfoutlinetext
- %
- \pdfoutline goto name{\pdfmkpgn{\pdfoutlinedest}}#2{\pdfoutlinetext}%
- }
+ \setpdfoutlinetext{#1}
+ \setpdfdestname{#3}
+ \ifx\pdfdestname\empty
+ \def\pdfdestname{#4}%
+ \fi
+ %
+ \pdfoutline goto name{\pdfmkpgn{\pdfdestname}}#2{\pdfoutlinetext}%
}
%
\def\pdfmakeoutlines{%
@@ -8933,35 +8918,18 @@
%
% This (wrongly) does not take account of leading or trailing
% spaces in #1, which should be ignored.
- \iftxiuseunicodedestname
- \ifx \declaredencoding \latone
- % Pass through Latin-1 characters.
- \else
- \ifx \declaredencoding \utfeight
- % Pass through Unicode characters.
- \else
- % Use ASCII approximations in destination names.
- \passthroughcharsfalse
- \fi
- \fi
- \else
- % Use ASCII approximations in destination names.
- \passthroughcharsfalse
- \fi
- \def\pdfxrefdest{#1}%
+ \setpdfdestname{#1}%
%
- \ifx\pdfxrefdest\empty
- \def\pdfxrefdest{Top}% no empty targets
- \else
- \txiescapepdf\pdfxrefdest % escape PDF special chars
+ \ifx\pdfdestname\empty
+ \def\pdfdestname{Top}% no empty targets
\fi
%
\leavevmode
\startlink attr{/Border [0 0 0]}%
\ifnum\filenamelength>0
- goto file{\the\filename.pdf} name{\pdfxrefdest}%
+ goto file{\the\filename.pdf} name{\pdfdestname}%
\else
- goto name{\pdfmkpgn{\pdfxrefdest}}%
+ goto name{\pdfmkpgn{\pdfdestname}}%
\fi
}%
\setcolor{\linkcolor}%
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [7308] pdfTeX and LuaTeX PDF destination name,
trueroad <=