diff options
author | Norbert Preining <norbert@preining.info> | 2019-09-02 13:46:59 +0900 |
---|---|---|
committer | Norbert Preining <norbert@preining.info> | 2019-09-02 13:46:59 +0900 |
commit | e0c6872cf40896c7be36b11dcc744620f10adf1d (patch) | |
tree | 60335e10d2f4354b0674ec22d7b53f0f8abee672 /macros/latex/contrib/gmdoc/gmoldcomm.sty |
Initial commit
Diffstat (limited to 'macros/latex/contrib/gmdoc/gmoldcomm.sty')
-rw-r--r-- | macros/latex/contrib/gmdoc/gmoldcomm.sty | 94 |
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 |