summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/gmdoc/gmoldcomm.sty
diff options
context:
space:
mode:
Diffstat (limited to 'macros/latex/contrib/gmdoc/gmoldcomm.sty')
-rw-r--r--macros/latex/contrib/gmdoc/gmoldcomm.sty94
1 files changed, 94 insertions, 0 deletions
diff --git a/macros/latex/contrib/gmdoc/gmoldcomm.sty b/macros/latex/contrib/gmdoc/gmoldcomm.sty
new file mode 100644
index 0000000000..641061ed61
--- /dev/null
+++ b/macros/latex/contrib/gmdoc/gmoldcomm.sty
@@ -0,0 +1,94 @@
+%
+% \GetFileInfo{gmoldcomm.sty}
+% \title{The \pk{gmoldcomm} Package\thfileinfo}
+% \author{Natror (Grzegorz Murzynowski)}
+% \date{\today}
+% \maketitle
+%
+%
+% This is a~package
+% for handling the old comments in \LaTeXe\ Source Files when \LaTeX^^B
+% ing them with the \pk{gmdoc} package.
+%
+% Written by Natror (Grzegorz Murzynowski) 2007/11/10.
+%
+% It's a~part of the \pk{gmdoc} bundle and as such a~subject to the
+% \LaTeX\ Project Public License.
+%
+%
+% \stanza
+% Scan \acro{CS}s and put them in tt. If at beginning of line, precede them
+% with |%|. Obey lines in the commentary.
+% \FileInfo
+
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesPackage{gmoldcomm}
+ [2007/11/10 v0.99 LaTeX old comments handling (GM)]
+
+\newenvironment{oldcomments}{%
+ \catcode`\\=\active
+ \let\do\@makeother
+ \do\$% Not only \acro{CS}s but also special chars occur in the old
+ % comments.
+ \do\|\do\#\do\{\do\}\do\^\do\_\do\&%
+ \gmoc@defbslash
+ \obeylines
+ \StoreMacro\finish@macroscan
+ \def\finish@macroscan{%
+ \@xa\gmd@ifinmeaning\macro@pname\of\gmoc@notprinted%
+ {}{{\tt\ifvmode\%\fi\bslash\macro@pname}}%
+ \gmoc@checkenv
+ }%
+}{}
+
+{\escapechar\m@ne
+\xdef\gmoc@notprinted{\string\begin,\string\end}}
+
+\def\gmoc@maccname{macrocode}
+\def\gmoc@ocname{oldcomments}
+
+
+\foone{%
+ \catcode`\[=1 \catcode`\]=2
+ \catcode`\{=12 \catcode`\}=12 }
+[\def\gmoc@checkenv[%
+ \@ifnextchar{%^^A}
+ [\gmoc@checkenvinn][]]%
+%
+\def\gmoc@checkenvinn{#1}[%
+ \def\gmoc@resa[#1]%
+ \ifx\gmoc@resa\gmoc@maccname
+ \def\next[%
+ \begingroup
+ \def\@currenvir[macrocode]%
+ \RestoreMacro\finish@macroscan
+ \catcode`\\=\z@
+ \catcode`\{=1 \catcode`\}=2
+ \macrocode]%
+ \else
+ \ifx\gmoc@resa\gmoc@ocname
+ \def\next[\end[oldcomments]]%
+ \else
+ \def\next[%
+ % ^^A \typeout[**** detected environment [#1]]%
+ \{#1\}%
+ % ^^A \show\relax
+ ]%
+ \fi
+ \fi
+ \next]%
+]
+
+\foone{%
+ \catcode`\/=\z@
+ \catcode`\\=\active}
+% \CodeEscapeChar\/
+{/def/gmoc@defbslash{%
+ /let\/scan@macro}}
+% \CodeEscapeChar\\
+
+\def\task#1#2{}
+
+\endinput
+
+%\NoEOF