summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/show2e
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2019-09-02 13:46:59 +0900
committerNorbert Preining <norbert@preining.info>2019-09-02 13:46:59 +0900
commite0c6872cf40896c7be36b11dcc744620f10adf1d (patch)
tree60335e10d2f4354b0674ec22d7b53f0f8abee672 /macros/latex/contrib/show2e
Initial commit
Diffstat (limited to 'macros/latex/contrib/show2e')
-rw-r--r--macros/latex/contrib/show2e/README37
-rw-r--r--macros/latex/contrib/show2e/show2e-fr.pdfbin0 -> 37333 bytes
-rw-r--r--macros/latex/contrib/show2e/show2e.dtx352
-rw-r--r--macros/latex/contrib/show2e/show2e.pdfbin0 -> 46012 bytes
-rw-r--r--macros/latex/contrib/show2e/show2e.sty55
5 files changed, 444 insertions, 0 deletions
diff --git a/macros/latex/contrib/show2e/README b/macros/latex/contrib/show2e/README
new file mode 100644
index 0000000000..9b655724e4
--- /dev/null
+++ b/macros/latex/contrib/show2e/README
@@ -0,0 +1,37 @@
+ The show2e package
+
+ \show variants for LaTeX2e commands
+
+ Manuel P\'egouri\'e-Gonnard (mpg@elzevir.fr)
+
+
+Presentation
+------------
+
+This small package aims at making debugging (esp. in an interactive way)
+easier, by providing \show variants suited to \LaTeXe's commands (with
+optional arguments or robust) and environments: those variants also
+display the internal macros used by such commands, if any. The \showcs
+variant helps with macros with exotic names.
+
+Contents
+--------
+
+show2e.sty: the package itself
+show2e.pdf: the (English) documentation and documented code
+show2e-fr.pdf: the French documentation
+
+show2e.dtx: source for both documentations and package
+
+Version info
+------------
+
+2008-03-13 v1.0 first release
+
+License
+-------
+
+This material is subject to the LaTeX Project Public License. See
+http://www.ctan.org/tex-archive/help/Catalogue/licenses.lppl.html for the
+details of that license.
+
diff --git a/macros/latex/contrib/show2e/show2e-fr.pdf b/macros/latex/contrib/show2e/show2e-fr.pdf
new file mode 100644
index 0000000000..9f7ac0b2ad
--- /dev/null
+++ b/macros/latex/contrib/show2e/show2e-fr.pdf
Binary files differ
diff --git a/macros/latex/contrib/show2e/show2e.dtx b/macros/latex/contrib/show2e/show2e.dtx
new file mode 100644
index 0000000000..0b2c2c4351
--- /dev/null
+++ b/macros/latex/contrib/show2e/show2e.dtx
@@ -0,0 +1,352 @@
+%
+% \iffalse /!\ this file contains non-ascii -- encoding is utf-8 /!\
+%
+% show2e package by Manuel P\'egouri\'e-Gonnard <mpg@elzevir.fr>
+% --------------------------------------------------------------
+%
+% 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. The latest version of this
+% license is in:
+%
+% http://www.latex-project.org/lppl.txt
+%
+% and version 1.3c or later is part of all distributions of LaTeX
+% version 2006/05/20 or later.
+%
+% This work has the LPPL maintenance status `maintained'.
+%
+% The current maintainer of this work is Manuel P\'egouri\'e-Gonnard.
+%
+% This work consists of the file show2e.dtx and the derived files
+% show2e.sty, show2e.pdf and show2e-fr.pdf.
+%
+%
+%<*gobble>
+\ProvidesFile{show2e.dtx}
+%</gobble>
+%<package>\NeedsTeXFormat{LaTeX2e}
+%<package>\ProvidesPackage{show2e}
+%<*package>
+% \fi
+% \ProvidesFile{show2e.dtx}
+ [2008/03/13 v1.0 \space \show variants for latex2e \space (mpg)]
+% \iffalse
+%</package>
+% \fi
+% \CheckSum{85}
+% \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
+% Lower-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
+% Digits \0\1\2\3\4\5\6\7\8\9
+% Exclamation \! Double quote \" Hash (number) \#
+% Dollar \$ Percent \% Ampersand \&
+% Acute accent \' Left paren \( Right paren \)
+% Asterisk \* Plus \+ Comma \,
+% Minus \- Point \. Solidus \/
+% Colon \: Semicolon \; Less than \<
+% Equals \= Greater than \> Question mark \?
+% Commercial at \@ Left bracket \[ Backslash \\
+% Right bracket \] Circumflex \^ Underscore \_
+% Grave accent \` Left brace \{ Vertical bar \|
+% Right brace \} Tilde \~}
+% \iffalse
+%<*gobble>
+\begingroup
+%</gobble>
+%<*batchfile>
+\input docstrip
+\keepsilent
+\preamble
+
+show2e package by Manuel P\string\'egouri\string\'e-Gonnard %
+<mpg@elzevir.fr>
+This is a generated file. See show2e.dtx for license information.
+
+\endpreamble
+\askforoverwritefalse
+%\generate{\file{show2e.ins}{\from{show2e.dtx}{batchfile}}}
+%\generate{\file{show2e.drv}{\from{show2e.dtx}{driver}}}
+\generate{\file{show2e.sty}{\from{show2e.dtx}{package}}}
+\generate{\file{show2e-fr.drv}{\from{show2e.dtx}{pilote}}}
+%</batchfile>
+%<*gobble>
+\endgroup
+%</gobble>
+%<*driver|pilote>
+\documentclass[oneside, a4paper]{ltxdoc}
+\usepackage[utf8]{inputenc}
+\usepackage[T1]{fontenc}
+\usepackage{lmodern}
+\usepackage[babel=true, expansion=false]{microtype}
+\usepackage{fixltx2e}
+\expandafter\newif\csname iffrenchdoc\endcsname % cachez ce if...
+%<pilote>\frenchdoctrue
+%</driver|pilote>
+%<*gobble>
+\iffrenchdoc
+%</gobble>
+%<*pilote>
+\usepackage[lmargin=4.5cm, rmargin=3cm]{geometry}
+\OnlyDescription
+\usepackage[english, french]{babel}
+\FrenchFootnotes \AddThinSpaceBeforeFootnotes
+\newcommand*\eng[1]{\emph{\foreignlanguage{english}{#1}}}
+\usepackage[bookmarks=false]{hyperref}
+\hypersetup{%
+ pdftitle=L'extension show2e
+ pdfsubject=Une DESCRIPTION}
+%</pilote>
+%<*gobble>
+\else
+%</gobble>
+%<*driver>
+\AlsoImplementation
+\usepackage[english]{babel}
+\usepackage[bookmarks=false]{hyperref}
+\hypersetup{%
+ pdftitle=The show2e package,
+ pdfsubject=A DESCRIPTION}
+\settowidth\MacroIndent{\rmfamily\scriptsize 000\ }
+\setlength\MacroTopsep{0pt}
+\setcounter{tocdepth}{1}
+%</driver>
+%<*gobble>
+\fi
+%</gobble>
+%<*driver|pilote>
+\hypersetup{%
+ colorlinks=true, linkcolor=black, urlcolor=black,
+ pdfauthor=Manuel Pégourié-Gonnard}
+\newcommand\file{\nolinkurl}
+\newcommand\pf{\textsf}
+\newcommand\optstar{\meta{$*$}}
+\newcommand\topcs[1]{\texorpdfstring{\cs{#1}}{#1}}
+\begin{document}
+ \DocInput{show2e.dtx}
+\end{document}
+%</driver|pilote>
+%<*package>
+% \fi
+%
+% \GetFileInfo{show2e.dtx}
+%
+% \title{\iffrenchdoc L'extension \pf{show2e}\else The \pf{show2e} package\fi}
+% \author{Manuel Pégourié-Gonnard\\
+% \href{mailto:mpg@elzevir.fr}{mpg@elzevir.fr}}
+% \date{\fileversion\ (\filedate)}
+%
+% \maketitle
+%
+% \iffrenchdoc\else
+% \bigbreak\noindent
+% \emph{Important note for French readers}: the file
+% \file{show2e-fr.pdf} contains the same documenation in French.
+% \fi
+%
+% \section{Introduction}
+%
+% \iffrenchdoc
+%
+% Cette toute petite extension a pour but de simplifier légèrement le
+% déboguage, notamment interactif, en fournissant quelques variantes de
+% |\show| adaptées aux objets introduits par \LaTeXe{} : commandes à
+% arguments optionnels, commandes robustes, environnements.
+%
+% \else
+%
+% This small package aims at making debugging (esp.\@ in an interactive
+% way) easier, by providing |\show| variants suited to \LaTeXe's
+% commands (with optional arguments or robust) and environments.
+%
+% \fi
+%
+% \section{Usage}
+%
+% \iffrenchdoc
+%
+% \DescribeMacro{\showcmd}
+% La commande |\showcmd| sert à afficher une commande comme le ferait la
+% primitive |\show| de \TeX, mais en effectuant en plus quelques tests
+% pour savoir si la commande est une macro qui prend un argument
+% optionnel (comme on peut en définir avec |\newcommand|), ou qui a été
+% définie comme robuste avec |\DeclareRobustCommand|, ou ultérieurement
+% rendue robuste par |\MakeRobust| (fourni par \pf{fixltx2e}). Dans ce
+% cas, la commande utilise aussi une ou plusieurs macros interne, que
+% |\showcmd| affichera automatiquement pour vous.
+%
+% \DescribeMacro{\showcs}
+% \DescribeMacro{\showenv}
+% La variante |\showcs| fonctionne de la même manière, mais prend comme
+% argument le \emph{nom} de la commande entre accolades : les deux
+% formes |\showcmd\truc| et |\showcs{truc}| sont donc équivalentes.
+% Enfin, |\showenv| montre les definitions de début et de fin d'un
+% environnement.
+%
+% \medbreak
+%
+% C'est tout pour la description des commandes. Il faut bien remarquer
+% qu'elles ne sont pas infaillibles, et ne fonctionnent qu'avec les
+% commandes crées par les macros standard de \LaTeXe{} (et celles de
+% \pf{xargs}, d'ailleurs) : elles n'essayent pas de prendre en compte
+% des usages directs de |\@ifnextchar|, ni même de |\@ifstar| (pour le
+% moment).
+%
+% Pour les curieux, le code commenté apparaît à la fin de la version
+% anglaise de cette documentation
+%
+% \begin{center}\large
+% C'est tout pour cette fois ! \\
+% Amusez-vous bien avec \LaTeX{} !
+% \end{center}
+%
+% \else
+%
+% \DescribeMacro{\showcmd}
+% The |\showcmd| command displays a command like \TeX's |\show|, but
+% with a little bonus: it also checks if the macros takes an optional
+% argument (like some commands defined with |\newcommand| do), or was
+% made robust by using |\DeclareRobustCommand| or \pf{fixltx2e}'s
+% |\MakeRobust|. Such commands use other(s) internal command(s), which
+% |\showcmd| will also display for you.
+%
+% \DescribeMacro{\showcs}
+% \DescribeMacro{\showenv}
+% The |\showcs| command does the same thing as |\showcmd|, but takes the
+% command's \emph{name} as its argument: |\showcmd\truc| is equivalent
+% to |\showcs{truc}|. Finally, the |\showenv| command does the same for
+% environments.
+%
+% \medbreak
+%
+% The previous commands will only work on simple commands defined with
+% standard \LaTeXe{} commands (or, by the way, with \pf{xargs}): they
+% do not try to guess such things as a direct use of |\@ifnextchar|, or
+% even |\@ifstar| (at the moment).
+%
+% \fi
+%
+% \StopEventually{}
+%
+% \section{Implementation}
+%
+% \begin{macro}{\showcmd}
+% The |\showcmd| macro just checks to beginning of the meaning of is
+% argument, in order to decide if there are any internal macro to
+% show too. It also sets a default value for |\escapechar| for sake of
+% readability.
+% \begin{macrocode}
+\newcommand* \showcmd [1] {%
+ \begingroup \escapechar92
+ \show#1%
+ \showe@if@meaning@prefix@NnT #1 {\x@protect}
+ {\showe@show@space@macro@N #1}%
+ \showe@if@meaning@prefix@NnT #1 {\protect}
+ {\showe@show@space@macro@N #1}%
+ \showe@if@meaning@prefix@NoT #1 {\string\@protected@testopt}
+ {\showe@show@backslash@macro@N #1}%
+ \endgroup}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\showcs}
+% \begin{macro}{\showenv}
+% The two variants are only wrappers for |\showcmd|.
+% \begin{macrocode}
+\newcommand* \showcs [1] {%
+ \expandafter \showcmd \csname#1\endcsname}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand* \showenv [1] {%
+ \showcs{#1}%
+ \expandafter \show\csname end#1\endcsname}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \begin{macro}{\showe@show@backslash@macro@N}
+% \begin{macro}{\showe@show@space@macro@N}
+% Macros for showing the internal macros found, either with |\show| or
+% with |\showcmd|.
+% \begin{macrocode}
+\newcommand* \showe@show@backslash@macro@N [1] {%
+ \expandafter \show \csname\string#1\endcsname}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand* \showe@show@space@macro@N [1] {%
+ \begingroup \escapechar\m@ne \expandafter\endgroup
+ \expandafter \showcmd \csname\string#1 \endcsname}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \begin{macro}{\showe@if@meaning@prefix@NnT}
+% \begin{macro}{\showe@if@meaning@prefix@NoT}
+% Check if the second argument is a prefix for the meaning of the first.
+% Variant expanding the second argument once before (named in l3 style).
+% \begin{macrocode}
+\newcommand* \showe@if@meaning@prefix@NnT [2] {%
+ \def \@tempa {#2}%
+ \showe@if@prefix@ooT {\meaning #1} {\meaning \@tempa}}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand* \showe@if@meaning@prefix@NoT [2] {%
+ \expandafter \showe@if@meaning@prefix@NnT
+ \expandafter #1%
+ \expandafter {#2}}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \begin{macro}{\showe@if@prefix@nnT}
+% \begin{macro}{\showe@if@prefix@ooT}
+% Check if string 2 is a prefix of string 1. Variant expanding the two
+% arguments once before checking.
+% \begin{macrocode}
+\newcommand* \showe@if@prefix@nnT [2] {%
+ \def \@tempa ##1#2##2\@nil {%
+ \ifx\empty##2\empty
+ \expandafter\@gobble
+ \else
+ \expandafter\@firstofone
+ \fi}%
+ \@tempa#1#2\@nil}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand* \showe@if@prefix@ooT [2] {%
+ \edef \@tempa {{#1}{#2}}%
+ \expandafter \showe@if@prefix@nnT\@tempa}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+%
+% \bigskip
+% \begin{center}\Large
+% That's all folks!\\
+% Happy \TeX ing!
+% \end{center}
+%
+% \Finale
+%
+% \iffalse
+%</package>
+%<*batchfile>
+% \fi
+% \begingroup\obeyspaces
+% \typeout{*****************************************************}
+% \typeout{* *}
+% \typeout{* To finish the installation you have to move the *}
+% \typeout{* following file into a directory searched by TeX: *}
+% \typeout{* *}
+% \typeout{* show2e.sty *}
+% \typeout{* *}
+% \typeout{* Documentation is in show2e.dvi or show2e.pdf *}
+% \typeout{* *}
+% \typeout{* To produce the french documentation, run *}
+% \typeout{* (pdf)latex show2e-fr.drv *}
+% \typeout{* *}
+% \typeout{* Happy TeXing! *}
+% \typeout{* *}
+% \typeout{*****************************************************}
+% \endgroup
+% \iffalse
+%</batchfile>
+% \fi
+\endinput
diff --git a/macros/latex/contrib/show2e/show2e.pdf b/macros/latex/contrib/show2e/show2e.pdf
new file mode 100644
index 0000000000..2a8af836ac
--- /dev/null
+++ b/macros/latex/contrib/show2e/show2e.pdf
Binary files differ
diff --git a/macros/latex/contrib/show2e/show2e.sty b/macros/latex/contrib/show2e/show2e.sty
new file mode 100644
index 0000000000..20709b2b66
--- /dev/null
+++ b/macros/latex/contrib/show2e/show2e.sty
@@ -0,0 +1,55 @@
+%%
+%% This is file `show2e.sty',
+%% generated with the docstrip utility.
+%%
+%% The original source files were:
+%%
+%% show2e.dtx (with options: `package')
+%%
+%% show2e package by Manuel P\'egouri\'e-Gonnard <mpg@elzevir.fr>
+%% This is a generated file. See show2e.dtx for license information.
+%%
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesPackage{show2e}
+ [2008/03/13 v1.0 \space \show variants for latex2e \space (mpg)]
+\newcommand* \showcmd [1] {%
+ \begingroup \escapechar92
+ \show#1%
+ \showe@if@meaning@prefix@NnT #1 {\x@protect}
+ {\showe@show@space@macro@N #1}%
+ \showe@if@meaning@prefix@NnT #1 {\protect}
+ {\showe@show@space@macro@N #1}%
+ \showe@if@meaning@prefix@NoT #1 {\string\@protected@testopt}
+ {\showe@show@backslash@macro@N #1}%
+ \endgroup}
+\newcommand* \showcs [1] {%
+ \expandafter \showcmd \csname#1\endcsname}
+\newcommand* \showenv [1] {%
+ \showcs{#1}%
+ \expandafter \show\csname end#1\endcsname}
+\newcommand* \showe@show@backslash@macro@N [1] {%
+ \expandafter \show \csname\string#1\endcsname}
+\newcommand* \showe@show@space@macro@N [1] {%
+ \begingroup \escapechar\m@ne \expandafter\endgroup
+ \expandafter \showcmd \csname\string#1 \endcsname}
+\newcommand* \showe@if@meaning@prefix@NnT [2] {%
+ \def \@tempa {#2}%
+ \showe@if@prefix@ooT {\meaning #1} {\meaning \@tempa}}
+\newcommand* \showe@if@meaning@prefix@NoT [2] {%
+ \expandafter \showe@if@meaning@prefix@NnT
+ \expandafter #1%
+ \expandafter {#2}}
+\newcommand* \showe@if@prefix@nnT [2] {%
+ \def \@tempa ##1#2##2\@nil {%
+ \ifx\empty##2\empty
+ \expandafter\@gobble
+ \else
+ \expandafter\@firstofone
+ \fi}%
+ \@tempa#1#2\@nil}
+\newcommand* \showe@if@prefix@ooT [2] {%
+ \edef \@tempa {{#1}{#2}}%
+ \expandafter \showe@if@prefix@nnT\@tempa}
+\endinput
+%%
+%% End of file `show2e.sty'.