summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/texinfo
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2016-04-19 20:48:34 +0000
committerKarl Berry <karl@freefriends.org>2016-04-19 20:48:34 +0000
commit48561236fc022edcf3f809721714c89abda515aa (patch)
tree42a9cf12ec0816f7dc4375668b46f749b6c218ef /Master/texmf-dist/tex/texinfo
parent31d261406712b866232bafd834b52eedfa10c9a1 (diff)
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
Diffstat (limited to 'Master/texmf-dist/tex/texinfo')
-rw-r--r--Master/texmf-dist/tex/texinfo/texinfo.tex164
1 files changed, 151 insertions, 13 deletions
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}