summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/latex
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/source/latex')
-rw-r--r--Master/texmf-dist/source/latex/oberdiek/letltxmacro.dtx280
-rw-r--r--Master/texmf-dist/source/latex/oberdiek/oberdiek.ins2
-rw-r--r--Master/texmf-dist/source/latex/oberdiek/oberdiek.tex4
3 files changed, 255 insertions, 31 deletions
diff --git a/Master/texmf-dist/source/latex/oberdiek/letltxmacro.dtx b/Master/texmf-dist/source/latex/oberdiek/letltxmacro.dtx
index 76f41e6f084..6a87fb4434a 100644
--- a/Master/texmf-dist/source/latex/oberdiek/letltxmacro.dtx
+++ b/Master/texmf-dist/source/latex/oberdiek/letltxmacro.dtx
@@ -17,7 +17,8 @@
% This work consists of the main source file letltxmacro.dtx
% and the derived files
% letltxmacro.sty, letltxmacro.pdf, letltxmacro.ins, letltxmacro.drv,
-% letltxmacro-test1.tex, letltxmacro-test2.tex.
+% letltxmacro-showcases.tex, letltxmacro-test1.tex,
+% letltxmacro-test2.tex.
%
% Distribution:
% CTAN:macros/latex/contrib/oberdiek/letltxmacro.dtx
@@ -52,6 +53,7 @@
% Installation:
% TDS:tex/latex/oberdiek/letltxmacro.sty
% TDS:doc/latex/oberdiek/letltxmacro.pdf
+% TDS:doc/latex/oberdiek/letltxmacro-showcases.tex
% TDS:doc/latex/oberdiek/test/letltxmacro-test1.tex
% TDS:doc/latex/oberdiek/test/letltxmacro-test2.tex
% TDS:source/latex/oberdiek/letltxmacro.dtx
@@ -69,7 +71,7 @@
\input docstrip.tex
\Msg{************************************************************************}
\Msg{* Installation}
-\Msg{* Package: letltxmacro 2008/06/09 v1.0 Let assignment for LaTeX macros (HO)}
+\Msg{* Package: letltxmacro 2008/06/12 v1.1 Let assignment for LaTeX macros (HO)}
\Msg{************************************************************************}
\keepsilent
@@ -97,7 +99,8 @@ This Current Maintainer of this work is Heiko Oberdiek.
This work consists of the main source file letltxmacro.dtx
and the derived files
letltxmacro.sty, letltxmacro.pdf, letltxmacro.ins, letltxmacro.drv,
- letltxmacro-test1.tex, letltxmacro-test2.tex.
+ letltxmacro-showcases.tex, letltxmacro-test1.tex,
+ letltxmacro-test2.tex.
\endpreamble
\let\MetaPrefix\DoubleperCent
@@ -107,6 +110,8 @@ and the derived files
\file{letltxmacro.drv}{\from{letltxmacro.dtx}{driver}}%
\usedir{tex/latex/oberdiek}%
\file{letltxmacro.sty}{\from{letltxmacro.dtx}{package}}%
+ \usedir{doc/latex/oberdiek}%
+ \file{letltxmacro-showcases.tex}{\from{letltxmacro.dtx}{showcases}}%
\usedir{doc/latex/oberdiek/test}%
\file{letltxmacro-test1.tex}{\from{letltxmacro.dtx}{test1}}%
\file{letltxmacro-test2.tex}{\from{letltxmacro.dtx}{test2}}%
@@ -139,7 +144,7 @@ and the derived files
%<*driver>
\NeedsTeXFormat{LaTeX2e}
\ProvidesFile{letltxmacro.drv}%
- [2008/06/09 v1.0 Let assignment for LaTeX macros (HO)]%
+ [2008/06/12 v1.1 Let assignment for LaTeX macros (HO)]%
\documentclass{ltxdoc}
\usepackage{holtxdoc}[2007/11/11]
\begin{document}
@@ -148,7 +153,7 @@ and the derived files
%</driver>
% \fi
%
-% \CheckSum{470}
+% \CheckSum{646}
%
% \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
@@ -169,7 +174,7 @@ and the derived files
% \GetFileInfo{letltxmacro.drv}
%
% \title{The \xpackage{letltxmacro} package}
-% \date{2008/06/09 v1.0}
+% \date{2008/06/12 v1.1}
% \author{Heiko Oberdiek\\\xemail{oberdiek@uni-freiburg.de}}
%
% \maketitle
@@ -221,16 +226,168 @@ and the derived files
% that are derived from \cs{SavedMacro}'s macro name. Macro \cs{Macro}
% can now be redefined without affecting \cs{SavedMacro}.
%
+% \subsection{Supported macro definition commands}
+%
+% \begin{quote}
+% \begin{tabular}{@{}ll@{}}
+% \cs{newcommand}, \cs{renewcommand} & latex/base\\
+% \cs{newenvironment}, \cs{renewenvironment} & latex/base\\
+% \cs{DeclareRobustCommand}& latex/base\\
+% \cs{newrobustcmd}, \cs{renewrobustcmd} & etoolbox\\
+% \end{tabular}
+% \end{quote}
+%
% \StopEventually{
% }
%
% \section{Implementation}
%
+% \subsection{Show cases}
+%
+% \subsubsection{\xfile{letltxmacro-showcases.tex}}
+%
+% \begin{macrocode}
+%<*showcases>
+\NeedsTeXFormat{LaTeX2e}
+\makeatletter
+% \end{macrocode}
+% \begin{macro}{\Line}
+% The result is displayed by macro \cs{Line}. The percent symbol
+% at line start allows easy grepping and inserting into the DTX
+% file.
+% \begin{macrocode}
+\newcommand*{\Line}[1]{%
+ \typeout{\@percentchar#1}%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macrocode}
+\newcommand*{\ShowCmdName}[1]{%
+ \@ifundefined{#1}{}{%
+ \Line{%
+ \space\space(\expandafter\string\csname#1\endcsname) = %
+ (\expandafter\meaning\csname#1\endcsname)%
+ }%
+ }%
+}
+\newcommand*{\ShowCmds}[1]{%
+ \ShowCmdName{#1}%
+ \ShowCmdName{#1 }%
+ \ShowCmdName{\\#1}%
+ \ShowCmdName{\\#1 }%
+}
+\let\\\@backslashchar
+% \end{macrocode}
+% \begin{macro}{\ShowDef}
+% \begin{macrocode}
+\newcommand*{\ShowDef}[2]{%
+ \begingroup
+ \Line{}%
+ \newcommand*{\DefString}{#2}%
+ \@onelevel@sanitize\DefString
+ \Line{\DefString}%
+ #2%
+ \ShowCmds{#1}%
+ \endgroup
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macrocode}
+\typeout{}
+\Line{* LaTeX definitions:}
+\ShowDef{cmd}{%
+ \newcommand{\cmd}[2][default]{}%
+}
+\ShowDef{cmd}{%
+ \DeclareRobustCommand{\cmd}{}%
+}
+\ShowDef{cmd}{%
+ \DeclareRobustCommand{\cmd}[2][default]{}%
+}
+\typeout{}
+\RequirePackage{etoolbox}\relax
+\Line{}
+\Line{* etoolbox's robust definitions:}
+\ShowDef{cmd}{%
+ \newrobustcmd{\cmd}{}%
+}
+\ShowDef{cmd}{%
+ \newrobustcmd{\cmd}[2][default]{}%
+}
+% \end{macrocode}
+% \iffalse
+% ^^A \robustify is still broken in etoolbox v1.5.
+% \begin{macrocode}
+%<*disabled>
+\Line{}
+\Line{* etoolbox's \string\robustify:}
+\ShowDef{cmd}{%
+ \newcommand{\cmd}[2][default]{} %
+ \robustify{\cmd}%
+}
+\ShowDef{cmd}{%
+ \DeclareRobustCommand{\cmd}{} %
+ \robustify{\cmd}%
+}
+\ShowDef{cmd}{%
+ \DeclareRobustCommand{\cmd}[2][default]{} %
+ \robustify{\cmd}%
+}
+%</disabled>
+% \end{macrocode}
+% \fi
+% \begin{macrocode}
+\typeout{}
+% \end{macrocode}
+% \begin{macrocode}
+\@@end
+%</showcases>
+% \end{macrocode}
+%
+% \subsubsection{Result}
+%
+% \begingroup
+% \makeatletter
+% \let\org@verbatim\@verbatim
+% \def\@verbatim{^^A
+% \org@verbatim
+% \catcode`\~=\active
+% }^^A
+% \let~\textvisiblespace
+%\begin{verbatim}
+%* LaTeX definitions:
+%
+%\newcommand {\cmd }[2][default]{}
+% (\cmd) = (macro:->\@protected@testopt \cmd \\cmd {default})
+% (\\cmd) = (\long macro:[#1]#2->)
+%
+%\DeclareRobustCommand {\cmd }{}
+% (\cmd) = (macro:->\protect \cmd~ )
+% (\cmd~) = (\long macro:->)
+%
+%\DeclareRobustCommand {\cmd }[2][default]{}
+% (\cmd) = (macro:->\protect \cmd~ )
+% (\cmd~) = (macro:->\@protected@testopt \cmd~ \\cmd~ {default})
+% (\\cmd~) = (\long macro:[#1]#2->)
+%
+%* etoolbox's robust definitions:
+%
+%\newrobustcmd {\cmd }{}
+% (\cmd) = (\protected\long macro:->)
+%
+%\newrobustcmd {\cmd }[2][default]{}
+% (\cmd) = (\protected macro:->\@testopt \\cmd {default})
+% (\\cmd) = (\protected\long macro:[#1]#2->)
+%\end{verbatim}
+% \endgroup
+%
+% \subsection{Package}
+%
% \begin{macrocode}
%<*package>
% \end{macrocode}
%
-% \subsection{Catcodes and identification}
+% \subsubsection{Catcodes and identification}
%
% \begin{macrocode}
\begingroup
@@ -265,16 +422,21 @@ and the derived files
\TMP@EnsureCode{58}{12}% :
\TMP@EnsureCode{61}{12}% =
\TMP@EnsureCode{62}{12}% >
+\edef\llm@AtEnd{%
+ \llm@AtEnd
+ \escapechar\the\escapechar\relax
+}
+\escapechar=92 % `\\
% \end{macrocode}
%
% Package identification.
% \begin{macrocode}
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{letltxmacro}%
- [2008/06/09 v1.0 Let assignment for LaTeX macros (HO)]
+ [2008/06/12 v1.1 Let assignment for LaTeX macros (HO)]
% \end{macrocode}
%
-% \subsection{Package}
+% \subsubsection{Main macros}
%
% \begin{macro}{\LetLtxMacro}
% \begin{macrocode}
@@ -305,18 +467,30 @@ and the derived files
% \begin{macro}{\llm@LetLtxMacro}
% \begin{macrocode}
\def\llm@LetLtxMacro#1#2{%
- \expandafter\llm@CheckParams\meaning#2{}{}{}{}{}{}{}{}\@nil{%
+ \expandafter\llm@CheckParams\meaning#2:->\@nil{%
\begingroup
- \edef\x{%
- \noexpand\@protected@testopt
- \noexpand#2%
- \expandafter\noexpand\csname\string#2\endcsname
- }%
- \expandafter\expandafter\expandafter\def
- \expandafter\expandafter\expandafter\y
- \expandafter\expandafter\expandafter{%
- \expandafter\llm@CarThree#2{}{}{}\llm@nil
- }%
+ \ifx\llm@protected\@empty
+ \edef\x{%
+ \noexpand\@protected@testopt
+ \noexpand#2%
+ \expandafter\noexpand\csname\string#2\endcsname
+ }%
+ \expandafter\expandafter\expandafter\def
+ \expandafter\expandafter\expandafter\y
+ \expandafter\expandafter\expandafter{%
+ \expandafter\llm@CarThree#2{}{}{}\llm@nil
+ }%
+ \else
+ \edef\x{%
+ \noexpand\@testopt
+ \expandafter\noexpand\csname\string#2\endcsname
+ }%
+ \expandafter\expandafter\expandafter\def
+ \expandafter\expandafter\expandafter\y
+ \expandafter\expandafter\expandafter{%
+ \expandafter\llm@CarTwo#2{}{}\llm@nil
+ }%
+ \fi
\expandafter\endgroup\ifx\x\y
\begingroup
\def\@protected@testopt##1##2##3{%
@@ -328,6 +502,14 @@ and the derived files
{\the\toks@}%
}%
}%
+ \def\@testopt##1##2{%
+ \toks@={##2}%
+ \protected\xdef\llm@GlobalTemp{%
+ \noexpand\@testopt
+ \expandafter\noexpand\csname\string#1\endcsname
+ {\the\toks@}%
+ }%
+ }%
#2%
\endgroup
\let#1=\llm@GlobalTemp
@@ -344,29 +526,48 @@ and the derived files
% \end{macro}
% \begin{macro}{\llm@CheckParams}
% \begin{macrocode}
-\def\llm@CheckParams#1#2#3#4#5#6#7#8#9\@nil{%
+\def\llm@CheckParams#1:->#2\@nil{%
\begingroup
- \def\x{#1#2#3#4#5#6#7#8}%
- \@onelevel@sanitize\x
- \expandafter\endgroup\ifx\x\llm@macro
+ \def\x{#1}%
+ \ifx\x\llm@macro
+ \endgroup
+ \def\llm@protected{}%
\expandafter\@firstoftwo
\else
- \expandafter\@secondoftwo
+ \ifx\x\llm@protectedmacro
+ \endgroup
+ \def\llm@protected{\protected}%
+ \expandafter\expandafter\expandafter\@firstoftwo
+ \else
+ \endgroup
+ \expandafter\expandafter\expandafter\@secondoftwo
+ \fi
\fi
}
% \end{macrocode}
% \end{macro}
% \begin{macro}{\llm@macro}
% \begin{macrocode}
-\def\llm@macro{macro:->}
+\def\llm@macro{macro}
\@onelevel@sanitize\llm@macro
% \end{macrocode}
% \end{macro}
+% \begin{macro}{\llm@protectedmacro}
+% \begin{macrocode}
+\def\llm@protectedmacro{\protected macro}
+\@onelevel@sanitize\llm@protectedmacro
+% \end{macrocode}
+% \end{macro}
% \begin{macro}{\llm@CarThree}
% \begin{macrocode}
\def\llm@CarThree#1#2#3#4\llm@nil{#1#2#3}%
% \end{macrocode}
% \end{macro}
+% \begin{macro}{\llm@CarTwo}
+% \begin{macrocode}
+\def\llm@CarTwo#1#2#3\llm@nil{#1#2}%
+% \end{macrocode}
+% \end{macro}
%
% \begin{macrocode}
\llm@AtEnd
@@ -418,7 +619,7 @@ and the derived files
\catcode`\%=14 %
\catcode`\ =10 %
\catcode13=5 %
- \RequirePackage{letltxmacro}[2008/06/09]\relax
+ \RequirePackage{letltxmacro}[2008/06/12]\relax
\RestoreCatcodes
}
\Test
@@ -439,7 +640,7 @@ and the derived files
\nofiles
\documentclass{minimal}
-\usepackage{letltxmacro}[2008/06/09]
+\usepackage{letltxmacro}[2008/06/12]
\usepackage{qstest}
\IncludeTests{*}
@@ -535,6 +736,24 @@ and the derived files
% \end{macrocode}
%
% \begin{macrocode}
+\usepackage{etoolbox}
+
+\begin{qstest}{newrobustcmd}{newrobustcmd}
+ \newrobustcmd{\TestA}[1][\default]{TestA}%
+ \SaveA
+ \LetLtxMacro\TestB\TestA
+ \TestDef{TestB}{\@testopt \\TestB {\default }}%
+ \protected\edef\TestC{%
+ \noexpand\@testopt
+ \expandafter\noexpand\csname\string\TestB\endcsname
+ {\noexpand\default}%
+ }%
+ \TestEquals{TestB}{TestC}%
+ \CheckA
+\end{qstest}
+% \end{macrocode}
+%
+% \begin{macrocode}
\csname @@end\endcsname
% \end{macrocode}
% \begin{macrocode}
@@ -602,6 +821,7 @@ and the derived files
% \begin{tabular}{@{}>{\ttfamily}l@{ $\rightarrow$ }>{\ttfamily}l@{}}
% letltxmacro.sty & tex/latex/oberdiek/letltxmacro.sty\\
% letltxmacro.pdf & doc/latex/oberdiek/letltxmacro.pdf\\
+% letltxmacro-showcases.tex & doc/latex/oberdiek/letltxmacro-showcases.tex\\
% test/letltxmacro-test1.tex & doc/latex/oberdiek/test/letltxmacro-test1.tex\\
% test/letltxmacro-test2.tex & doc/latex/oberdiek/test/letltxmacro-test2.tex\\
% letltxmacro.dtx & source/latex/oberdiek/letltxmacro.dtx\\
@@ -729,6 +949,10 @@ and the derived files
% \item
% First version.
% \end{Version}
+% \begin{Version}{2008/06/12 v1.1}
+% \item
+% Support for \xpackage{etoolbox}'s \cs{newrobustcmd} added.
+% \end{Version}
% \end{History}
%
% \PrintIndex
diff --git a/Master/texmf-dist/source/latex/oberdiek/oberdiek.ins b/Master/texmf-dist/source/latex/oberdiek/oberdiek.ins
index 6b10f392d7d..21ff6a74aff 100644
--- a/Master/texmf-dist/source/latex/oberdiek/oberdiek.ins
+++ b/Master/texmf-dist/source/latex/oberdiek/oberdiek.ins
@@ -1,5 +1,5 @@
% oberdiek.ins
-% 2008/06/09
+% 2008/06/12
%
% Copyright (C) 1999, 2001, 2006 by
% Heiko Oberdiek <oberdiek@uni-freiburg.de>
diff --git a/Master/texmf-dist/source/latex/oberdiek/oberdiek.tex b/Master/texmf-dist/source/latex/oberdiek/oberdiek.tex
index c50a2b59bc7..ef2d5c42e25 100644
--- a/Master/texmf-dist/source/latex/oberdiek/oberdiek.tex
+++ b/Master/texmf-dist/source/latex/oberdiek/oberdiek.tex
@@ -6,7 +6,7 @@
\newcommand*{\Subject}{CTAN:\CTANdir}
\newcommand*{\Author}{Heiko Oberdiek}
\newcommand*{\Email}{oberdiek@uni-freiburg.de}
-\newcommand*{\Date}{2008/06/09}
+\newcommand*{\Date}{2008/06/12}
% Copyright (C) 2006 by
% Heiko Oberdiek <oberdiek@uni-freiburg.de>
@@ -245,7 +245,7 @@
[\entrysep]
\entry{kvsetkeys}{2007/09/29}{1.3}{Key value parser with default handler support}%
[\entrysep]
-\entry{letltxmacro}{2008/06/09}{1.0}{Let assignment for \LaTeX{} macros}%
+\entry{letltxmacro}{2008/06/12}{1.1}{Let assignment for \LaTeX{} macros}%
[\entrysep]
\entry{listingsutf8}{2007/11/11}{1.1}{Adding support for UTF-8 to listings}%
[\entrysep]