summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/latex/oberdiek/etexcmds.dtx
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/source/latex/oberdiek/etexcmds.dtx')
-rw-r--r--Master/texmf-dist/source/latex/oberdiek/etexcmds.dtx145
1 files changed, 113 insertions, 32 deletions
diff --git a/Master/texmf-dist/source/latex/oberdiek/etexcmds.dtx b/Master/texmf-dist/source/latex/oberdiek/etexcmds.dtx
index e37941d6f5c..d2e94c4b67f 100644
--- a/Master/texmf-dist/source/latex/oberdiek/etexcmds.dtx
+++ b/Master/texmf-dist/source/latex/oberdiek/etexcmds.dtx
@@ -17,7 +17,8 @@
% This work consists of the main source file etexcmds.dtx
% and the derived files
% etexcmds.sty, etexcmds.pdf, etexcmds.ins, etexcmds.drv,
-% etexcmds-test1.tex, etexcmds-test2.tex, etexcmds-test3.tex.
+% etexcmds-test1.tex, etexcmds-test2.tex, etexcmds-test3.tex,
+% etexcmds-test4.tex.
%
% Distribution:
% CTAN:macros/latex/contrib/oberdiek/etexcmds.dtx
@@ -55,6 +56,7 @@
% TDS:doc/latex/oberdiek/etexcmds-test1.tex
% TDS:doc/latex/oberdiek/etexcmds-test2.tex
% TDS:doc/latex/oberdiek/etexcmds-test3.tex
+% TDS:doc/latex/oberdiek/etexcmds-test4.tex
% TDS:source/latex/oberdiek/etexcmds.dtx
%
%<*ignore>
@@ -70,7 +72,7 @@
\input docstrip.tex
\Msg{************************************************************************}
\Msg{* Installation}
-\Msg{* Package: etexcmds 2007/05/06 v1.0 Providing prefix for e-TeX command names (HO)}
+\Msg{* Package: etexcmds 2007/09/09 v1.1 Providing prefix for e-TeX command names (HO)}
\Msg{************************************************************************}
\keepsilent
@@ -97,7 +99,8 @@ This Current Maintainer of this work is Heiko Oberdiek.
This work consists of the main source file etexcmds.dtx
and the derived files
etexcmds.sty, etexcmds.pdf, etexcmds.ins, etexcmds.drv,
- etexcmds-test1.tex, etexcmds-test2.tex, etexcmds-test3.tex.
+ etexcmds-test1.tex, etexcmds-test2.tex, etexcmds-test3.tex,
+ etexcmds-test4.tex.
\endpreamble
@@ -110,6 +113,7 @@ and the derived files
\file{etexcmds-test1.tex}{\from{etexcmds.dtx}{test1}}%
\file{etexcmds-test2.tex}{\from{etexcmds.dtx}{test2}}%
\file{etexcmds-test3.tex}{\from{etexcmds.dtx}{test3}}%
+ \file{etexcmds-test4.tex}{\from{etexcmds.dtx}{test4}}%
}
\obeyspaces
@@ -135,7 +139,7 @@ and the derived files
%<*driver>
\NeedsTeXFormat{LaTeX2e}
\ProvidesFile{etexcmds.drv}%
- [2007/05/06 v1.0 Providing prefix for e-TeX command names (HO)]%
+ [2007/09/09 v1.1 Providing prefix for e-TeX command names (HO)]%
\documentclass{ltxdoc}
\usepackage{holtxdoc}
\begin{document}
@@ -144,7 +148,7 @@ and the derived files
%</driver>
% \fi
%
-% \CheckSum{252}
+% \CheckSum{315}
%
% \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
@@ -165,7 +169,7 @@ and the derived files
% \GetFileInfo{etexcmds.drv}
%
% \title{The \xpackage{etexcmds} package}
-% \date{2007/05/06 v1.0}
+% \date{2007/09/09 v1.1}
% \author{Heiko Oberdiek\\\xemail{oberdiek@uni-freiburg.de}}
%
% \maketitle
@@ -181,6 +185,8 @@ and the derived files
%
% \section{Documentation}
%
+% \begin{declcs}{etex@unexpanded}
+% \end{declcs}
% New primitive commands are introduced in \eTeX. Unhappily
% \cs{unexpanded} collides with a macro in Con\TeX t with the
% same name. This also affects the \LaTeX\ world. For example,
@@ -188,6 +194,16 @@ and the derived files
% that redefines \cs{unexpanded}. Thus this package defines
% \cs{etex@unexpanded} to get rid of the name clash.
%
+% \begin{declcs}{ifetex@unexpanded}
+% \end{declcs}
+% Package \xpackage{etexcmds} can be loaded even if \eTeX\ is not
+% present or \cs{unexpanded} cannot be found. The switch
+% \cs{ifetex@unexpanded} tells whether it is safe to use
+% \cs{etex@unexpanded}.
+% The switch is true (\cs{iftrue}) only if the
+% primitive \cs{unexpanded} has been found and \cs{etex@unexpanded}
+% is available.
+%
% \StopEventually{
% }
%
@@ -255,25 +271,28 @@ and the derived files
\fi
\expandafter\x\csname ver@etexcmds.sty\endcsname
\ProvidesPackage{etexcmds}%
- [2007/05/06 v1.0 Providing prefix for e-TeX command names (HO)]
+ [2007/09/09 v1.1 Providing prefix for e-TeX command names (HO)]
% \end{macrocode}
%
% \subsection{Catcodes}
%
% \begin{macrocode}
-\expandafter\edef\csname etexcmds@End\endcsname{%
- \catcode44 \the\catcode44\relax % ,
- \catcode45 \the\catcode45\relax % -
- \catcode46 \the\catcode46\relax % .
- \catcode61 \the\catcode61\relax % =
- \catcode64 \the\catcode64\relax % @
- \noexpand\endinput
+\expandafter\edef\csname etexcmds@AtEnd\endcsname{%
+ \catcode64 \the\catcode64\relax
}
-\catcode44 12 % ,
-\catcode45 12 % -
-\catcode46 12 % .
-\catcode61 12 % =
\catcode64 11 % @
+\def\TMP@EnsureCode#1#2{%
+ \edef\etexcmds@AtEnd{%
+ \etexcmds@AtEnd
+ \catcode#1 \the\catcode#1\relax
+ }%
+ \catcode#1 #2\relax
+}
+\TMP@EnsureCode{44}{12}% ,
+\TMP@EnsureCode{45}{12}% -
+\TMP@EnsureCode{46}{12}% .
+\TMP@EnsureCode{47}{12}% /
+\TMP@EnsureCode{61}{12}% =
% \end{macrocode}
%
% \subsection{Load package \xpackage{infwarerr}}
@@ -283,7 +302,7 @@ and the derived files
\expandafter\ifx\csname RequirePackage\endcsname\relax
\input infwarerr.sty\relax
\else
- \RequirePackage{infwarerr}%
+ \RequirePackage{infwarerr}[2007/09/09]%
\fi
% \end{macrocode}
%
@@ -333,47 +352,101 @@ and the derived files
% \end{macro}
%
% \begin{macrocode}
-\InfWarErr@End
+\etexcmds@AtEnd
%</package>
% \end{macrocode}
%
% \section{Test}
%
+% \subsection{Catcode checks for loading}
+%
% \begin{macrocode}
%<*test1>
-\immediate\write16{etexcmds-test1.tex: test file for plainTeX}
+% \end{macrocode}
+% \begin{macrocode}
+\catcode`\@=11 %
+\def\RestoreCatcodes{}
+\count@=0 %
+\loop
+ \edef\RestoreCatcodes{%
+ \RestoreCatcodes
+ \catcode\the\count@=\the\catcode\count@\relax
+ }%
+\ifnum\count@<255 %
+ \advance\count@\@ne
+\repeat
+
+\def\RangeCatcodeInvalid#1#2{%
+ \count@=#1\relax
+ \loop
+ \catcode\count@=15 %
+ \ifnum\count@<#2\relax
+ \advance\count@\@ne
+ \repeat
+}
+\def\Test{%
+ \RangeCatcodeInvalid{0}{47}%
+ \RangeCatcodeInvalid{58}{64}%
+ \RangeCatcodeInvalid{91}{96}%
+ \RangeCatcodeInvalid{123}{255}%
+ \catcode`\@=12 %
+ \catcode`\\=0 %
+ \catcode`\{=1 %
+ \catcode`\}=2 %
+ \catcode`\#=6 %
+ \catcode`\[=12 %
+ \catcode`\]=12 %
+ \catcode`\%=14 %
+ \catcode`\ =10 %
+ \catcode13=5 %
+ \input etexcmds.sty\relax
+ \RestoreCatcodes
+}
+\Test
+\csname @@end\endcsname
+\end
+% \end{macrocode}
+% \begin{macrocode}
+%</test1>
+% \end{macrocode}
+%
+% \subsection{Macro tests}
+%
+% \begin{macrocode}
+%<*test2>
+\immediate\write16{etexcmds-test2.tex: test file for plainTeX}
\input etexcmds.sty\relax
\catcode`\@=11 %
\edef\x{\string\unexpanded}
\edef\y{\meaning\etex@unexpanded}
\ifx\x\y
\else
- \@PackageError{etexcmds-test1}{Test failed}\@ehc
+ \@PackageError{etexcmds-test2}{Test failed}\@ehc
\fi
\end
-%</test1>
+%</test2>
% \end{macrocode}
%
% \begin{macrocode}
-%<*test2>
+%<*test3>
\NeedsTeXFormat{LaTeX2e}
-\ProvidesFile{etexcmds-test2.tex}[2007/05/06 v1.0 Test file for LaTeX]
+\ProvidesFile{etexcmds-test3.tex}[2007/09/09 v1.1 Test file for LaTeX]
\RequirePackage{etexcmds}
\makeatletter
\edef\x{\string\unexpanded}
\edef\y{\meaning\etex@unexpanded}
\ifx\x\y
\else
- \@PackageError{etexcmds-test2}{Test failed}\@ehc
+ \@PackageError{etexcmds-test3}{Test failed}\@ehc
\fi
\stop
-%</test2>
+%</test3>
% \end{macrocode}
%
% \begin{macrocode}
-%<*test3>
+%<*test4>
\NeedsTeXFormat{LaTeX2e}
-\ProvidesFile{etexcmds-test3.tex}[2007/05/06 v1.0 Test file for LaTeX]
+\ProvidesFile{etexcmds-test4.tex}[2007/09/09 v1.1 Test file for LaTeX]
\documentclass{article}
\usepackage{m-pictex}
\usepackage{m-ch-de}
@@ -384,16 +457,17 @@ and the derived files
\edef\y{\meaning\etex@unexpanded}%
\ifx\x\y
\else
- \@PackageWarningNoLine{etexcmds-test3}{Test failed}%
+ \@PackageWarningNoLine{etexcmds-test4}{Test failed}%
\fi
\else
- \@PackageWarningNoLine{etexcmds-test3}{%
+ \@PackageWarningNoLine{etexcmds-test4}{%
Test failed because of ConTeXt%
}%
\fi
\stop
-%</test3>
+%</test4>
% \end{macrocode}
+%
% \section{Installation}
%
% \subsection{Download}
@@ -458,6 +532,7 @@ and the derived files
% etexcmds-test1.tex & doc/latex/oberdiek/etexcmds-test1.tex\\
% etexcmds-test2.tex & doc/latex/oberdiek/etexcmds-test2.tex\\
% etexcmds-test3.tex & doc/latex/oberdiek/etexcmds-test3.tex\\
+% etexcmds-test4.tex & doc/latex/oberdiek/etexcmds-test4.tex\\
% etexcmds.dtx & source/latex/oberdiek/etexcmds.dtx\\
% \end{tabular}^^A
% }^^A
@@ -583,6 +658,12 @@ and the derived files
% \item
% First version.
% \end{Version}
+% \begin{Version}{2007/09/09 v1.1}
+% \item
+% Documentation for \cs{ifetex@unexpanded} added.
+% \item
+% Catcode section rewritten.
+% \end{Version}
% \end{History}
%
% \PrintIndex