diff options
author | Karl Berry <karl@freefriends.org> | 2011-04-12 22:56:39 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2011-04-12 22:56:39 +0000 |
commit | 3c9b5c2960ae2455180bdb3a4e67bf10175b39af (patch) | |
tree | 53ac9731c23e82f60349ec920ed8d816738913dc /Master/texmf-dist/source/latex/oberdiek/ifpdf.dtx | |
parent | f437333cf5d63d69f5ab9fd1eb553af4175037d0 (diff) |
oberdiek (12apr11)
git-svn-id: svn://tug.org/texlive/trunk@22061 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/source/latex/oberdiek/ifpdf.dtx')
-rw-r--r-- | Master/texmf-dist/source/latex/oberdiek/ifpdf.dtx | 211 |
1 files changed, 132 insertions, 79 deletions
diff --git a/Master/texmf-dist/source/latex/oberdiek/ifpdf.dtx b/Master/texmf-dist/source/latex/oberdiek/ifpdf.dtx index ae250c534ab..8a62a6079fa 100644 --- a/Master/texmf-dist/source/latex/oberdiek/ifpdf.dtx +++ b/Master/texmf-dist/source/latex/oberdiek/ifpdf.dtx @@ -1,6 +1,6 @@ % \iffalse meta-comment % -% Copyright (C) 2001, 2005-2010 by +% Copyright (C) 2001, 2005-2011 by % Heiko Oberdiek <heiko.oberdiek at googlemail.com> % % This work may be distributed and/or modified under the @@ -75,7 +75,7 @@ \input docstrip.tex \Msg{************************************************************************} \Msg{* Installation} -\Msg{* Package: ifpdf 2010/01/28 v2.1 Provides the ifpdf switch (HO)} +\Msg{* Package: ifpdf 2011/01/30 v2.3 Provides the ifpdf switch (HO)} \Msg{************************************************************************} \keepsilent @@ -86,7 +86,7 @@ This is a generated file. -Copyright (C) 2001, 2005-2010 by +Copyright (C) 2001, 2005-2011 by Heiko Oberdiek <heiko.oberdiek at googlemail.com> This work may be distributed and/or modified under the @@ -150,7 +150,7 @@ and the derived files %<*driver> \NeedsTeXFormat{LaTeX2e} \ProvidesFile{ifpdf.drv}% - [2010/01/28 v2.1 Provides the ifpdf switch (HO)]% + [2011/01/30 v2.3 Provides the ifpdf switch (HO)]% \documentclass{ltxdoc} \usepackage{holtxdoc}[2008/08/11] \begin{document} @@ -159,7 +159,7 @@ and the derived files %</driver> % \fi % -% \CheckSum{511} +% \CheckSum{593} % % \CharacterTable % {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z @@ -180,7 +180,7 @@ and the derived files % \GetFileInfo{ifpdf.drv} % % \title{The \xpackage{ifpdf} package} -% \date{2010/01/28 v2.1} +% \date{2011/01/30 v2.3} % \author{Heiko Oberdiek\\\xemail{heiko.oberdiek at googlemail.com}} % % \maketitle @@ -329,14 +329,18 @@ and the derived files % \subsection{Reload check and package identification} % Reload check, especially if the package is not used with \LaTeX. % \begin{macrocode} -\begingroup - \catcode44 12 % , - \catcode45 12 % - - \catcode46 12 % . - \catcode58 12 % : - \catcode64 11 % @ - \catcode123 1 % { - \catcode125 2 % } +\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 @@ -344,7 +348,6 @@ and the derived files \ifx\x\empty % LaTeX, first loading, % variable is initialized, but \ProvidesPackage not yet seen \else - \catcode35 6 % # \expandafter\ifx\csname PackageInfo\endcsname\relax \def\x#1#2{% \immediate\write-1{Package #1 Info: #2.}% @@ -356,24 +359,27 @@ and the derived files \aftergroup\endinput \fi \fi -\endgroup +\endgroup% % \end{macrocode} % Package identification: % \begin{macrocode} -\begingroup - \catcode35 6 % # - \catcode40 12 % ( - \catcode41 12 % ) - \catcode44 12 % , - \catcode45 12 % - - \catcode46 12 % . - \catcode47 12 % / - \catcode58 12 % : - \catcode64 11 % @ - \catcode91 12 % [ - \catcode93 12 % ] - \catcode123 1 % { - \catcode125 2 % } +\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}% @@ -392,34 +398,43 @@ and the derived files \fi \expandafter\x\csname ver@ifpdf.sty\endcsname \ProvidesPackage{ifpdf}% - [2010/01/28 v2.1 Provides the ifpdf switch (HO)] + [2011/01/30 v2.3 Provides the ifpdf switch (HO)]% % \end{macrocode} % % \subsection{Catcodes} % % \begin{macrocode} -\begingroup - \catcode123 1 % { - \catcode125 2 % } +\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{% - \catcode35 \the\catcode35\relax - \catcode64 \the\catcode64\relax - \catcode123 \the\catcode123\relax - \catcode125 \the\catcode125\relax + \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 -\catcode35 6 % # -\catcode64 11 % @ -\catcode123 1 % { -\catcode125 2 % } +\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=\the\catcode#1\relax }% - \catcode#1 #2\relax + \catcode#1=#2\relax } \TMP@EnsureCode{10}{12}% ^^J \TMP@EnsureCode{39}{12}% ' @@ -431,9 +446,11 @@ and the derived files \TMP@EnsureCode{47}{12}% / \TMP@EnsureCode{58}{12}% : \TMP@EnsureCode{60}{12}% < -\TMP@EnsureCode{61}{12}% = +\TMP@EnsureCode{91}{12}% [ +\TMP@EnsureCode{93}{12}% ] \TMP@EnsureCode{94}{7}% ^ \TMP@EnsureCode{96}{12}% ` +\edef\ifpdf@AtEnd{\ifpdf@AtEnd\noexpand\endinput} % \end{macrocode} % % \subsection{Check for previously defined \cs{ifpdf}} @@ -462,9 +479,8 @@ and the derived files therefore package loading is aborted.% }% \endgroup - \ifpdf@AtEnd - \expandafter\endinput - \fi + \expandafter\ifpdf@AtEnd + \fi% \endgroup % \end{macrocode} % @@ -478,22 +494,29 @@ and the derived files % % \begin{macrocode} \begingroup + \def\skip#1\relax\begingroup{}% \expandafter\ifx\csname pdfoutput\endcsname\relax \else - \def\skip#1\relax\endgroup{\csname fi\endcsname\endgroup}% - \skip + \expandafter\skip \fi \expandafter\ifx\csname directlua\endcsname\relax - \def\skip#1\endgroup{\csname fi\endcsname\endgroup}% - \skip - \fi - \expandafter\ifx\csname RequirePackage\endcsname\relax - \input ifluatex.sty\relax - \else - \RequirePackage{ifluatex}[2009/04/10]% + \expandafter\skip \fi - \ifluatex - \ifnum\luatexversion<36 % +\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 % % \end{macrocode} % Unhappily \LuaTeX's \cs{primitive} (derived from % pdfTeX's \cs{pdfprimitive}) cannot be used: @@ -503,14 +526,17 @@ and the derived files % Setting a value works, but getting fails, % because \TeX\ does no longer see it as number. It % is unexpandable and breaks numerical contexts. +% This was fixed in \hologo{pdfTeX} 1.40.10 +% (bugfix \#4289: ``|\primitive\pdfoutput| cannot be queried''). % \begin{macrocode} - \else + \else + \begingroup \directlua{tex.enableprimitives('ifpdf', {'pdfoutput'})}% \global\let\pdfoutput\ifpdfpdfoutput - \fi + \endgroup \fi - \relax -\endgroup +\fi +\relax\begingroup\endgroup % \end{macrocode} % % \subsection{\cs{ifpdf}} @@ -563,12 +589,9 @@ and the derived files \begingroup \expandafter\ifx\csname pdfoutput\endcsname\relax \else - \escapechar=-1 % + \escapechar=92 % \edef\m{\meaning\pdfoutput}% - \edef\p{% - \string p\string d\string f% - \string o\string u\string t\string p\string u\string t% - }% + \edef\p{\string\pdfoutput}% \ifx\m\p \else \expandafter\ifx\csname PackageWarningNoLine\endcsname\relax @@ -579,7 +602,7 @@ and the derived files }% \fi \PackageWarningNoLine{ifpdf}{% - Someone has redefined \string\\pdfoutput% + Someone has redefined \string\pdfoutput% }% \fi \fi @@ -599,11 +622,11 @@ and the derived files \let\x\PackageInfo \expandafter\let\csname on@line\endcsname\empty \fi - \x{ifpdf}{pdfTeX in pdf mode \ifpdf\else not \fi detected}% + \x{ifpdf}{pdfTeX in PDF mode is \ifpdf\else not \fi detected}% \endgroup % \end{macrocode} % \begin{macrocode} -\ifpdf@AtEnd +\ifpdf@AtEnd% % \end{macrocode} % \begin{macrocode} %</package> @@ -669,6 +692,22 @@ and the derived files \advance\count@ 1 % \repeat } +\def\RangeCatcodeCheck#1#2#3{% + \count@=#1\relax + \loop + \ifnum#3=\catcode\count@ + \else + \errmessage{% + Character \the\count@\space + with wrong catcode \the\catcode\count@\space + instead of \number#3% + }% + \fi + \ifnum\count@<#2\relax + \advance\count@ 1 % + \repeat +} +\def\space{ } \expandafter\ifx\csname LoadCommand\endcsname\relax \def\LoadCommand{\input ifpdf.sty\relax}% \fi @@ -679,15 +718,20 @@ and the derived files \RangeCatcodeInvalid{123}{255}% \catcode`\@=12 % \catcode`\\=0 % - \catcode`\{=1 % - \catcode`\}=2 % - \catcode`\#=6 % - \catcode`\[=12 % - \catcode`\]=12 % \catcode`\%=14 % - \catcode`\ =10 % - \catcode13=5 % \LoadCommand + \RangeCatcodeCheck{0}{36}{15}% + \RangeCatcodeCheck{37}{37}{14}% + \RangeCatcodeCheck{38}{47}{15}% + \RangeCatcodeCheck{48}{57}{12}% + \RangeCatcodeCheck{58}{63}{15}% + \RangeCatcodeCheck{64}{64}{12}% + \RangeCatcodeCheck{65}{90}{11}% + \RangeCatcodeCheck{91}{91}{15}% + \RangeCatcodeCheck{92}{92}{0}% + \RangeCatcodeCheck{93}{96}{15}% + \RangeCatcodeCheck{97}{122}{11}% + \RangeCatcodeCheck{123}{255}{15}% \RestoreCatcodes } \Test @@ -940,6 +984,15 @@ and the derived files % \item % Compatibility to ini\TeX\ added. % \end{Version} +% \begin{Version}{2010/09/13 v2.2} +% \item +% Code with \cs{escapechar} rewritten because of +% LuaTeX bug: \cs{escapechar} does not work. +% \end{Version} +% \begin{Version}{2011/01/30 v2.3} +% \item +% Already loaded package files are not input in \hologo{plainTeX}. +% \end{Version} % \end{History} % % \PrintIndex |