summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2006-08-18 23:34:31 +0000
committerKarl Berry <karl@freefriends.org>2006-08-18 23:34:31 +0000
commit1f37334503f1abac4e6f8b3a3b4af1dce55cc967 (patch)
tree184027d808b2e1e9235af299c98c9bfc65073b83 /Master/texmf-dist/source
parent7d049758fd53cb6be4cae08bee1870b3ec06bdb5 (diff)
new package syntrace (17aug06)
git-svn-id: svn://tug.org/texlive/trunk@1979 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/source')
-rw-r--r--Master/texmf-dist/source/latex/syntrace/syntrace.dtx188
-rw-r--r--Master/texmf-dist/source/latex/syntrace/syntrace.ins55
2 files changed, 243 insertions, 0 deletions
diff --git a/Master/texmf-dist/source/latex/syntrace/syntrace.dtx b/Master/texmf-dist/source/latex/syntrace/syntrace.dtx
new file mode 100644
index 00000000000..653603b1a28
--- /dev/null
+++ b/Master/texmf-dist/source/latex/syntrace/syntrace.dtx
@@ -0,0 +1,188 @@
+% \iffalse meta-comment
+%
+% Copyright (C) 2006 by Mathieu Boretti
+%
+% This file may be distributed and/or modified under the
+% conditions of the LaTeX Project Public License, either
+% version 1.3 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.3 or later is part of all distributions of
+% LaTeX version 2003/12/01 or later.
+%
+% The current Maintainer of this work is Mathieu Boretti
+%
+% This work consists of the file syntrace.ins and
+% syntrace.dtx and the derived file syntrace.sty
+%
+%
+% \fi
+% \iffalse
+%<package>\NeedsTeXFormat{LaTeX2e}
+%<package>\ProvidesPackage{syntrace}[2006/08/13 v1.0 Package for dealing with trace in synttree]
+%<package>\RequirePackage{ifthen}
+%<package>\RequirePackage{synttree}
+%
+%<*driver>
+\documentclass{ltxdoc}
+\usepackage{syntrace}
+\usepackage{verbatim}
+\EnableCrossrefs
+\CodelineIndex
+\RecordChanges
+\begin{document}
+ \DocInput{syntrace.dtx}
+\end{document}
+%</driver>
+% \fi
+% \GetFileInfo{syntrace.sty}
+% \title{The \textsf{syntrace} package\thanks{This document corresponds to \textsf{syntrace}~\fileversion, dated~\filedate.}}
+% \author{Mathieu Boretti \\ \texttt{mathieu.boretti@gmail.com}}
+%
+% \maketitle
+%
+% \begin{abstract}
+% This file describe the \textsf{syntrace} package. This package is intended for \LaTeX\ users who must deal with
+% traces in synttree.
+% \end{abstract}
+%
+% \section{Usage}
+% The \textsf{syntrace} package add a way to deal with trace in tree produce using the \textsf{synttree} package.
+%
+% \DescribeMacro{\traceLabel} The |\traceLabel{label}| set and draw a start trace. The parameter is the label to use for
+% the reference.
+%
+% \DescribeMacro{\traceReference} The |\traceReference{ref}| draw a trace linked with the specified reference.
+%
+% \DescribeMacro{\synttree} The |\synttree| is redefined to auto reset the counter of trace at the start of a tree. The |\synttree*| work as the standard |\synttree| command (without auto reseting the counter).
+%
+% \section{Examples}
+% \subsection{Simply example}
+% \begin{verbatim}
+% \synttree[A %
+% [B [C\traceLabel{l1}] [D]] %
+% [E [F] [\traceReference{l1}]]%
+% ]
+% \end{verbatim}
+% \synttree[A %
+% [B [C\traceLabel{l1}] [D]] %
+% [E [F] [\traceReference{l1}]]%
+% ]
+% \subsection{One complexe example}
+% \begin{verbatim}
+% \synttree[AgrP
+% [\traceReference{sujet1}]
+% [Agr'
+% [Arg [\traceReference{verbe1}]]
+% [TP
+% [T'
+% [T [\traceReference{verbe1}]]
+% [VP
+% [DP\traceLabel{sujet1} [.t Le chat]]
+% [V' [V [dort\traceLabel{verbe1}]]]
+% ]
+% ]
+% ]
+% ]
+% ]
+% \end{verbatim}
+% \synttree[AgrP
+% [\traceReference{sujet1}]
+% [Agr'
+% [Arg [\traceReference{verbe1}]]
+% [TP
+% [T'
+% [T [\traceReference{verbe1}]]
+% [VP
+% [DP\traceLabel{sujet1} [.t Le chat]]
+% [V' [V [dort\traceLabel{verbe1}]]]
+% ]
+% ]
+% ]
+% ]
+% ]
+% \section{Implementation}
+%
+% \begin{macro}{syntrace@startvalue}
+% This counter define the start value of the trace numbering
+% \begin{macrocode}
+\newcounter{syntrace@startvalue}
+\setcounter{syntrace@startvalue}{0}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{syntrace@labelcounter}
+% This counter count the trace
+% \begin{macrocode}
+\newcounter{syntrace@labelcounter}
+\setcounter{syntrace@labelcounter}{\arabic{syntrace@startvalue}}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\thesyntrace@labelcounter}
+% This macro display the value of the trace counter
+% \begin{macrocode}
+\renewcommand*{\thesyntrace@labelcounter}{%
+ \alph{syntrace@labelcounter}%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\syntrace@labelletter}
+% This macro display the default letter for the trace
+% \begin{macrocode}
+\newcommand*{\syntrace@labelletter}{%
+ \ensuremath{t}%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\syntrace@displaytrace}
+% This macro display the value of a trace
+% \begin{macrocode}
+\newcommand*{\syntrace@displaytrace}[1]{%
+ \raisebox{-.5\height}{\scriptsize\mbox{#1}}%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\traceLabel}
+% This macro add a start trace
+% \begin{macrocode}
+\newcommand*{\traceLabel}[1]{%
+ \refstepcounter{syntrace@labelcounter}%
+ \syntrace@displaytrace{\thesyntrace@labelcounter}%
+ \label{syntrace-#1}%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\traceLabel}
+% This macro add a reference to a trace
+% \begin{macrocode}
+\newcommand*{\traceReference}[1]{%
+ \syntrace@labelletter\syntrace@displaytrace{\ref{syntrace-#1}}%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\syntrace@reset}
+% This macro reset the trace counter
+% \begin{macrocode}
+\newcommand*{\syntrace@reset}{%
+ \setcounter{syntrace@labelcounter}{\arabic{syntrace@startvalue}}%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{synttree}
+% This macro add the autoreset to the synttree command
+% \begin{macrocode}
+\let\syntrace@syntree=\synttree
+\def\synttree{\@ifstar%
+ \syntrace@syntree%
+ \syntree@star%
+}
+\def\syntree@star{%
+ \syntrace@reset%
+ \syntrace@syntree%
+}
+% \end{macrocode}
+% \end{macro}
+% \Finale
+
+\endinput \ No newline at end of file
diff --git a/Master/texmf-dist/source/latex/syntrace/syntrace.ins b/Master/texmf-dist/source/latex/syntrace/syntrace.ins
new file mode 100644
index 00000000000..552d949b7c2
--- /dev/null
+++ b/Master/texmf-dist/source/latex/syntrace/syntrace.ins
@@ -0,0 +1,55 @@
+%%
+%% Copyright (C) 2006 by Mathieu Boretti
+%%
+%% This file may be distributed and/or modified under the
+%% conditions of the LaTeX Project Public License, either
+%% version 1.3 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.3 or later is part of all distributions of
+%% LaTeX version 2003/12/01 or later.
+%%
+%% The current Maintainer of this work is Mathieu Boretti
+%%
+%% This work consists of the file syntrace.ins and
+%% syntrace.dtx and the derived file syntrace.sty
+%%
+\input docstrip.tex
+\keepsilent
+\usedir{tex/latex/syntrace}
+\preamble
+This is a generated file.
+
+Copyright (C) 2006 by Mathieu Boretti
+
+This file may be distributed and/or modified under the
+conditions of the LaTeX Project Public License, either
+version 1.3 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.3 or later is part of all distributions of
+LaTeX version 2003/12/01 or later.
+
+The current Maintainer of this work is Mathieu Boretti
+
+This work consists of the file syntrace.ins and
+syntrace.dtx and the derived file syntrace.sty
+\endpreamble
+\generate{\file{syntrace.sty}{\from{syntrace.dtx}{package}}}
+\obeyspaces
+\Msg{*****************************************************}
+\Msg{* *}
+\Msg{* To finish the installation you have to move the *}
+\Msg{* following file into a directory searched by LaTeX *}
+\Msg{* *}
+\Msg{* syntrace.sty *}
+\Msg{* *}
+\Msg{* To producre the documentation run the file *}
+\Msg{* syntrace.dtx through LaTeX. *}
+\Msg{* *}
+\Msg{*****************************************************}
+\endbatchfile