summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/nicetext/run/substr.tex
blob: 64f202f0e9dd7510f533072f9d10435fc8595a0c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
\ProvidesFile{substr.tex}[2012/03/18 documentation for substr.sty]
\title{\textsf{substr.sty}\thanks{See 
       \url{http://ctan.org/pkg/substr} for more about 
       \textsf{substr.sty}.}---Substring 
       Functions with \LaTeX}
\author{Harald Harders\thanks{Joint work with Heiko Oberdiek, 
                              one line + documentation tool
                              by Uwe L\"uck.}}
% \listfiles

%% Preprocessing 'substr.sty':
\RequirePackage{makedoc}

%% Replacements:
\SetPatternCodes{\MakeOther\\}
\MakeExpandableAllReplacer{Cmds} 
                          {Commands:}{\SECT{Commands:}}{LEAVE}
\PrependExpandableAllReplacer{Change}{ChangeLog}{\SECT{ChangeLog}}
\PrependExpandableAllReplacer{CR}{Copyright}{\COPYRIGHT}
\PrependExpandableAllReplacer{LaTeX}
               [\MakeOther\ ]{LaTeX }{\LaTeX{} }
\PrependExpandableAllReplacer{HH@}
                             {h.harders@tu-bs.de}
                             {`h.harders@tu-bs.de'\MEDSK}
\PrependExpandableAllReplacer{COMP}
                             {de.comp.text.tex}
                             {`de.comp.text.tex'}
\PrependExpandableAllReplacer{LPPL}
                             {macros/latex/base/lppl.txt}
                             {`macros/latex/base/lppl.txt'}
\PrependExpandableAllReplacer{Hist}[\MakeOther\ ]%
{History of this package:}{\SECT{History of this package:}}
\ResetPatternCodes
\SetCorrectHookJobLast

\HeaderLines{3}
\MainDocParser{\ProcessInputWith{comment}}
\LaTeXresultFile{substr.doc}
\MakeCloseDoc*{substr.sty}

\documentclass{article}

\usepackage{hyperref,makedoc,niceverb} %% niceverb after hyperref!
\AddToNoVerbList{\MEDSK\SECT\textbf\COPYRIGHT,\LaTeX}
\newcommand*{\MEDSK}{\par\medskip}
\newcommand*{\SECT}[1]{\MEDSK\textbf{#1}\nopagebreak\par}
\newcommand*{\COPYRIGHT}{\MEDSK\textbf{Copyright} }
\usepackage[utf8]{inputenc}             %% for v1.2

\pagestyle{myheadings}
\markboth{\textsf{substr.sty}}{\textsf{substr.sty}}
\usepackage{parskip}
\usepackage{ragged2e}                   %% 2012/03/18

\begin{document}
\maketitle

\begin{abstract}\noindent
  This documentation of 'substr.sty' has been typeset 
  by automatical ASCII\slash UTF\hbox{-}8~$\to$ \LaTeX\ 
  enhancement provided by 'makedoc.sty' and 'niceverb.sty''s 
  ``auto mode."\footnote{See 
                         \url{http://ctan.org/pkg/nicetext} 
                         for more on these packages.}
  Some extended formatting---kind of sectioning, 
  switches to `\tt'---have been achieved by string replacements 
  specific to the comment text of the package file 
  (see source file 'substr.tex').

  'substr.sty' especially demonstrates the rather rare 
  \lq`%% '\rq\ style of package comments that is somewhat 
  favoured by 'makedoc' because this way ``true comments" 
  are easily distinguishable from mere ``commenting out."
% 
%   The idea to use 'parskip.sty' for formatting the documentation 
%   (as opposed to the version of the present file of one week ago) 
%   is due to the quite recent 
%   'import.tex'\footnote{\url{http://ctan.org/pkg/import}} 
%   that 
%% ???
\end{abstract}
\sloppy 
\RaggedRight 
% \MakeJobDoc{3}{\ProcessInputWith{comment}}
\AutoCmdInput{substr.doc}
\enlargethispage{\baselineskip}
\end{document}

%% HISTORY
2010/03/18   sent to CTAN
2010/03/27   removed `\usepackage{substr}'
2010/03/28   extended formatting by replacing words
2010/03/29   \SetPatternCodes etc.
2010/03/30   import -> substr; see source file
2011/08/20   \ProvidesFile for fileinfo
2012/03/18   use \MakeCloseDoc*, \enlargethispage, ragged2e