summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/inputtrc/inputtrc.sty
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2010-10-09 23:34:02 +0000
committerKarl Berry <karl@freefriends.org>2010-10-09 23:34:02 +0000
commitd596dc2a92ca45c4459a34b2256896942ab3d60b (patch)
tree5d76623ee30973ce3872d89c2e578669bab78a4f /Master/texmf-dist/tex/latex/inputtrc/inputtrc.sty
parent2b1aece05c5cfa5fb2237f33be13352b8152c50d (diff)
inputtrc 0.1 (8oct10)
git-svn-id: svn://tug.org/texlive/trunk@20030 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/inputtrc/inputtrc.sty')
-rw-r--r--Master/texmf-dist/tex/latex/inputtrc/inputtrc.sty105
1 files changed, 105 insertions, 0 deletions
diff --git a/Master/texmf-dist/tex/latex/inputtrc/inputtrc.sty b/Master/texmf-dist/tex/latex/inputtrc/inputtrc.sty
new file mode 100644
index 00000000000..e75c6fe4724
--- /dev/null
+++ b/Master/texmf-dist/tex/latex/inputtrc/inputtrc.sty
@@ -0,0 +1,105 @@
+\NeedsTeXFormat{LaTeX2e}[1994/12/01]
+\ProvidesPackage{inputtrc}[2010/10/08 v0.1a input tracing (UL)]
+
+%% Copyright (C) 2010 Uwe Lueck,
+%% http://www.contact-ednotes.sty.de.vu
+%% -- author-maintained in the sense of LPPL below --
+%%
+%% This file can be redistributed and/or modified under
+%% the terms of the LaTeX Project Public License; either
+%% version 1.3a of the License, or any later version.
+%% The latest version of this license is in
+%% http://www.latex-project.org/lppl.txt
+%% We did our best to help you, but there is NO WARRANTY.
+%%
+%% Please report bugs, problems, and suggestions via
+%%
+%% http://www.contact-ednotes.sty.de.vu
+%%
+%% === Core Definitions ===
+%% Initializations of indent, current filename, and filename stack:
+\gdef\IT@indent{\IT@indent@unit}
+\xdef\IT@currfile{\jobname\space}
+%% ... TODO: add `.tex' unless ...
+\xdef\IT@filestack{\relax}
+%% ... `\relax' saves braces around job file name
+%% when the file stack is unbuilt.
+%%
+%% |\IT@prim@input{<file>}| will replace \LaTeX's \cs{@@input}
+%% (at certain places, see below).
+\newcommand*{\IT@prim@input}[1]{%
+ \typeout{\IT@indent\IT@currfile INPUTTING #1}%
+%% ... TODO: option to write to `.log' only.
+ \xdef\IT@filestack{{\IT@currfile}\IT@filestack}%
+ \xdef\IT@currfile{#1}%
+ \expandafter \gdef\expandafter \IT@indent\expandafter{%
+ \IT@indent \IT@indent@unit}
+ \@@input#1
+ \expandafter\IT@pop@indent\IT@indent \@nil
+ \expandafter\IT@pop@file \IT@filestack\@nil
+}
+\def\IT@pop@indent#1#2\@nil{\gdef\IT@indent{#2}}
+\def\IT@pop@file #1#2\@nil{%
+ \gdef\IT@currfile{#1}\gdef\IT@filestack{#2}}
+%% ... cf. LaTeX's `\@pushfilename'/`\@popfilename'.
+%%
+%% === Changing \LaTeX\ (Preparations) ===
+%%
+%% Changing \LaTeX's `\@@input'
+%% (that stores \TeX's primitive `\input')
+%% is not easy
+%% (cf. Didier Verna on his 'fink'
+%% package,\footnote{\url{http://ctan.org/pkg/fink}}
+%% also 'inputfile');
+%% but it should suffice to change two of the three
+%% %% <- `the two' was wrong 2010/10/08b ->
+%% \LaTeX\ commands that use `\@@input':
+\newcommand\IT@InputIfFileExists[2]{%
+ \IfFileExists{#1}%
+ {#2\@addtofilelist{#1}\IT@prim@input\@filef@und}}
+%% ... \LaTeX's version is `\long', as opposed to `\@input':
+\newcommand*{\IT@input}[1]{%
+ \IfFileExists{#1}{\IT@prim@input\@filef@und}%
+ {\typeout{No file #1.}}}
+%% ... the third macro using `\@@input' is `\input'---too
+%% difficult for now.
+%%
+%% Storing original \LaTeX:
+\let\IT@ltx@InputIfFileExists\InputIfFileExists
+\let\IT@ltx@input\@input
+%%
+%% === The User Commands ===
+%% |\dotracinginputs| globally activates input tracing:
+\newcommand*{\dotracinginputs}{%
+ \global \let \InputIfFileExists \IT@InputIfFileExists
+ \global \let \@input \IT@input}
+%% |\notracinginputs| globally turns input tracing off:
+\newcommand*{\notracinginputs}{%
+ \global \let \InputIfFileExists \IT@ltx@InputIfFileExists
+ \global \let \@input \IT@ltx@input}
+%% |\setinputindentunit{<cmds>}| globally sets the ``indent unit"---the
+%% default setting is <cmds>~= `\space\space'.
+\newcommand*{\setinputindentunit}{\gdef\IT@indent@unit}
+%%
+\setinputindentunit{\space\space}
+%%
+\endinput
+%%
+%% == Coda ==
+%% You can't overestimate my pride!
+%% \emph{That's one small step for a man---one giant leap for \TeX kind.}
+%%
+%% On the other hand, I probably exhausted the set of possible
+%% trials and errors (becoming euphoric when it suddenly worked).
+%%
+%% \bigskip \noindent \itshape
+%% Dedicated to Koppa Aleph Rio Lord.
+%%
+%% \bigskip \raggedleft
+%% Worms-Pfeddersheim~2010/10/08,~U.~L.
+
+HISTORY
+
+v0.1 2010/10/08 very first, sent to CTAN same day
+v0.1a 2010/10/08 doc corrected: LaTeX commands using \@@input;
+ manual page breaks