From 48561236fc022edcf3f809721714c89abda515aa Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Tue, 19 Apr 2016 20:48:34 +0000 Subject: update of ifpdf and hyperref from dcarlisle+latex3 to work with new luatex git-svn-id: svn://tug.org/texlive/trunk@40618 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf-dist/doc/generic/ifpdf/ifpdf.pdf | Bin 0 -> 146855 bytes Master/texmf-dist/doc/latex/oberdiek/ifpdf.pdf | Bin 144955 -> 0 bytes Master/texmf-dist/source/generic/ifpdf/ifpdf.dtx | 106 ++++++++ Master/texmf-dist/source/generic/ifpdf/ifpdf.ins | 10 + .../texmf-dist/source/latex/hyperref/hyperref.ins | 10 +- .../source/latex/hyperref/useluatex85.dtx | 13 + .../texmf-dist/source/latex/oberdiek/oberdiek.ins | 3 +- Master/texmf-dist/tex/generic/ifpdf/ifpdf.sty | 48 ++++ Master/texmf-dist/tex/generic/oberdiek/ifpdf.sty | 269 --------------------- Master/texmf-dist/tex/latex/hyperref/hyperref.sty | 11 +- Master/texmf-dist/tex/texinfo/texinfo.tex | 164 ++++++++++++- 11 files changed, 347 insertions(+), 287 deletions(-) create mode 100644 Master/texmf-dist/doc/generic/ifpdf/ifpdf.pdf delete mode 100644 Master/texmf-dist/doc/latex/oberdiek/ifpdf.pdf create mode 100644 Master/texmf-dist/source/generic/ifpdf/ifpdf.dtx create mode 100644 Master/texmf-dist/source/generic/ifpdf/ifpdf.ins create mode 100644 Master/texmf-dist/source/latex/hyperref/useluatex85.dtx create mode 100644 Master/texmf-dist/tex/generic/ifpdf/ifpdf.sty delete mode 100644 Master/texmf-dist/tex/generic/oberdiek/ifpdf.sty (limited to 'Master/texmf-dist') diff --git a/Master/texmf-dist/doc/generic/ifpdf/ifpdf.pdf b/Master/texmf-dist/doc/generic/ifpdf/ifpdf.pdf new file mode 100644 index 00000000000..a238fc01d26 Binary files /dev/null and b/Master/texmf-dist/doc/generic/ifpdf/ifpdf.pdf differ diff --git a/Master/texmf-dist/doc/latex/oberdiek/ifpdf.pdf b/Master/texmf-dist/doc/latex/oberdiek/ifpdf.pdf deleted file mode 100644 index 18597adaf54..00000000000 Binary files a/Master/texmf-dist/doc/latex/oberdiek/ifpdf.pdf and /dev/null differ diff --git a/Master/texmf-dist/source/generic/ifpdf/ifpdf.dtx b/Master/texmf-dist/source/generic/ifpdf/ifpdf.dtx new file mode 100644 index 00000000000..9ab7d2ea5ee --- /dev/null +++ b/Master/texmf-dist/source/generic/ifpdf/ifpdf.dtx @@ -0,0 +1,106 @@ +% \iffalse +%% Source File: ifpdf.dtx +%% Copyright 2016 LaTeX3 project +%% +%% This file may be distributed under the terms of the LPPL. +%% See README for details. +% +%<*dtx> + \ProvidesFile{ifpdf.dtx} +% +%\ifx\ProvidesPackage\undefined +%\def\next#1#2[#3]{\wlog{#2 #3}} +%\expandafter\next\fi +%\ProvidesPackage{ifpdf} +% \ProvidesFile{ifpdf.drv} +% \fi +% \ProvidesFile{ifpdf.dtx} +[2016/04/04 v3.0 Provides the ifpdf switch] +% +% \iffalse +%<*driver> +\documentclass{ltxdoc} +\begin{document} +\DocInput{ifpdf.dtx} +\end{document} +% +% \fi +% +% \GetFileInfo{ifpdf.dtx} +% +% \title{The \textsf{ifpdf} Package\thanks{This file +% has version number \fileversion, last +% revised \filedate. +% Please report any issues at https://github.com/davidcarlisle/ifpdf/issues}} +% \author{LaTeX3 project} +% \date{\filedate} +% \maketitle +% +% \section{Introduction} +% +% A re-implementation of Heiko Oberdiek's \textsf{ifpdf} package +% with simplified structure and updated to work with current Lua\TeX. +% +% The package defines a new boolean, \verb|\ifpdf| which is true +% for pdf\TeX\ and Lua\TeX\ in PDF mode, and false otherwise. +% +% \section{Implementation} +% +% \begin{macrocode} +%<*package> +% \end{macrocode} +% +% If \verb|\ifpdf| is not defined define it, taking care that it is +% outer in plain \TeX. +% \begin{macrocode} +\expandafter\ifx\csname ifpdf\endcsname\relax + \csname newif\expandafter\endcsname\csname ifpdf\endcsname +\else +% \end{macrocode} +% If \verb|\ifpdf| is already defined but \verb|\pdftrue| is not defined +% give up. +% \begin{macrocode} + \ifx\pdftrue\undefined + \ifx\PackageError\undefined + \begingroup\def\PackageError#1#2#3{\endgroup\errmessage{#2}} + \fi + \PackageError{ifpdf}{incompatible ifpdf definition}{} + \expandafter\expandafter\expandafter + \fi +\fi +% \end{macrocode} +% Otherwise set the boolean to false unless pdfoutput (outputmode) is greater than zero. +% For Lua\TeX, do the test in Lua as the tex primitivies may not be enabled, and +% the primitive name may be \verb|\pdfoutput| or \verb|\outputmode| depending +% on the Lua\TeX\ version number. +% \begin{macrocode} +\let\ifpdf\iffalse +% \end{macrocode} +% +% \begin{macrocode} +\ifx\directlua\undefined +% \end{macrocode} +% Not Lua\TeX. +% \begin{macrocode} +\begingroup\expandafter\expandafter\expandafter\endgroup +\expandafter\ifx\csname pdfoutput\endcsname\relax +\else + \ifnum\pdfoutput>0 % + \pdftrue + \fi +\fi +\else +% \end{macrocode} +% Lua\TeX. +% \begin{macrocode} +\directlua{% +if (tex.outputmode or tex.pdfoutput or 0) > 0 then + tex.print('\string\\pdftrue') +end +} +\fi +% \end{macrocode} +% +% \begin{macrocode} +% +% \end{macrocode} diff --git a/Master/texmf-dist/source/generic/ifpdf/ifpdf.ins b/Master/texmf-dist/source/generic/ifpdf/ifpdf.ins new file mode 100644 index 00000000000..409c06da3e2 --- /dev/null +++ b/Master/texmf-dist/source/generic/ifpdf/ifpdf.ins @@ -0,0 +1,10 @@ +\input docstrip +\keepsilent +\preamble +\endpreamble + +\askforoverwritefalse + +\generate{\file{ifpdf.sty}{\from{ifpdf.dtx}{package}}} + +\endbatchfile diff --git a/Master/texmf-dist/source/latex/hyperref/hyperref.ins b/Master/texmf-dist/source/latex/hyperref/hyperref.ins index 3add5dd1488..6617b9362c1 100644 --- a/Master/texmf-dist/source/latex/hyperref/hyperref.ins +++ b/Master/texmf-dist/source/latex/hyperref/hyperref.ins @@ -6,6 +6,7 @@ %% Copyright 1995-1999 Sebastian Rahtz %% 1999-2000 Sebastian Rahtz, Heiko Oberdiek %% 2001-2012 Heiko Oberdiek +%% 2016 David Carlisle (include useluatex85) %% %% This file is part of the `Hyperref Bundle'. %% ------------------------------------------- @@ -28,7 +29,7 @@ %% %% --------------- start of docstrip commands ------------------ %% -\def\filedate{2010/01/25} +\def\filedate{2016/04/19} \def\batchfile{hyperref.ins} \input docstrip @@ -55,14 +56,17 @@ \endpreamble \generate{% - \file{hyperref.drv}{\from{hyperref.dtx}{driver}} + \file{hyperref.drv}{\needed{useluatex85.dtx}\from{hyperref.dtx}{driver}} \file{hycheck.tex}{\from{hyperref.dtx}{check}} \file{backref.drv}{\from{backref.dtx}{driver}} \file{nameref.drv}{\from{nameref.dtx}{driver}} \usedir{tex/latex/hyperref} \file{backref.sty}{\from{backref.dtx}{package}} \file{nameref.sty}{\from{nameref.dtx}{package}} - \file{hyperref.sty}{\from{hyperref.dtx}{package}} + \file{hyperref.sty}{ + \from{useluatex85.dtx}{package} + \from{hyperref.dtx}{package} + } \file{hypertex.def}{\from{hyperref.dtx}{hypertex}} \file{pdfmark.def}{\from{hyperref.dtx}{pdfmark,pdfmarkbase,pdfform,outlines}} \file{hvtexmrk.def}{\from{hyperref.dtx}{vtexpdfmark}} diff --git a/Master/texmf-dist/source/latex/hyperref/useluatex85.dtx b/Master/texmf-dist/source/latex/hyperref/useluatex85.dtx new file mode 100644 index 00000000000..12757674738 --- /dev/null +++ b/Master/texmf-dist/source/latex/hyperref/useluatex85.dtx @@ -0,0 +1,13 @@ +% \begin{macrocode} +%<*package> +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%% LaTeX3 Team update: +%% Add compatibility for luatex 0.85+. +\ifx\directlua\@undefined\else +\typeout{luatex85 package added for Luatex 0.85+ compatibility} +\RequirePackage{luatex85} +\fi +% end of luatex compatibility insertion +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +% \end{macrocode} diff --git a/Master/texmf-dist/source/latex/oberdiek/oberdiek.ins b/Master/texmf-dist/source/latex/oberdiek/oberdiek.ins index de8a679be49..02880550112 100644 --- a/Master/texmf-dist/source/latex/oberdiek/oberdiek.ins +++ b/Master/texmf-dist/source/latex/oberdiek/oberdiek.ins @@ -65,7 +65,8 @@ \batchinput{ifdraft.dtx} \batchinput{iflang.dtx} \batchinput{ifluatex.dtx} -\batchinput{ifpdf.dtx} +% incompatible with current luatex +%\batchinput{ifpdf.dtx} \batchinput{ifvtex.dtx} \batchinput{infwarerr.dtx} \batchinput{inputenx.dtx} diff --git a/Master/texmf-dist/tex/generic/ifpdf/ifpdf.sty b/Master/texmf-dist/tex/generic/ifpdf/ifpdf.sty new file mode 100644 index 00000000000..388ef565987 --- /dev/null +++ b/Master/texmf-dist/tex/generic/ifpdf/ifpdf.sty @@ -0,0 +1,48 @@ +%% +%% This is file `ifpdf.sty', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% ifpdf.dtx (with options: `package') +%% +%% Source File: ifpdf.dtx +%% Copyright 2016 LaTeX3 project +%% +%% This file may be distributed under the terms of the LPPL. +%% See README for details. +\ifx\ProvidesPackage\undefined +\def\next#1#2[#3]{\wlog{#2 #3}} +\expandafter\next\fi +\ProvidesPackage{ifpdf} +[2016/04/04 v3.0 Provides the ifpdf switch] +\expandafter\ifx\csname ifpdf\endcsname\relax + \csname newif\expandafter\endcsname\csname ifpdf\endcsname +\else + \ifx\pdftrue\undefined + \ifx\PackageError\undefined + \begingroup\def\PackageError#1#2#3{\endgroup\errmessage{#2}} + \fi + \PackageError{ifpdf}{incompatible ifpdf definition}{} + \expandafter\expandafter\expandafter + \fi +\fi +\let\ifpdf\iffalse +\ifx\directlua\undefined +\begingroup\expandafter\expandafter\expandafter\endgroup +\expandafter\ifx\csname pdfoutput\endcsname\relax +\else + \ifnum\pdfoutput>0 % + \pdftrue + \fi +\fi +\else +\directlua{% +if (tex.outputmode or tex.pdfoutput or 0) > 0 then + tex.print('\string\\pdftrue') +end +} +\fi +\endinput +%% +%% End of file `ifpdf.sty'. diff --git a/Master/texmf-dist/tex/generic/oberdiek/ifpdf.sty b/Master/texmf-dist/tex/generic/oberdiek/ifpdf.sty deleted file mode 100644 index 8a8f9572511..00000000000 --- a/Master/texmf-dist/tex/generic/oberdiek/ifpdf.sty +++ /dev/null @@ -1,269 +0,0 @@ -%% -%% This is file `ifpdf.sty', -%% generated with the docstrip utility. -%% -%% The original source files were: -%% -%% ifpdf.dtx (with options: `package') -%% -%% This is a generated file. -%% -%% Project: ifpdf -%% Version: 2011/01/30 v2.3 -%% -%% Copyright (C) 2001, 2005-2011 by -%% Heiko Oberdiek -%% -%% This work may be distributed and/or modified under the -%% conditions of the LaTeX Project Public License, either -%% version 1.3c of this license or (at your option) any later -%% version. This version of this license is in -%% http://www.latex-project.org/lppl/lppl-1-3c.txt -%% and the latest version of this license is in -%% http://www.latex-project.org/lppl.txt -%% and version 1.3 or later is part of all distributions of -%% LaTeX version 2005/12/01 or later. -%% -%% This work has the LPPL maintenance status "maintained". -%% -%% This Current Maintainer of this work is Heiko Oberdiek. -%% -%% The Base Interpreter refers to any `TeX-Format', -%% because some files are installed in TDS:tex/generic//. -%% -%% This work consists of the main source file ifpdf.dtx -%% and the derived files -%% ifpdf.sty, ifpdf.pdf, ifpdf.ins, ifpdf.drv, ifpdf-test1.tex. -%% -\begingroup\catcode61\catcode48\catcode32=10\relax% - \catcode13=5 % ^^M - \endlinechar=13 % - \catcode35=6 % # - \catcode39=12 % ' - \catcode44=12 % , - \catcode45=12 % - - \catcode46=12 % . - \catcode58=12 % : - \catcode64=11 % @ - \catcode123=1 % { - \catcode125=2 % } - \expandafter\let\expandafter\x\csname ver@ifpdf.sty\endcsname - \ifx\x\relax % plain-TeX, first loading - \else - \def\empty{}% - \ifx\x\empty % LaTeX, first loading, - % variable is initialized, but \ProvidesPackage not yet seen - \else - \expandafter\ifx\csname PackageInfo\endcsname\relax - \def\x#1#2{% - \immediate\write-1{Package #1 Info: #2.}% - }% - \else - \def\x#1#2{\PackageInfo{#1}{#2, stopped}}% - \fi - \x{ifpdf}{The package is already loaded}% - \aftergroup\endinput - \fi - \fi -\endgroup% -\begingroup\catcode61\catcode48\catcode32=10\relax% - \catcode13=5 % ^^M - \endlinechar=13 % - \catcode35=6 % # - \catcode39=12 % ' - \catcode40=12 % ( - \catcode41=12 % ) - \catcode44=12 % , - \catcode45=12 % - - \catcode46=12 % . - \catcode47=12 % / - \catcode58=12 % : - \catcode64=11 % @ - \catcode91=12 % [ - \catcode93=12 % ] - \catcode123=1 % { - \catcode125=2 % } - \expandafter\ifx\csname ProvidesPackage\endcsname\relax - \def\x#1#2#3[#4]{\endgroup - \immediate\write-1{Package: #3 #4}% - \xdef#1{#4}% - }% - \else - \def\x#1#2[#3]{\endgroup - #2[{#3}]% - \ifx#1\@undefined - \xdef#1{#3}% - \fi - \ifx#1\relax - \xdef#1{#3}% - \fi - }% - \fi -\expandafter\x\csname ver@ifpdf.sty\endcsname -\ProvidesPackage{ifpdf}% - [2011/01/30 v2.3 Provides the ifpdf switch (HO)]% -\begingroup\catcode61\catcode48\catcode32=10\relax% - \catcode13=5 % ^^M - \endlinechar=13 % - \catcode123=1 % { - \catcode125=2 % } - \catcode64=11 % @ - \def\x{\endgroup - \expandafter\edef\csname ifpdf@AtEnd\endcsname{% - \endlinechar=\the\endlinechar\relax - \catcode13=\the\catcode13\relax - \catcode32=\the\catcode32\relax - \catcode35=\the\catcode35\relax - \catcode61=\the\catcode61\relax - \catcode64=\the\catcode64\relax - \catcode123=\the\catcode123\relax - \catcode125=\the\catcode125\relax - }% - }% -\x\catcode61\catcode48\catcode32=10\relax% -\catcode13=5 % ^^M -\endlinechar=13 % -\catcode35=6 % # -\catcode64=11 % @ -\catcode123=1 % { -\catcode125=2 % } -\def\TMP@EnsureCode#1#2{% - \edef\ifpdf@AtEnd{% - \ifpdf@AtEnd - \catcode#1=\the\catcode#1\relax - }% - \catcode#1=#2\relax -} -\TMP@EnsureCode{10}{12}% ^^J -\TMP@EnsureCode{39}{12}% ' -\TMP@EnsureCode{40}{12}% ( -\TMP@EnsureCode{41}{12}% ) -\TMP@EnsureCode{44}{12}% , -\TMP@EnsureCode{45}{12}% - -\TMP@EnsureCode{46}{12}% . -\TMP@EnsureCode{47}{12}% / -\TMP@EnsureCode{58}{12}% : -\TMP@EnsureCode{60}{12}% < -\TMP@EnsureCode{91}{12}% [ -\TMP@EnsureCode{93}{12}% ] -\TMP@EnsureCode{94}{7}% ^ -\TMP@EnsureCode{96}{12}% ` -\edef\ifpdf@AtEnd{\ifpdf@AtEnd\noexpand\endinput} -\begingroup - \expandafter\ifx\csname ifpdf\endcsname\relax - \else - \edef\i/{\expandafter\string\csname ifpdf\endcsname}% - \expandafter\ifx\csname PackageError\endcsname\relax - \def\x#1#2{% - \edef\z{#2}% - \expandafter\errhelp\expandafter{\z}% - \errmessage{Package ifpdf Error: #1}% - }% - \def\y{^^J}% - \newlinechar=10 % - \else - \def\x#1#2{% - \PackageError{ifpdf}{#1}{#2}% - }% - \def\y{\MessageBreak}% - \fi - \x{Name clash, \i/ is already defined}{% - Incompatible versions of \i/ can cause problems,\y - therefore package loading is aborted.% - }% - \endgroup - \expandafter\ifpdf@AtEnd - \fi% -\endgroup -\begingroup - \def\skip#1\relax\begingroup{}% - \expandafter\ifx\csname pdfoutput\endcsname\relax - \else - \expandafter\skip - \fi - \expandafter\ifx\csname directlua\endcsname\relax - \expandafter\skip - \fi -\endgroup -\begingroup\expandafter\expandafter\expandafter\endgroup -\expandafter\ifx\csname RequirePackage\endcsname\relax - \def\TMP@RequirePackage#1[#2]{% - \begingroup\expandafter\expandafter\expandafter\endgroup - \expandafter\ifx\csname ver@#1.sty\endcsname\relax - \input #1.sty\relax - \fi - }% - \TMP@RequirePackage{ifluatex}[2009/04/10]% -\else - \RequirePackage{ifluatex}[2009/04/10]% -\fi -\ifluatex - \ifnum\luatexversion<36 % - \else - \begingroup - \directlua{tex.enableprimitives('ifpdf', {'pdfoutput'})}% - \global\let\pdfoutput\ifpdfpdfoutput - \endgroup - \fi -\fi -\relax\begingroup\endgroup -\begingroup\expandafter\expandafter\expandafter\endgroup -\expandafter\ifx\csname newif\endcsname\relax - \edef\pdffalse{% - \let - \expandafter\noexpand\csname ifpdf\endcsname - \expandafter\noexpand\csname iffalse\endcsname - }% - \edef\pdftrue{% - \let - \expandafter\noexpand\csname ifpdf\endcsname - \expandafter\noexpand\csname iftrue\endcsname - }% - \pdffalse -\else - \csname newif\expandafter\endcsname\csname ifpdf\endcsname -\fi -\begingroup\expandafter\expandafter\expandafter\endgroup -\expandafter\ifx\csname pdfoutput\endcsname\relax -\else - \ifnum\pdfoutput<1 % - \else - \pdftrue - \fi -\fi -\begingroup - \expandafter\ifx\csname pdfoutput\endcsname\relax - \else - \escapechar=92 % - \edef\m{\meaning\pdfoutput}% - \edef\p{\string\pdfoutput}% - \ifx\m\p - \else - \expandafter\ifx\csname PackageWarningNoLine\endcsname\relax - \def\PackageWarningNoLine#1#2{% - \immediate\write16{% - Package `#1' Warning: #2.% - }% - }% - \fi - \PackageWarningNoLine{ifpdf}{% - Someone has redefined \string\pdfoutput% - }% - \fi - \fi -\endgroup -\begingroup - \expandafter\ifx\csname PackageInfo\endcsname\relax - \def\x#1#2{% - \immediate\write-1{Package #1 Info: #2.}% - }% - \else - \let\x\PackageInfo - \expandafter\let\csname on@line\endcsname\empty - \fi - \x{ifpdf}{pdfTeX in PDF mode is \ifpdf\else not \fi detected}% -\endgroup -\ifpdf@AtEnd% -\endinput -%% -%% End of file `ifpdf.sty'. diff --git a/Master/texmf-dist/tex/latex/hyperref/hyperref.sty b/Master/texmf-dist/tex/latex/hyperref/hyperref.sty index 443de9630d6..d4d77e5cc83 100644 --- a/Master/texmf-dist/tex/latex/hyperref/hyperref.sty +++ b/Master/texmf-dist/tex/latex/hyperref/hyperref.sty @@ -4,8 +4,17 @@ %% %% The original source files were: %% +%% useluatex85.dtx (with options: `package') %% hyperref.dtx (with options: `package') %% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%% LaTeX3 Team update April 2016: +%% Add compatibility for luatex 0.85+. +\ifx\directlua\@undefined\else +\typeout{luatex85 package added for Luatex 0.85+ compatibility} +\RequirePackage{luatex85} +\fi +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% File: hyperref.dtx Copyright 1995-2001 Sebastian Rahtz, %% with portions written by David Carlisle and Heiko Oberdiek, %% 2001-2012 Heiko Oberdiek. @@ -30,7 +39,7 @@ %% \NeedsTeXFormat{LaTeX2e}[1995/12/01] \ProvidesPackage{hyperref} - [2012/11/06 v6.83m % + [2016/04/19 v6.83m3 % Hypertext links for LaTeX] \begingroup \@makeother\`% diff --git a/Master/texmf-dist/tex/texinfo/texinfo.tex b/Master/texmf-dist/tex/texinfo/texinfo.tex index 9437a4d3e31..37e2de896ec 100644 --- a/Master/texmf-dist/tex/texinfo/texinfo.tex +++ b/Master/texmf-dist/tex/texinfo/texinfo.tex @@ -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-03-22.15} +\def\texinfoversion{2016-04-14.07} % % Copyright 1985, 1986, 1988, 1990, 1991, 1992, 1993, 1994, 1995, % 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, @@ -1550,8 +1550,7 @@ output) for that.)} \fi \turnoffactive \makevalueexpandable - % In the case of XeTeX, xdvipdfmx converts strings to UTF-16. - % Therefore \txiescapepdf is not necessary. + \txiescapepdf\pdfdestname \safewhatsit{\pdfdest name{\pdfdestname} xyz}% }} % @@ -1566,9 +1565,12 @@ output) for that.)} \fi { \turnoffactive - % In the case of XeTeX, xdvipdfmx converts strings to UTF-16. - % Therefore \txiescapepdf is not necessary. - \special{pdf:out [-] #2 << /Title (#1) /A << /S /GoTo /D (name\pdfoutlinedest) >> >> }% + \txiescapepdf\pdfoutlinedest + \edef\pdfoutlinetext{#1}% + \txiescapepdf\pdfoutlinetext + % + \special{pdf:out [-] #2 << /Title (\pdfoutlinetext) /A + << /S /GoTo /D (name\pdfoutlinedest) >> >> }% } } % @@ -1624,6 +1626,20 @@ output) for that.)} % ``\special{pdf:dest ...}'' can not handle non-ASCII strings. % It fixed by xdvipdfmx 20160106 (TeX Live SVN r39753). % + \def\skipspaces#1{\def\PP{#1}\def\D{|}% + \ifx\PP\D\let\nextsp\relax + \else\let\nextsp\skipspaces + \addtokens{\filename}{\PP}% + \advance\filenamelength by 1 + \fi + \nextsp} + \def\getfilename#1{% + \filenamelength=0 + % If we don't expand the argument now, \skipspaces will get + % snagged on things like "@value{foo}". + \edef\temp{#1}% + \expandafter\skipspaces\temp|\relax + } % make a live url in pdf output. \def\pdfurl#1{% \begingroup @@ -1645,6 +1661,32 @@ output) for that.)} /Subtype /Link /A << /S /URI /URI (#1) >> >>}% \endgroup} \def\endlink{\setcolor{\maincolor}\special{pdf:eann}} + \def\pdfgettoks#1.{\setbox\boxA=\hbox{\toksA={#1.}\toksB={}\maketoks}} + \def\addtokens#1#2{\edef\addtoks{\noexpand#1={\the#1#2}}\addtoks} + \def\adn#1{\addtokens{\toksC}{#1}\global\countA=1\let\next=\maketoks} + \def\poptoks#1#2|ENDTOKS|{\let\first=#1\toksD={#1}\toksA={#2}} + \def\maketoks{% + \expandafter\poptoks\the\toksA|ENDTOKS|\relax + \ifx\first0\adn0 + \else\ifx\first1\adn1 \else\ifx\first2\adn2 \else\ifx\first3\adn3 + \else\ifx\first4\adn4 \else\ifx\first5\adn5 \else\ifx\first6\adn6 + \else\ifx\first7\adn7 \else\ifx\first8\adn8 \else\ifx\first9\adn9 + \else + \ifnum0=\countA\else\makelink\fi + \ifx\first.\let\next=\done\else + \let\next=\maketoks + \addtokens{\toksB}{\the\toksD} + \ifx\first,\addtokens{\toksB}{\space}\fi + \fi + \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi + \next} + \def\makelink{\addtokens{\toksB}% + {\noexpand\pdflink{\the\toksC}}\toksC={}\global\countA=0} + \def\pdflink#1{% + \special{pdf:bann << /Border [0 0 0] + /Type /Annot /Subtype /Link /A << /S /GoTo /D (name#1) >> >>}% + \setcolor{\linkcolor}#1\endlink} + \def\done{\edef\st{\global\noexpand\toksA={\the\toksB}}\st} % % % @image support @@ -2857,6 +2899,7 @@ end \setbox0 = \hbox{\ignorespaces #2}% look for second arg \ifdim\wd0 > 0pt \ifpdf + % For pdfTeX and LuaTeX \ifurefurlonlylink % PDF plus option to not display url, show just arg \unhbox0 @@ -2866,7 +2909,19 @@ end \unhbox0\ (\urefcode{#1})% \fi \else - \unhbox0\ (\urefcode{#1})% DVI, always show arg and url + \ifx\XeTeXrevision\thisisundefined + \unhbox0\ (\urefcode{#1})% DVI, always show arg and url + \else + % For XeTeX + \ifurefurlonlylink + % PDF plus option to not display url, show just arg + \unhbox0 + \else + % PDF, normally display both arg and url for consistency, + % visibility, if the pdf is eventually used to print, etc. + \unhbox0\ (\urefcode{#1})% + \fi + \fi \fi \else \urefcode{#1}% only url given, so show it @@ -2967,7 +3022,18 @@ end \endlink \endgroup} \else - \let\email=\uref + \ifx\XeTeXrevision\thisisundefined + \let\email=\uref + \else + \def\email#1{\doemail#1,,\finish} + \def\doemail#1,#2,#3\finish{\begingroup + \unsepspaces + \pdfurl{mailto:#1}% + \setbox0 = \hbox{\ignorespaces #2}% + \ifdim\wd0>0pt\unhbox0\else\code{#1}\fi + \endlink + \endgroup} + \fi \fi % @kbdinputstyle -- arg is `distinct' (@kbd uses slanted tty font always), @@ -5305,7 +5371,6 @@ end \putwordIndexNonexistent \else \catcode`\\ = 0 - \escapechar = `\\ % % If the index file exists but is empty, then \openin leaves \ifeof % false. We have to make TeX try to read something from the file, so @@ -5479,7 +5544,14 @@ end % preserve coloured links across page boundaries. Otherwise the marks % would get in the way of \lastbox in \insertindexentrybox. \else - \hskip\skip\thinshrinkable #1% + \ifx\XeTeXrevision\thisisundefined + \hskip\skip\thinshrinkable #1% + \else + \pdfgettoks#1.% + \bgroup\let\domark\relax + \hskip\skip\thinshrinkable\the\toksA + \egroup + \fi \fi \fi \egroup % end \boxA @@ -5614,7 +5686,11 @@ end \ifpdf \pdfgettoks#2.\ \the\toksA % The page number ends the paragraph. \else - #2 + \ifx\XeTeXrevision\thisisundefined + #2 + \else + \pdfgettoks#2.\ \the\toksA % The page number ends the paragraph. + \fi \fi \par }} @@ -6866,7 +6942,6 @@ end \catcode `\>=\other \catcode `\`=\other \catcode `\'=\other - \escapechar=`\\ % % ' is active in math mode (mathcode"8000). So reset it, and all our % other math active characters (just in case), to plain's definitions. @@ -7844,14 +7919,28 @@ end % alias because \c means cedilla in @tex or @math \let\texinfoc=\c +\newcount\savedcatcodeone +\newcount\savedcatcodetwo + % Used at the time of macro expansion. % Argument is macro body with arguments substituted \def\scanmacro#1{% \newlinechar`\^^M \def\xeatspaces{\eatspaces}% % + % Temporarily undo catcode changes of \printindex. Set catcode of @ to + % 0 so that @-commands in macro expansions aren't printed literally when + % formatting an index file, where \ is used as the escape character. + \savedcatcodeone=\catcode`\@ + \savedcatcodetwo=\catcode`\\ + \catcode`\@=0 + \catcode`\\=\active + % % Process the macro body under the current catcode regime. - \scantokens{#1\texinfoc}\aftermacro% + \scantokens{#1@texinfoc}\aftermacro% + % + \catcode`\@=\savedcatcodeone + \catcode`\\=\savedcatcodetwo % % The \texinfoc is to remove the \newlinechar added by \scantokens, and % can be noticed by \parsearg. @@ -8699,6 +8788,7 @@ end % % Make link in pdf output. \ifpdf + % For pdfTeX and LuaTeX {\indexnofonts \turnoffactive \makevalueexpandable @@ -8725,6 +8815,47 @@ end \fi }% \setcolor{\linkcolor}% + \else + \ifx\XeTeXrevision\thisisundefined + \else + % For XeTeX + {\indexnofonts + \turnoffactive + \makevalueexpandable + % This expands tokens, so do it after making catcode changes, so _ + % etc. don't get their TeX definitions. This ignores all spaces in + % #4, including (wrongly) those in the middle of the filename. + \getfilename{#4}% + % + % This (wrongly) does not take account of leading or trailing + % spaces in #1, which should be ignored. + \iftxiuseunicodedestname + \def\pdfxrefdest{#1}% Pass through Unicode characters. + \else + \edef\pdfxrefdest{#1}% Replace Unicode characters to ASCII. + \fi + \ifx\pdfxrefdest\empty + \def\pdfxrefdest{Top}% no empty targets + \else + \txiescapepdf\pdfxrefdest % escape PDF special chars + \fi + % + \leavevmode + \ifnum\filenamelength>0 + % By the default settings, + % XeTeX (xdvipdfmx) replaces link destination names with integers. + % In this case, the replaced destination names of + % remote PDF cannot be known. In order to avoid replacement, + % you can use commandline option `-C 0x0010' for xdvipdfmx. + \special{pdf:bann << /Border [0 0 0] /Type /Annot /Subtype /Link /A + << /S /GoToR /F (\the\filename.pdf) /D (name\pdfxrefdest) >> >>}% + \else + \special{pdf:bann << /Border [0 0 0] /Type /Annot /Subtype /Link /A + << /S /GoTo /D (name\pdfxrefdest) >> >>}% + \fi + }% + \setcolor{\linkcolor}% + \fi \fi {% % Have to otherify everything special to allow the \csname to @@ -11029,6 +11160,13 @@ directory should work if nowhere else does.} % whatever layout pdftex was dumped with. \pdfhorigin = 1 true in \pdfvorigin = 1 true in + \else + \ifx\XeTeXrevision\thisisundefined + \else + \pdfpageheight #7\relax + \pdfpagewidth #8\relax + % XeTeX does not have \pdfhorigin and \pdfvorigin. + \fi \fi % \setleading{\textleading} -- cgit v1.2.3