| 1 |
[en] |
| 2 |
|
| 3 |
LaTeX-package 'gmdoc-enhance' - some enhancements for gmdoc. |
| 4 |
|
| 5 |
Author: Paul Ebermann <[email protected]> |
| 6 |
License: LPPL 1.3b or later, maintained |
| 7 |
(see http://www.latex-project.org/lppl/). |
| 8 |
|
| 9 |
All Documentation (other than this file) is in german. |
| 10 |
|
| 11 |
This package provides some enhancements for the gmdoc package: |
| 12 |
nicer formatting for multiple line inline comments, |
| 13 |
an ability to "comment out" some code, and a macro to input |
| 14 |
other files in "normal" LaTeX mode. |
| 15 |
|
| 16 |
The package is based on the package gmdoc (from |
| 17 |
Grzegorz `Natror' Murzynowski) and needs it and its |
| 18 |
required packages (gmutil, gmverb, gmiflink, hyperref, |
| 19 |
multicol, color, makeidx). |
| 20 |
|
| 21 |
The typesetting of the documentation needs additionally |
| 22 |
class scrartcl (from KOMA-script) and some LaTeX base |
| 23 |
packages. |
| 24 |
|
| 25 |
The package comes as .dtx + .ins. |
| 26 |
Run "latex gmdoc-enhance.ins" to create the style file (and maybe put |
| 27 |
it to texmf/tex/latex/paul/, if your docstrip is configured |
| 28 |
accordingly), run (after that and maybe updating your TeX hash) |
| 29 |
"latex gmdoc-enhance.dtx" to create the documentation. |
| 30 |
|
| 31 |
Usage |
| 32 |
------- |
| 33 |
|
| 34 |
(1) Write your dtx-files for documenting with gmdoc, not doc. |
| 35 |
(See the gmdoc-documentation for details.) |
| 36 |
|
| 37 |
(2) Put |
| 38 |
\usepackage[...]{gmdoc-enhance} |
| 39 |
in the preamble of the documentation driver. |
| 40 |
(This package itself is calling gmdoc without |
| 41 |
any options - if you need options, put |
| 42 |
\usepackage[...]{gmdoc} before this line.) |
| 43 |
|
| 44 |
(3) Use options and/or user macros to change the look. |
| 45 |
|
| 46 |
(4) If you want visible "commented out" code, change the |
| 47 |
code to use the marker. |
| 48 |
|
| 49 |
Options: |
| 50 |
- - - - |
| 51 |
|
| 52 |
inline - mark more-than-one-line inline comments on the |
| 53 |
following lines with %, and change the look of the |
| 54 |
inline comments a bit. |
| 55 |
|
| 56 |
visible - enable special treating of "comment out" (see below), |
| 57 |
with blue highlight and "!" as marker. |
| 58 |
|
| 59 |
User macros: |
| 60 |
- - - - - - |
| 61 |
|
| 62 |
\InlineCommentsWithPercent - same as option 'inline', but can be |
| 63 |
switched everywhere. |
| 64 |
\normalInlineComments - switch back to normal gmdoc behaviour for |
| 65 |
inline comments. |
| 66 |
|
| 67 |
|
| 68 |
\setVisibleCommentChar{<marker>} - set the visible comment |
| 69 |
marker character to <marker>. This should be a |
| 70 |
single character, preferably of category "other" (12). |
| 71 |
Default is "!" (exclamation mark). |
| 72 |
\setVisibleCommentColor[<model>]{<color>} - indicate which color |
| 73 |
to use for commented out code. This is simply given to |
| 74 |
the color package (more precisely, xcolor), so should |
| 75 |
be in a format recognized by this package. |
| 76 |
Default is nothing (don't change color). |
| 77 |
|
| 78 |
\activateVisibleComments - enable using "commented out" code. |
| 79 |
|
| 80 |
|
| 81 |
\normalInput{<file>} - inputs <file> (if existing), but with normal |
| 82 |
LaTeX catcode conventions active. |
| 83 |
|
| 84 |
|
| 85 |
How to use the "comment out" feature: |
| 86 |
- - - - - - - - - - - - - - - - - - - |
| 87 |
|
| 88 |
This is useful if you (for debugging purposes, for example) |
| 89 |
want to deactivate some code, but also don't want it to be |
| 90 |
executed in the documentation part (which would give often some |
| 91 |
strange error messages. |
| 92 |
|
| 93 |
One way to solve this (without this package) would be using |
| 94 |
%^^A or %^^B on the beginning of these lines (to ignore these |
| 95 |
completely). |
| 96 |
With this package, you can show this code as commented out in |
| 97 |
the output. |
| 98 |
|
| 99 |
Some example code: |
| 100 |
|
| 101 |
--- |
| 102 |
\ifx aa |
| 103 |
%!\doSomething% do something -- commented out. |
| 104 |
\doAnotherthing% do something other instead. |
| 105 |
\fi |
| 106 |
--- |
| 107 |
|
| 108 |
So, after the first %, put your comment marker (default !), and |
| 109 |
then more TeX code. Until the next %, it is shown as commented out |
| 110 |
code, then begins an inline comment. |
| 111 |
|
| 112 |
|
| 113 |
Have fun! |
| 114 |
|
| 115 |
------------- |
| 116 |
[de] |
| 117 |
|
| 118 |
LaTeX-Paket 'gmdoc-enhance' - Verbesserungen für gmdoc. |
| 119 |
|
| 120 |
Autor: Paul Ebermann ([email protected]). |
| 121 |
Lizenz: LPPL 1.3b oder später, mit Maintenance-Status |
| 122 |
"author-maintained". Siehe http://www.latex-project.org/lppl/. |
| 123 |
|
| 124 |
Geschrieben für eigenen Gebrauch |
| 125 |
(d.h. die Dokumentation von LaTeX-Paketen von Paul Ebermann), aber |
| 126 |
vielleicht ist es auch für andere von Nutzen. |
| 127 |
|
| 128 |
Dieses Package basiert auf gmdoc von Grzegorz `Natror' Murzynowski |
| 129 |
zur Dokumentation von (La)TeX-Paketen und fügt ein paar weitere |
| 130 |
nützliche Funktionen hinzu, wie Markierung der inline-Kommentare |
| 131 |
als solche auch in Folgezeilen, sichtbare Kommentare (auskommentierter |
| 132 |
Code), und die Möglichkeit, andere LaTeX-Dateien im normalen Modus |
| 133 |
einzubinden (anstatt im gmdoc-Modus). |
| 134 |
|
| 135 |
Das Paket kommt als .dtx + .ins. |
| 136 |
Mit "latex gmdoc-enhance.ins" wird die .sty-Datei erstellt (und |
| 137 |
eventuell gleich nach texmf/tex/latex/paul/ installiert, |
| 138 |
wenn docstrip entsprechend eingerichtet ist), mit |
| 139 |
"latex gmdoc-enhance.dtx" kann (danach und eventuell nach einer |
| 140 |
Aktualisierung der TeX-Dateidatenbank) die Dokumentation neu |
| 141 |
erstellt werden. |
| 142 |
|
| 143 |
Zur Verwendung siehe pauldoc.pdf. |
| 144 |
|
| 145 |
---------- |
| 146 |
[eo] |
| 147 |
|
| 148 |
LaTeX-pakaĵo 'gmdoc-enhance' - plibonigoj por gmdoc. |
| 149 |
(Se vi ne scias, kio estas gmdoc, legu sube.) |
| 150 |
|
| 151 |
Aŭtoro: Paŭlo Ebermann ([email protected]). |
| 152 |
Licenzo: LPPL 1.3, 'maintained' |
| 153 |
(-> http://www.latex-project.org/lppl/). |
| 154 |
|
| 155 |
Kreitaj por propra uzo, sed eble iom de ĝi ankaŭ |
| 156 |
uzeblas por aliaj. |
| 157 |
|
| 158 |
La dokumentaro (escepte tiu ĉi dosiero) estas nur en la germana |
| 159 |
lingvo. |
| 160 |
|
| 161 |
La pakaĵo estas bazita sur la pakaĵo gmdoc (de Grzegorz |
| 162 |
`Natror' Murzynowski) kaj bezonas ĝin kaj ĝiajn bezonatajn |
| 163 |
pakaĵojn (laŭ ties dokumentaĵo: gmutil, gmverb, gmiflink, |
| 164 |
hyperref, multicol, color, makeidx). |
| 165 |
|
| 166 |
Por produkti la dokumentaĵon, vi ankaŭ bezonas la |
| 167 |
dokument-klason scrartcl (de KOMA-script) kaj kelkajn bazajn |
| 168 |
LaTeX-pakaĵoj. |
| 169 |
|
| 170 |
La pakaĵo venas en .dtx + .ins. |
| 171 |
Voku "latex gmdoc-enhance.ins" por krei la .sty-dosieron (kaj |
| 172 |
eble meti ĝin al texmf/tex/latex/paul/, se via docstrip estis |
| 173 |
konfigurita laŭe), voku "latex gmdoc-enhance.dtx" por rekrei |
| 174 |
la dokumentaron. |
| 175 |
|
| 176 |
|
| 177 |
Uzado |
| 178 |
------- |
| 179 |
|
| 180 |
Enkonduko (Kio estas gmdoc) |
| 181 |
- - - - - - - - - - - - - - |
| 182 |
|
| 183 |
gmdoc estas alternativa sistemo (al doc) por dokumenti |
| 184 |
(La)TeX-pakaĵojn. Oni tiel ne plu bezonas marki ĉiujn |
| 185 |
kodo-pecojn, sed gmdoc mem trovas ĝin. |
| 186 |
Ankaŭ eblas uzi komentojn en la sama linio kiel kodo, kiu |
| 187 |
poste tamen povas daŭrigi en pluraj linioj. |
| 188 |
|
| 189 |
Se vi volas krei proprajn LaTeX-pakaĵojn, pripensu uzi ĝin |
| 190 |
anstataŭ la doc-pakaĵo, kiu estas liverita kun LaTeX mem. |
| 191 |
|
| 192 |
(La kodo de via pakaĵo ja aspektas iom alie, depende de la |
| 193 |
elekto.) |
| 194 |
|
| 195 |
Por vidi ekzemplojn de gmdoc-komentita kodo, rigardu la |
| 196 |
fontokodon de tiu pakaĵo (gmdoc-enhance.dtx), la pakaĵo |
| 197 |
monatnomoj, aŭ la pakaĵojn de Grzegorz `Natror' Murzynowski |
| 198 |
(gm*.sty/gm*.cls). |
| 199 |
|
| 200 |
gmdoc-enhance (tiu ĉi pakaĵo) nun aldonas kelkajn funkciojn, |
| 201 |
kiujn mi konsideris mankantaj en gmdoc. |
| 202 |
|
| 203 |
|
| 204 |
Kiel uzi |
| 205 |
- - - - - |
| 206 |
|
| 207 |
(1) Kiel supre menciite, necesas formati/dokumenti vian pakaĵon |
| 208 |
por uzo kun gmdoc. (Tio fakte estas pli facila ol por doc.) |
| 209 |
|
| 210 |
(2) Metu |
| 211 |
|
| 212 |
\usepackage[...]{gmdoc-enhance} |
| 213 |
|
| 214 |
en la kapliniojn de la dokumentaĵ-stirilo. |
| 215 |
|
| 216 |
(3) adaptu la opciojn kaj/aŭ uzu individuajn makroojn |
| 217 |
(vidu sube). |
| 218 |
|
| 219 |
(4) Se vi volas forkomenti kodon, uzu la markilon. |
| 220 |
|
| 221 |
Opcioj: |
| 222 |
- - - - |
| 223 |
|
| 224 |
|
| 225 |
inline - marku sekvajn liniojn se en-liniaj komentoj komence |
| 226 |
per %, kaj krome iom ŝanĝu la aspekton de tiuj |
| 227 |
komentoj. |
| 228 |
|
| 229 |
visible - ŝaltu la specialan traktadon de for-komentita kodo, |
| 230 |
kun blua koloro. |
| 231 |
|
| 232 |
Uzantaj makrooj: |
| 233 |
- - - - - - - - |
| 234 |
|
| 235 |
\InlineCommentsWithPercent - ŝaltu la 'inline'-opcion, ekde |
| 236 |
la loko, kie ĝi aperas. |
| 237 |
\normalInlineComments - reŝaltu al la normala gmdoc-aspekto. |
| 238 |
|
| 239 |
\setVisibleCommentChar{<markilo>} - indikas, kiu signo estu la |
| 240 |
markilo por forkomentita kodo. Tiu estu signo el kategorio |
| 241 |
"aliaj" (12). |
| 242 |
Defaŭlto estas "!" (eksklamsigno). |
| 243 |
\setVisibleCommentColor[<kolormodelo>]{<koloro>} - indikas, per kiu |
| 244 |
koloro marki la forkomentitan kodon. <kolormodelo> povas |
| 245 |
esti forlasita, tiam <koloro> estu nomita koloro konata |
| 246 |
al la xcolor-pakaĵo. Alikaze <kolormodelo> indiku iun |
| 247 |
kolormodelon konatan al xcolor, kaj <koloro> iun koloron |
| 248 |
en tiu kolormodelo. (Ni nur pludonas la informojn al |
| 249 |
xcolor, ne mem traktas ilin.) |
| 250 |
Defaŭlto estas nenio, t.e. tute ne ŝanĝi la koloron. |
| 251 |
\activateVisibleComments - ŝaltu la uzadon de forkomentita kodo |
| 252 |
ekde tiu momento. |
| 253 |
|
| 254 |
|
| 255 |
\normalInput{<dosiero>} - legas kaj interpretas la enhavon de <dosiero> |
| 256 |
kun la normalaj \LaTeX-konvencioj aktivaj (ne la gmdoc-specifaj |
| 257 |
specialaĵoj). |
| 258 |
|
| 259 |
Kiel forkomenti kodon |
| 260 |
- - - - - - - - - - - |
| 261 |
|
| 262 |
Tiu funkcio estas uzenda, se vi volas forigi iujn partojn |
| 263 |
(kutime tutajn liniojn) de la kodo portempe, sed ilia TeX-codo |
| 264 |
ne estu parto de la komento (kiu povas kaŭzi strangajn erarojn), |
| 265 |
sed aperu kiel "forkomentita" en la rezulto. |
| 266 |
|
| 267 |
(Ĉe normala doc-moduso tiu problemo ne okazas, ĉar tie ne |
| 268 |
eblas havi tiujn en-liniajn komentojn.) |
| 269 |
|
| 270 |
Por fari tion, uzu '%!' por komenci vian forkomentitan kodon, |
| 271 |
kaj poste aperu '%' kun normala en-linia komento (eble malplena). |
| 272 |
|
| 273 |
Jen ekzemplo: |
| 274 |
--- |
| 275 |
\ifx aa |
| 276 |
%!\doSomething% faru ion -- forkomentita. |
| 277 |
\doAnotherthing% faru ion alian anstataŭe. |
| 278 |
\fi |
| 279 |
--- |
| 280 |
|
| 281 |
La ! ne aperas, la '%\doSomething%' ja. |
| 282 |
(Kaj anstataŭ ! endas uzi alian signon, se vi ŝanĝis ĝin |
| 283 |
per \setVisibleCommentChar.) |
| 284 |
|
| 285 |
|
| 286 |
Bonan dokumentadon! |