summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/syntrace
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/syntrace
Initial commit
Diffstat (limited to 'macros/latex/contrib/syntrace')
-rw-r--r--macros/latex/contrib/syntrace/README3
-rw-r--r--macros/latex/contrib/syntrace/syntrace.dtx251
-rw-r--r--macros/latex/contrib/syntrace/syntrace.ins55
-rw-r--r--macros/latex/contrib/syntrace/syntrace.pdfbin0 -> 62180 bytes
4 files changed, 309 insertions, 0 deletions
diff --git a/macros/latex/contrib/syntrace/README b/macros/latex/contrib/syntrace/README
new file mode 100644
index 0000000000..dcc20f53b4
--- /dev/null
+++ b/macros/latex/contrib/syntrace/README
@@ -0,0 +1,3 @@
+This package add support for trace in tree created using synttree
+package. It provides two commands to (\traceLabel et \traceReference)
+set and use trace.
diff --git a/macros/latex/contrib/syntrace/syntrace.dtx b/macros/latex/contrib/syntrace/syntrace.dtx
new file mode 100644
index 0000000000..cb65d15a9b
--- /dev/null
+++ b/macros/latex/contrib/syntrace/syntrace.dtx
@@ -0,0 +1,251 @@
+% \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/17 v1.1 Package for dealing with trace in syntaxic tree]
+%<package>\RequirePackage{ifthen}
+%<package>\DeclareOption{synttree}{
+%<package>\AtEndOfPackage{%
+%<package>\IfFileExists{synttree.sty}{%
+%<package>\RequirePackage{synttree}\syntraceaddresetmacro{synttree}%
+%<package>}{%
+%<package>\PackageWarning{syntrace}{Unable to locate synttree package}
+%<package>}
+%<package>}
+%<package>}
+%<package>\DeclareOption{qtree}{
+%<package>\AtEndOfPackage{%
+%<package>\IfFileExists{qtree.sty}{%
+%<package>\RequirePackage{qtree}\syntraceaddresetmacro{Tree}%
+%<package>}{%
+%<package>\PackageWarning{syntrace}{Unable to locate qtree package}
+%<package>}
+%<package>}
+%<package>}
+%<package>\DeclareOption{i-start}{
+%<package>\AtEndOfPackage{%
+%<package>\setcounter{syntrace@startvalue}{8}
+%<package>}
+%<package>}
+%<package>\ExecuteOptions{synttree}
+%<package>\ProcessOptions
+%
+%<*driver>
+\documentclass{ltxdoc}
+\usepackage[qtree,i-start]{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{Options}
+%
+% \DescribeMacro{synttree} The |synttree| option add the synttree command of the synttree package to the auto reset commands. With this option, the |\synttree| command is redefined to auto reset trace counter. A |\synttree*| command is add that work like |\synttree|, but without auto reset. This option is enabled is a default options.
+%
+% \DescribeMacro{qtree} The |qtree| option add the Tree command of the qtree package to the auto reset command.
+%
+% \DescribeMacro{i-start} The |i-start| change the first label of trace to i instance of a.
+%
+% \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 end 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{\syntraceresetmacro} The |\syntraceresetmacro{commande name without slash}| add auto-reset to this command.
+%
+% \section{Examples}
+% \subsection{Simply example with synttree}
+% \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 complex example with synttree}
+% \begin{verbatim}
+% \synttree*[AgrP
+% [DP\traceLabel{sujet1} [.t Le chat]]
+% [Agr'
+% [Arg [dort\traceLabel{verbe1}]]
+% [TP
+% [T'
+% [T [\traceReference{verbe1}]]
+% [VP
+% [\traceReference{sujet1}]
+% [V' [V [\traceReference{verbe1}]]]
+% ]
+% ]
+% ]
+% ]
+% ]
+% \end{verbatim}
+% \synttree*[AgrP
+% [DP\traceLabel{sujet1} [.t Le chat]]
+% [Agr'
+% [Arg [dort\traceLabel{verbe1}]]
+% [TP
+% [T'
+% [T [\traceReference{verbe1}]]
+% [VP
+% [\traceReference{sujet1}]
+% [V' [V [\traceReference{verbe1}]]]
+% ]
+% ]
+% ]
+% ]
+% ]
+% \subsection{One example with qtree}
+% \syntraceaddresetmacro{Tree}
+% \begin{verbatim}
+% \Tree [.S [.NP subject\traceLabel{s1} ] [.VP [.V verb ] [.NP \traceReference{s1} ]]]
+% \end{verbatim}
+% \Tree [.S [.NP subject\traceLabel{s1} ] [.VP [.V verb ] [.NP \traceReference{s1} ]]]
+% \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}{\syntraceaddresetmacro}
+% This macro add autoreset to a command and add a starred version to this command that have the default functionnality
+% \begin{macrocode}
+\newcommand*{\syntraceaddresetmacro}[1]{%
+ \expandafter\ifx%
+ \csname syntrace@old@#1\endcsname
+ \relax%
+ \PackageInfo{syntrace}{Adding auto-reset to #1}%
+ \expandafter\let\csname syntrace@old@#1\expandafter\endcsname%
+ \csname #1\endcsname%
+ \expandafter\def\csname#1\endcsname{\@ifstar{%
+ \csname syntrace@old@#1\endcsname%
+ }{%
+ \syntrace@reset%
+ \csname syntrace@old@#1\endcsname%
+ }%
+ }%
+ \else
+ \PackageWarning{syntrace}{#1 allready set as auto-reset}%
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\syntraceremoveresetmacro}
+% This macro remove autoreset to a command
+% \begin{macrocode}
+\newcommand*{\syntraceremoveresetmacro}[1]{%
+ \expandafter\ifx%
+ \csname syntrace@old@#1\endcsname
+ \relax%
+ \PackageWarning{syntrace}{#1 is not set as auto-reset}%
+ \else
+ \PackageInfo{syntrace}{Removing auto-reset from #1}%
+ \expandafter\let\csname #1\expandafter\endcsname%
+ \csname syntrace@old@#1\endcsname%
+ \expandafter\let\csname syntrace@old@#1\expandafter\endcsname\relax%
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+% \Finale
+\endinput \ No newline at end of file
diff --git a/macros/latex/contrib/syntrace/syntrace.ins b/macros/latex/contrib/syntrace/syntrace.ins
new file mode 100644
index 0000000000..552d949b7c
--- /dev/null
+++ b/macros/latex/contrib/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
diff --git a/macros/latex/contrib/syntrace/syntrace.pdf b/macros/latex/contrib/syntrace/syntrace.pdf
new file mode 100644
index 0000000000..a36b5115fb
--- /dev/null
+++ b/macros/latex/contrib/syntrace/syntrace.pdf
Binary files differ