diff options
-rw-r--r-- | Master/texmf-dist/doc/latex/gmdoc/README | 6 | ||||
-rw-r--r-- | Master/texmf-dist/doc/latex/gmdoc/gmdoc.pdf | bin | 3889082 -> 5006687 bytes | |||
-rw-r--r-- | Master/texmf-dist/tex/latex/gmdoc/gmdoc.sty | 1917 | ||||
-rw-r--r-- | Master/texmf-dist/tex/latex/gmdoc/gmdocc.cls | 269 |
4 files changed, 1463 insertions, 729 deletions
diff --git a/Master/texmf-dist/doc/latex/gmdoc/README b/Master/texmf-dist/doc/latex/gmdoc/README index 60b94fe7397..a2e161e1375 100644 --- a/Master/texmf-dist/doc/latex/gmdoc/README +++ b/Master/texmf-dist/doc/latex/gmdoc/README @@ -3,7 +3,7 @@ is a work of Grzegorz Murzynowski, <natror at o2 dot pl> -1. Copyright 2006, 2007, 2008 by Grzegorz `Natror' Murzynowski +1. Copyright 2006, 2007, 2008, 2009, 2010 by Grzegorz `Natror' Murzynowski This program is subject to the LaTeX Project Public License. See http://www.ctan.org/tex-archive/help/Catalogue/licenses.lppl.html @@ -113,13 +113,9 @@ doc_gmdoc.tex (gmsource2e.ist is generated from source2e_gmdoc.tex) gmoldcomm.sty -The base drivers depend on the `gmeometric.sty' -package by Grzegorz Murzynowski, available on CTAN. - These drivers typeset the respective files from the .../texmf-dist/source/latex/base directory of TeXLive2005 distribution. Probably you should redefine the \BasePath macro in them so that it points that directory on your computer. -These drivers use one more package of mine, `gmeometric.sty'. diff --git a/Master/texmf-dist/doc/latex/gmdoc/gmdoc.pdf b/Master/texmf-dist/doc/latex/gmdoc/gmdoc.pdf Binary files differindex 7b1b12674f8..dfbce2bf55c 100644 --- a/Master/texmf-dist/doc/latex/gmdoc/gmdoc.pdf +++ b/Master/texmf-dist/doc/latex/gmdoc/gmdoc.pdf diff --git a/Master/texmf-dist/tex/latex/gmdoc/gmdoc.sty b/Master/texmf-dist/tex/latex/gmdoc/gmdoc.sty index 8cfdcd0628e..fad28ae1538 100644 --- a/Master/texmf-dist/tex/latex/gmdoc/gmdoc.sty +++ b/Master/texmf-dist/tex/latex/gmdoc/gmdoc.sty @@ -2,7 +2,7 @@ % \GetFileInfo{gmdoc.sty} % \title{The \pk{gmdoc.sty} Package\thfileinfo} % \author{Natror (Grzegorz Murzynowski)} -% \date{\today} +% \date{\fakeonum[0.6]\today} % \maketitle % \label{gmd} %% @@ -10,17 +10,17 @@ %% intended to be used with \LaTeXe\ as a~package for %% documenting \LaTeXpar\ files and to be documented with itself. %% \stanza -%% +%% % \begin{copyrnote} % %% Written by Natror (Grzegorz Murzynowski), %% natror at o2 dot pl %% -%% \copyright\,2006, 2007, 2008 by Natror (Grzegorz Murzynowski). -%% +%% \copyright\,2006, 2007, 2008, 2009, 2010 by Natror (Grzegorz Murzynowski). +%% %% This program is subject to the \LaTeX\ Project Public License. -%% See \url{http://www.ctan.org/tex-archive/help/Catalogue/licenses.lppl.html} ^^A -%% for the details of that license. +%% See \url{http://www.ctan.org/tex-archive/help/Catalogue/licenses.lppl.html} ^^A +%% for the details of that license.\rrthis %% %% \acro{LPPL} status: "author-maintained".\par %% @@ -65,7 +65,20 @@ % \chschange{v0.99p}{2008/10/4}{5607} % \chschange{v0.99q}{2008/10/10}{5603} % \chschange{v0.99r}{2008/11/22}{5607} -% \toCTAN{v0.99r}{2008/11/22} +% \toCTAN{2008/11/22 v0.99r} +% \chschange{v0.99s}{2008/12/15}{5974} +% [\env{enumargs} handling the +% argument types of \cmd\DeclareCommand; handling +% \cmd\verbatimspecials, including writing them to index; introduction +% of \cmd\narrativett\ including \cmd\ampulexdef\ of \pk{gmverb} +% internals] +% \chschange{v0.991}{2010/3/2}{6134} +% [compatibilising the \env{enumargs} environment with +% \cmd\DeclareCommand of \pk{gmutils} v.0.991; abandoning +% \pk{gmeometric}] +% \toCTAN{2010/03/04 v0.991} +% +% % % \ifnum\catcode`\@=11 % Why this test here---will come out in chapter @@ -73,7 +86,7 @@ % ^^A and about coming out already! ;-) \NeedsTeXFormat{LaTeX2e} \ProvidesPackage{gmdoc} - [2008/11/22 v0.99r a documenting package (GM)] + [2010/03/01 v0.991 a documenting package (GM)] \fi % % @@ -102,7 +115,7 @@ % The package tends to be (optionally) compatible with the standard % \pk{doc.sty} package, % i.e., the \file{.dtx} files are also compilable with \pk{gmdoc} -% (they may need very little adjustment, in some rather special +% (they may need a~tiny adjustment in some special % cases). % % The tools are integrated with \pk{hyperref}'s advantages such as @@ -190,8 +203,8 @@ % \begin{verse} % \pk{gmutils.sty},\\ % \pk{gmverb.sty},\\ -% \pk{gmiflink.sty}\\ -% \pk{gmeometric} (for the driver of The \LaTeXe\ Source)\\ +% \pk{gmiflink.sty} +%^^A% \pk{gmeometric} (for the driver of The \LaTeXe\ Source)\\ % \end{verse} % and also on some standard packages: % \begin{verse} @@ -205,9 +218,7 @@ % that should % be installed on your computer by default. % -%^^A\traceon % % \subdivision{Bonus: \file{base} drivers} -%^^A\traceoff % As a~bonus and example of \docfm-compatibility % there are driver files included % (cf.\ Palestrina, \textit{Missa papae Marcelli} ;-): @@ -250,11 +261,11 @@ % % The rest is striving to level the very high \pk{doc/ltxdoc}'s % standard, such as (optional) numbering of the codelines and -% authomatic indexing the control sequences e.g. +% automatic indexing the control sequences e.g. % % The \docfm\ package was and still is a~great inspiration for me and % I~would like this humble package to be considered as a~sort of -% hommage to it\footnote{As Grieg's Piano Concerto is a~hommage to ^^B +% homage to it\footnote{As Grieg's Piano Concerto is a~homage to ^^B % the Schumann's.}. If I~mention copying some code or narrative but do % not state the source explicitly, I~mean the \docfm\ package's % documentation (I~have v2.1b dated 2004/02/09). @@ -268,10 +279,10 @@ % % When I~write of a~\textbf{macro}, I~mean a~macro in \TeXbook's % meaning, i.e., a~control sequence whose meaning is -% |\(e/g/x)def|ined. By a~\textbf{macro's parameter} I~mean each of +% |\›[e⁄|g⁄|x›]def|ined. By a~\textbf{macro's parameter} I~mean each of % |#|\<digit>s in its definition. When I~write about ^^A\) % a~\textbf{macro's argument}, I~mean the value (list of tokens) -% subsituting the corresponding parameter of this macro. +% substituting the corresponding parameter of this macro. % (These understandings are according ^^A( % to \TeXbook, I~hope: \TeX\ is a~religion of Book ;-)\,.) % @@ -279,7 +290,7 @@ % % When I~talk of a~\textbf{declaration}, I~mean a~macro that expands % to a~certain assignment, such as |\itshape| or -% |\@onlypreamble{|\<\CS>|}|. +% |\@onlypreamble{⁄<⁄CS>}|. % % Talking of declarations, I'll use the \textbf{\acro{OCSR}} acronym as % a~shorthand for 'observes/ing common \TeX\ scoping rules'. @@ -322,11 +333,11 @@ % \subdivision{Preparing of the source file} % % When \LaTeXpar\ with \pk{gmdoc.sty} package loaded typesets the -% comment lines, the code delimiter is ommitted. If the comment +% comment lines, the code delimiter is omitted. If the comment % continues a~codeline, the code delimiter is printed. It's done so % because ending a~\TeX\ code line with a~|%| is just a~concatenation % with the next line sometimes. Comments longer than one line are -% typeset continuously with the code delimiters ommitted. +% typeset continuously with the code delimiters omitted. % % The user should just write \hisher\ splendid code and brilliant % commentary. In the latter \heshe\ may use usual \LaTeXpar\ commands. @@ -336,6 +347,15 @@ % shall gobble the line end. ^^A~and the leading code delimiter of %^^A % the next line---obsoleted by ^^A~making % ignored in the commentary. % +% But there is also a~\pk{gmdoc} version of |\footnote| provided that +% sets the catcodes so that you don't bother about |^^B| in the +% argument, \TextUsage\qfootnote that takes the same argument(s) as +% the standard |\footnote| and for emphasis there is +% \TextUsage*[\qemph]{\qemph}\arg{text to emphasise}. Both of them +% work also in the ‘straight’ \acro{EOL}s' scope so you don't +% bother. The \TextUsage\arg\ \pk{gmutils}' command also works without +% |^^B|. +% % Moreover, if \heshe\ wants to add a~meta-comment i.e., a~text that % doesn't appear in the code layer nor in the narrative, \heshe\ may % use the \TextUsage*{^^A} sequence that'll be read by \TeX\ as @@ -347,7 +367,7 @@ % although it's active in fact: it re|\catcode|s the special % characters including |\|, |{| and |}| % so you don't have to worry about unbalanced braces or \cs{if}s in -% its scope. But |^^B| doesn't re|\catcode| anything (it would be +% its scope. But |^^B| doesn't re|\catcode| anything (which would be % useless in an argument) so any text between |^^B| and line end has % to be balanced. % @@ -362,8 +382,7 @@ % reason you don't want to make an environment (a~group), there's % a~|\StraightEOL|'s counterpart, the \TextUsage\QueerEOL\ declaration that % restores again the -% \StraightEOL -% queer\footnote{In my understanding +% queer\qfootnote{In my understanding % `queer' and `straight' are not the opposites excluding each % other but the counterparts that may cooperate in harmony for % people's good. And, as I~try to show with the \cs{QueerEOL} and @@ -371,14 +390,19 @@ % recommended while `straight' is the standard but not necessarily % normative. ^^A% (Remember also Alice's in the Wonderland exclamations % ^^A % ``What a~queer day is today''.) -% }^^A -% \QueerEOL +% } ^^A % \gmdoc's meaning of the line end. It \acro{OCSR}, too. One more point to use % |\StraightEOL| is where you wish some code lines to be executed % both while loading the file and during the documentation pass % (it's analogous to \docfm's not embracing some code lines in % a~\env{macrocode} environment). % +% ^^A % The \pk{gmdoc}'s ‘queer’ line ends may be surprising at first. For +% ^^A % example they should not occur in the arguments to the commands +% ^^A % because they cause errors then. To suppress the ‘queer’ and active +% ^^A % line end in the arguments of commands you should end a~line with +% ^^A % \TextUsage*{^^B} which will gobble the line end safely. +% % \stanza % % As in standard \TeX ing, one gets a~paragraph by a~blank line. @@ -401,7 +425,7 @@ % characteristics: \par\leftskip\CodeIndent % \stanza % -% \noindent|\documentclass[|\<options>|]{|\<document-class>|}|\par +% \noindent|\documentclass[|\<options>|]{|\<document class>|}|\par % \noindent|\usepackage[|\<options, probably none>|]{gmdoc}|\par % \<preamble>\par % \noindent|\begin{document}|\par @@ -415,7 +439,9 @@ % To typeset a~source file you may use the \TextUsage\DocInput\ % macro that takes the (path and) name of the file \emph{with ^^B % the extension} as the only argument, e.g., -% |\DocInput{mybrilliantpackage.sty}|. +% |\DocInput{mybrilliantpackage.sty}|\qfootnote{I~use the ‘broken bar’ +% character as a~hyphen in verbatim texts and hyperlinks. If you +% dont't like it, see \cmd\verbDiscretionaryHyphen\ in \pk{gmverb}.}. % % (Note that an \emph{installed} package or class file is findable to % \TeX\ even if you don't specify the path.) @@ -429,9 +455,9 @@ % When using |\OldDocInput|, you have to wrap all the code in % \TextUsage*{macrocode} environments, which is not necessary when you % use |\DocInput|. Moreover, with |\OldDocInput| the\ -% \env{mac\-ro\-co\-de(*)} environments require to be ended with -% |% \end{macrocode(*)}| as in \docfm. (With |\DocInput| you are -% not obliged to precede |\end{macrocode(*)}| with The +% \env{macrocode›[*›]} environments require to be ended with +% \[|% \end{macrocode›[*›]}|\] as in \docfm. (With |\DocInput| you are +% not obliged to precede |\end{macrocode›[*›]}| with The % Four Spaces.) % % \stanza @@ -454,39 +480,44 @@ % the first and optional argument will not appear in the headings nor % in the footers. % -% |\DocInclude| redefines \TextUsage\maketitle\ so -% that it makes a~chapter heading or, in the classes that don't -% support |\chapter|, a~part heading, in both cases with -% respective toc entries. The default assumption is that all the -% files have the same author(s) so there's no need to print them in -% the file heading. If you wish the authors names to be printed, you -% should write \TextUsage\PrintFilesAuthors\ in the preamble or before -% the relevant |\DocInclude|s. If you wish to undeclare printing the -% authors names, there is \TextUsage\SkipFilesAuthors\ declaration. +% |\DocInclude| redefines \TextUsage\maketitle\ so that it makes +% a~chapter heading or, in the classes that don't support |\chapter|, +% a~part heading, in both cases with respective toc entries. The +% default assumption is that all the files have the same author(s) so +% there's no need to print them in the file heading. If you wish the +% authors names to be printed, you should write +% \TextUsage\PrintFilesAuthors\ in the preamble or before the relevant +% |\DocInclude|s. If you wish to undeclare printing the authors names, +% there is \TextUsage*[\Skip⁄-Fil⁄-es⁄-Auth⁄-ors]{\SkipFilesAuthors} +% declaration. % % Like in \pk{ltxdoc}, the name of an included file appears in the % footer of each page with date and version info (if they are % provided). % % The |\DocInclude|d files are numbered with the letters, the -% lowercase first, as in \pk{ltxdoc}. Such a~filemarker also precedes +% lowercase first, as in \pk{ltxdoc}. Such a~file-marker also precedes % the index entries, if the (default) codeline index option is in force. % % As with |\include|, you may declare -% \TextUsage\includeonly|{|\<filenames separated by commas>|}| for +% \TextUsage\includeonly|{⁄<filenames separated with commas>}| for % the draft versions. % % \stanza If you want to put the driver into the same \file{.sty} or % \file{.cls} file (see chapter \ref{Driver} to see how), you may -% write |\DocInput{\jobname.sty}|, or |\DocInclude{\jobname.sty}|, but +% write |\DocInput{\jobname.sty}|, or |\DocInclude{\jobname}|, but % there's also a~shorthand for the latter \TextUsage\SelfInclude \ % that takes no arguments. % By the way, to avoid an infinite recursive input of \file{.aux} % files in the case of self-inclusion an \file{.auxx} file is used % instead of (main) \file{.aux}. +% +% By the way, to say \TeX\ to (self)include only the current file, +% most probably you should say |\includeonly{\jobname}| not +% |\includeonly{myfile}| because of the catcodes. % \stanza % -% At the default settings, the |\Doc/SelfInclude|d files constitute +% At the default settings, the |\›(Doc⁄|Self›)Include|d files constitute % chapters if |\chapter| is known and parts otherwise. The % |\maketitle|s of those files result in the respective headings. % @@ -545,7 +576,7 @@ % \TextUsage\AtBegInputOnce|{|\<the stuff to be added>|}| % declaration. It's also global which means that the groups do not % limit its scope but it adds its argument only at the first input -% succeding it (the argument gets wrapped in a~macro that's |\relax|ed +% succeeding it (the argument gets wrapped in a~macro that's |\relax|ed % at the first use). |\AtBegInputOnce|s add up, too. % % \stanza @@ -605,7 +636,7 @@ % {\LineNumFont 445}\,are typeset continuously with the numbers printed. % % \stanza -% By default the \pk{makeidx} package is loaded and initialized and +% By default the \pk{makeidx} package is loaded and initialised and % the \CSs occurring in the code are automatically % (hyper)indexed thanks to the \pk{hyperref} package. If the user % doesn't wish to index anything, she should use the @@ -634,8 +665,8 @@ % \stanza % In \docfm\ package there's a~default behaviour of putting marked % macro's or environment's name to a~marginpar. In the standard -% classes it's allright but not all the classes support marginpars. -% That is the reason why this package enables marginparing when in +% classes it's alright but not all the classes support marginpars. +% That is the reason why this package enables marginpar-ing when in % standard classes, enables or disables it due to the respective option % when with Marcin Woli\nacute ski's classes and in any case provides the % options \TextUsage*{withmarginpar} and \TextUsage*{nomarginpar}. So, in @@ -644,7 +675,7 @@ % control sequences and environments into marginpars (see % \gmiflink[textUsage]{\cs{TextUsage} etc.}). These options do % not affect common using marginpars, which depends on the -% documentclass. +% document class. % % \stanza % My suggestion is to make the spaces in the code visible except the @@ -664,7 +695,7 @@ % If for any reason you wish the code spaces blank in general and % visible and grey in \env{verbatim*}s, use the declaration % \TextUsage\VisSpacesGrey\ of the \pk{gmverb} package. If you like -% a~little tricks, you can also specify +% little tricks, you can also specify % |codespacesgrey, codespacesblank| in \pk{gmdoc} options (in this % order). % @@ -685,6 +716,15 @@ % and \<text>|\mylittlemacro| breaks into \<text>|%|\\ % |\mylittlemacro|. % +% This package provides the \TextUsage\verbatimspecials\ declaration +% that is used in \pk{gmdocc.cls} as {\noverbatimspecials +% \[|\verbatimspecials⁄«»[¿]|\] to set |⁄| (fractional slash) to the +% escape char, |«| and |»| to group begin and end respectively and +% |¿| to math shift in verbatims (also the short ones). Note +% however that this declaration \qemph{has no effect on the code +% layer}. } +% +% % As the standard \LaTeX\ one, my |\verb| issues an error when a~line % end occurs in its scope. But, if you'd like to allow line ends in % short verbatims, there's the \TextUsage\verbeolOK\ declaration. The @@ -721,7 +761,10 @@ % technical and (I~hope) tricky, such as |\afterfi|, |\ifnextcat|, % |\addtomacro| etc. It's this package that provides the macros for % formatting of names of macros and files, such as |\cs|, |\marg|, |\pk| -% etc. \stanza +% etc. Moreover, it provides a~powerful tool for defining commands +% with weird optional and Knuthian arguments, |\DeclareCommand|, +% inspired by ancient (pre-expl3) \pk{xparse}'s +% |\DeclareDocumentCommand|.\stanza % % The \gmdoc\ package uses a~lot of hyperlinking possibilities % provided by \pk{hyperref}\gmdmarginpar{\pk{hyperref}} which is therefore @@ -764,18 +807,19 @@ % |\newread|,\\ % |\newwrite|, % |\newlength|, -% |\newcommand(*)|, -% |\renewcommand(*)|, -% |\providecommand(*)|, -% |\DeclareRobustCommand(*)|, -% |\DeclareTextCommand(*)|,\\ -% |\DeclareTextCommandDefault(*)|, +% |\newcommand›[*›]|, +% |\renewcommand›[*›]|, +% |\providecommand›[*›]|, +% |\DeclareRobustCommand›[*›]|, +% |\DeclareTextCommand›[*›]|,\\ +% |\DeclareTextCommandDefault›[*›]|, % |\DeclareDocumentCommand|, +% |\Decl⁄-are⁄-Com⁄-mand|\rrthis % % \item -% |\newenvironment(*)|, -% |\renewenvironment(*)|, -% |\DeclareOption(*)|, +% |\newenvironment›[*›]|, +% |\renewenvironment›[*›]|, +% |\DeclareOption|, %^^A~ |%\DeclareDefining*\@namedef| % % \item \label{newctr} @@ -800,15 +844,15 @@ % |\DeclareStringOption|, % |\DeclareBoolOption|, % |\DeclareComplementaryOption|,\\ -% |\DeclareVoidOption|. +% |\DeclareVoidOption|.\rrthis % \end{enumerate}\par % % What does `detects' mean? It means that the main argument of % detected command will be marked as defined at this point, % i.e.\ thrown to a~margin note and indexed with a~`definition' entry. % Moreover, for the definitions \ref*{newctr}--\ref*{DSOption} an -% alternate index entries will be created: of the \CSs uderlying those -% definitions, e.g. |\newcounter{foo}| in the +% alternate index entries will be created: of the \CSs underlying those +% definitions, e.g.\ |\newcounter{foo}| in the % code will result in indexing |foo| and |\c@foo|. % % If you want to add detection of a~defining command not listed above, @@ -830,15 +874,15 @@ % % |dk| stands for |\define@key| and is the type of \pk{xkeyval} % definitions of keys (group \ref{dk type} commands). When detected, -% it scans furher code for an optional \arg[KVprefix], mandatory +% it scans further code for an optional \arg[KVprefix], mandatory % \arg{KVfamily} and mandatory \arg{key name}. The default \<KVprefix> % is |KV|, as in \pk{xkeyval}. % % |dox| stands for |\DeclareOptionX| and launches scanning for an -% optional \arg[KVprefix], optional |<|\<KVfamily>|>| and mandatory +% optional \arg[KV\-pre\-fix], optional |<|\<KVfamily>|>| and mandatory % \arg{option name}. Here the default \<KVprefix> % is also |KV| and the default \<KVfamily> is the input file name. If -% you want to set another default family (e.g. if the code of +% you want to set another default family (e.g.\ if the code of % \file{foo.sty} actually is in file \file{bar.dtx}), use % \TextUsage\DeclareDOXHead\arg{KVfamily}. This declaration has an % optional first argument that is the default \<KVprefix> for @@ -848,16 +892,22 @@ % package provides a~handful of option defining commands (the group % \ref{DSOption} commands). Detection of such a~command launches % a~scan for mandatory \arg{option name} and alternate indexing of -% a~\CS |\|\<KVOfamily>|@|\<optionname>. The default \<KVOfamily> is +% a~\CS |\|\<KVOfamily>|@|\<option name>. The default \<KVOfamily> is % the input file name. Again, if you want to set something else, you -% are given the \TextUsage\DeclareKVOFam\arg{KVOfamily} that sets the +% are given the \TextUsage\DeclareKVOFam\arg{KVO\-fam\-ily} that sets the % default family (and prefix: \<KVOfamily>|@|) for all the commands of % group \ref{DSOption}. % -% Next key recognized by |\DeclareDefining| is \TextUsage*{star}. It +% Next key recognised by |\DeclareDefining| is \TextUsage*{star}. It % determines whether the starred version of a~defining command should -% be taken into account. For example, |\newcommand| should be -% declared with |[star=true]| while |\def| with +% be taken into account\qfootnote{The \scanverb{star} key is provided +% because the default setting of \cmd\MakePrivateLetters\ is such +% that \scanverb{*} is a~letter so e.g.\ \scanverb{\newcommand*} is +% scanned as one \CS. However, if the \cmd\makestarlow\ declaration +% is in force (e.g.\ with the \pk{gmdocc}) this is not +% so---\scanverb{\newcommand*} is scanned as the \CS\ +% \cmd\newcommand\ \emph{and} a~star.}. For example, |\newcommand| +% should be declared with |[star=true]| while |\def| with % |[star=false]|. You can also write just |[star]| instead of % |[star=true]|. It's the default if the |star| key is omitted. % @@ -869,13 +919,13 @@ % \LaTeX\ version), declare % \[|\DeclareDefining*[star=false]\@namedef|\] or % \[|\DeclareDefining[type=text,star=false]\@namedef|\] (as stated -% above, |*| is equivalent |[type=text]|). +% above, |*| is equivalent to |[type=text]|). % % On the other hand, if you want some of the commands listed above -% \emph{not} to be detected, write \TextUsage\HideDefining\<command> -% in the commentary. If both \<command> and \<command*> are detected, +% \emph{not} to be detected, write \TextUsage\HideDefining|\⁄<command>| +% in the commentary. If both \<command> and \<command\*> are detected, % then both will be hidden. |\HideDefining| is always |\global|. Later -% you can resume detection of \<command> and \<command*> with +% you can resume detection of \<command> and \<command\*> with % \TextUsage\ResumeDefining\<command> which is always |\global| % too. Moreover, if you wish to suspend automatic detection of the % defining \<command> only once (the next occurrence), there is @@ -900,10 +950,14 @@ % If you don't like |\def| to be detected more times, you may write % |\HideDefining\def| of course, but there's a~shorthand for this: % \TextUsage\HideDef\ which has the starred version -% \TextUsage\HideDef*\ equivalent |\UnDef|. To resume detection of +% \TextUsage\HideDef* +% equivalent to |\UnDef|. To resume detection of % |\def| you are provided also a~shorthand, \TextUsage\ResumeDef\ (but % |\ResumeDefining\def| also works). % +% Since I~use |\pdef| most often, I~provide also \TextUsage\UnPdef, +% analogous to |\UnDef|. +% % If you define things not with easily detectable commands, you can % mark them `manually', with the |\Define| declaration described in % the next section. @@ -915,10 +969,10 @@ % % The concept (taken from \docfm ) is to index virtually all the % control sequences occurring in the code. \gmdoc\ does that by -% default and needs no special command. (See below about exluding some +% default and needs no special command. (See below about excluding some % macros from being indexed.) % -% The next concept (also taken from \docfm) is to ditinguish some +% The next concept (also taken from \docfm) is to distinguish some % occurrences of some control sequences by putting such a~sequence % into a~marginpar and by special formatting of its index entry. That % is what I~call marking the macros. @@ -941,17 +995,29 @@ % \TextUsage\Define, \TextUsage\CodeUsage\ and % \TextUsage\TextUsage\ commands. % -% All three take one argument and all three may be starred. The -% non-starred versions are intended to take a~control sequence as the -% argument and the starred to take whatever (an -% environment name or a~|^^A|-like and also a~\CS). -% +% The arguments to all three are as follows: +% \begin{enumargs} +% \dc s to indicate whether we mark a~single \CS or more than one +% token(s): without star for a~single \CS, with star for environment +% names etc., the starred version executes |\@sanitize|, +% \dc o version to be marginized and printed here, +% \dc m version to be put to the index, and also +% (printed here and) marginized if the previous argument is missing. +% \end{enumargs} +% +% Note that if you give a~single \CS to the starred version (e.g.\ the +% next \cs{MakePrivateLetters} is done so to hyphenate it in +% the text), you have to wrap it in braces because command +% \cs{@⁄hskip0ptsanitize}s the specials including backslash. +% +% \stanza % You don't have to bother whether |@| is a~letter while documenting % because even if not, these commands do make it a~letter, or more -% precisely, they execute \TextUsage\MakePrivateLetters\ whatever -% it does: At the default settings this command makes |*| -% a~letter, too, so a~starred version of a~command is a~proper argument -% to any of the three commands unstarred. +% precisely, they execute +% \TextUsage*[\Ma⁄-ke⁄-Priv⁄-ate⁄-Let⁄-ters]{\MakePrivateLetters}\ +% whatever it does: At the default settings this command makes |*| +% a~letter, too, so a~starred version of a~command is a~proper +% argument to any of the three commands unstarred. % % The |\Define| and |\CodeUsage| commands, if unstarred, mark the next % scanned occurrence of their argument in the code. (By `scanned @@ -966,12 +1032,12 @@ % right before the code line % \[|\newenvironment{foo}{%|\]^^A] % i.e., not separated by another code line. The starred versions of -% the |\Code...| commands are also intended to mark implicit +% the |\Code›…| commands are also intended to mark implicit % definitions of macros, e.g., |\Define*\@foofalse| before % the line % \[|\newif\if@foo|.\] % -% They both are |\outer| to dicourage their use inside macros because +% They both are |\outer| to discourage their use inside macros because % they actually re|\catcode| before taking their arguments. % % The |\TextUsage| (one-argument) command is intended to mark usage of @@ -1038,11 +1104,11 @@ % (without |*| it just gobbles % it's argument---it's indexed automatically anyway). It's |\outer|. % -% Similarly, to index a~\TeX\ object occurring verbatim in the narrative, you -% have \TextUsage\TextUsgIndex\ and \TextUsage\TextCommonIndex\ -% commands with -% their starless versions for a~\CS argument and the starred for all -% kinds of the argument. +% Similarly, to index a~\TeX\ object occurring verbatim in the +% narrative, you have \TextUsage*[\Text⁄-Usg⁄-Ind⁄-ex]{\TextUsgIndex} +% and \TextUsage\TextCommonIndex\ commands with their starless +% versions for a~\CS argument and the starred for all kinds of the +% argument. % % \stanza % Moreover, as in \docfm, the \TextUsage*{macro} and @@ -1059,7 +1125,7 @@ % code line (also as `def' entry). % % Since it's possible that you define a~\CS implicitly i.e., in such a~way that it -% cannot be scanned in the definition (with |\csname...\endcsname| +% cannot be scanned in the definition (with |\csname›…\endcsname| % e.g.) and wrapping such a~definition (and description) in an % \env{environment} environment would look misguidedly ugly, there's % the \env{macro*} environment which \TeX nically is just an alias for @@ -1067,12 +1133,12 @@ % % (To be honest, if you give a~\env{macro} environment a~non-\CS % argument, it will accept it and then it'll work as -% \env{evironment}.) +% \env{environment}.) % % % \subdivision[Index ex/inclusions]{\gmhypertarget{Index ex/inclusions}} % -% It's\label{IEIDeclarations} understandable\footnote{After reading ^^B( +% It's\label{IEIDeclarations} understandable\qfootnote{After reading ^^B( % \docfm's documentation ;-)\,.} that you don't % want some control sequences to be indexed in your documentation. The % \docfm\ package gives a~brilliant solution: the @@ -1136,7 +1202,7 @@ %^^A in its line as the code. %^^A %^^A If you want the \ds\ directives to be typeset without -%^^A \env{macrocode}, you shoud declare \TextUsage\docstrips\ to make +%^^A \env{macrocode}, you should declare \TextUsage\docstrips\ to make %^^A \TeX\ read the |<| in the comment layer as the beginning of %^^A a~\ds\ directive. In |\docstrips|'s scope the |<| signs %^^A occurring in math mode remain just inequality signs. @@ -1158,13 +1224,23 @@ % To maintain a change history within the file, the |\changes| command may % be placed amongst the description part of the changed code. It takes three % arguments, thus: -% \[|\changes{|\<version>|}{|\<\acro{YYYY}/\acro{MM}/\acro{DD} date>|}{|\<text>|}|\] +% \[|\changes|\arg[\cs{cs}]{version}\relax^^A +% ^^A \TextMarginize\changes^^A~raises an error “not in outer par mode”. +% \arg{\acro{YYYY}/\acro{MM}/\acro{DD} date}{text}\] +% or, if you prefer the |\ProvidesPackage/Class| syntax, +% +% \[|\chgs⁄arg[⁄cs«cs»]{⁄<⁄acro«YYYY/MM/DD»> ⁄<version> ⁄<text>}|\] +% +% The optional \cs{cs} argument may be a~\CS (with backslash) or +% a~string. By default it's the most recently defined \CS\ (see +% section about automatic detection of definitions). +% % % The changes may be used to produce an auxiliary file (\LaTeX's % |\glossary| mechanism is used for this) which may be printed after % suitable formatting. The |\changes| [command] encloses the \<date> in % parentheses and appends the \<text> to form the printed entry in -% such a change history [\dots\ obsolete remark ommitted]. +% such a change history [\dots\ obsolete remark omitted]. % % To cause the change information to be written out, include % \TextUsage\RecordChanges\ in the driver['s preamble or just in the @@ -1182,7 +1258,7 @@ % \docfm\ [and \gmdoc], called \iffalse\pk{gglo.ist}\fi^^A % [\dots\ \textbf{\pk{gmglo.ist}} for \gmdoc]. The \TextUsage\GlossaryMin, % \TextUsage\GlossaryPrologue\ and \TextUsage\GlossaryParms\ macros are -% analagous to the |\Index...| versions [see +% analogous to the |\Index›…| versions [see % sec.~\gmiflink[IndexParams]{The parameters} % p.\,\pageref*{IndexParams}]. (The \LaTeX\ `glossary' % mechanism is used for the change entries.) @@ -1192,7 +1268,7 @@ % |\changes| after the line of definition of a~command to set the % default argument of |\changes| to that command. For example, %\begin{verbatim} -% \newcommand*\dodecaphonic{...} +% \newcommand*\dodecaphonic{›…} % % \changes{v0.99e}{2007/04/29}{renamed from \cs{DodecaPhonic}} %\end{verbatim} % results with a~history (sub)entry: @@ -1235,20 +1311,20 @@ % declaration. % % If the \env{ChangesStartDate} is set to a~date contemporary to \TeX\ -% i.e., not earlier than September 1982\footnote{DEK in \textit{\TeX\ ^^B +% i.e., not earlier than September 1982\qfootnote{DEK in \textit{\TeX\ % The Program} mentions that month as of \TeX\ Version 0 release.}, % then a~note shall appear at the beginning of the changes history -% that informs the reader of ommitting the earlier changes entries. +% that informs the reader of omitting the earlier changes entries. % % If the date stored in \env{ChangesStartDate} is earlier than \TeX, -% no notification of ommitting shall be printed. This is intended for +% no notification of omitting shall be printed. This is intended for % a~rather tricky usage of the changes start date feature: you may % establish two threads of the changes history: the one for the users, % dated with four digit year, and the other for yourself only, dated % with two or three digit year. If you declare % \[|\ChangesStart{|\<version?>|}{1000/00/00}|\] % or so, the changes entries dated with less-than-four digit year -% shall be ommitted and no notification shall be issued of that. +% shall be omitted and no notification shall be issued of that. % % \stanza % @@ -1276,9 +1352,12 @@ % brace> was \<third brace>. % % \stanza -% There is also \TextUsage\toCTAN\arg{version}\arg{date}, a~shorthand +% There is also +% \TextUsage\toCTAN|{|\<date>\textvisiblespace\<version>|}|, +% a~shorthand % for -% \[|\changes|\arg{version}\arg{date}|{put to \acro{CTAN} on |\<date>|}|\] +% \[|\chgs||{|\<date>\textvisiblespace\<version>^^A +% \textvisiblespace |put to \acro{CTAN} on |\<date>|}|\] % % % \subdivision{The parameters} @@ -1288,14 +1367,16 @@ % % \stanza % \TextUsage\stanzaskip\ is a~vertical space inserted when a~blank -% (code) line is met. It's equal |0.75\medskipamount| by default -% (with the \emph{entire} |\medskipamount|'s stretch- and -% shrinkability). Subsequent blank code lines do not increase this +% (code) line is met. It's equal ^^A|0.75\medskipamount| +% |\medskipamount| by default. +%^^A (with the \emph{entire} |\medskipamount|'s stretch- and +% ^^A~shrinkability). +% Subsequent blank code lines do not increase this % space. % % At the points where narration begins a~new line after the code or an -% inline comment and where a~new code line begins after the narration -% (that is not an inline comment), a~\TextUsage\CodeTopsep\ glue is +% in-line comment and where a~new code line begins after the narration +% (that is not an in-line comment), a~\TextUsage\CodeTopsep\ glue is % added. At the beginning and the end of a~\env{macro} or % \env{environment} environment a~|\MacroTopsep| glue is added. By % default, these two skips are set equal |\stanzaskip|. @@ -1319,7 +1400,7 @@ % bigger of them. % % Since |\CodeTopsep| glue is inserted automatically at each -% transition from the code (or code with an inline comment) to the +% transition from the code (or code with an in-line comment) to the % narration and reverse, it may happen that you want not to add such % a~glue exceptionally. Then there's the \TextUsage\nostanza\ % command. You can use it before narration to remove the vskip before @@ -1357,14 +1438,20 @@ % with \TextUsage\CodeDelim\ typing the desired char % preceded by a~backslash, e.g., |\CodeDelim\&|\,. (As just % mentioned implicitly, \possfil|\CodeDelim\%| is declared by -% deafult.) +% default.) % % This declaration is always global so when- and wherever you change % your mind you should express it with a~new |\CodeDelim| % declaration. % -% The starred version of |\CodeDelim| changes also the verb -% `hyphen', the char appearing at the verbatim line breaks that is. +% The unstarred version of |\CodeDelim| changes also the verb +% `hyphen', the char appearing at the verbatim line breaks that is and +% affects the \TextUsage\narrationmark\ which by default typesets |%| +% followed by an en space. +% +% The starred version, \TextUsage\CodeDelim*, changes only the code +% delimiter and the char typeset remains untouched. Most probably you +% shouldn't use the starred version. % % \stanza % Talking of special chars, the escape char, |\| by default, is also @@ -1405,7 +1492,7 @@ % each counter there is a~|\the|\<counter> macro available. The % counter for the line numbers is called \TextUsage*{codelinenum} so % the macro printing it is |\thecodelinenum|. By default we don't -% change its \LaTeX's definition which is equivalent +% change its \LaTeX's definition which is equivalent to % |\arabic{codelinenum}|. % % @@ -1415,7 +1502,7 @@ % document. % They are equal (almost) |\@empty| by default. The first may store % main level index entry of which all indexed macros and environments -% would be subentries, e.g., the name of the package. The third may or +% would be sub-entries, e.g., the name of the package. The third may or % even should store a~text to distinguish equal codeline numbers of % distinct source files. It may be the file name too, of course. The % second macro is intended for another concept, namely the one from @@ -1532,14 +1619,14 @@ % its `shortverb' version whatever you define (see the \pk{gmverb} % package). % -% For short verbatim texts in the inline comments \pk{gmdoc} provides -% the \TextUsage\inverb\<charX>\dots\<charX> (the name stands for -% `inline verbatim') command that redefines the \pk{gmverb} breakables +% For short verbatim texts in the in-line comments \pk{gmdoc} provides +% the \TextUsage\inverb\<a~char>\dots\<a~char> (the name stands for +% `in-line verbatim') command that redefines the \pk{gmverb} breakables % to break with |%| at the beginning of the % lower line to avoid mistaking such a~broken verbatim commentary text % for the code. % -% But nor |\verb(*)| neither |\inverb| will work if +% But nor |\verb›[*›]| neither |\inverb| will work if % you put them in an argument of another macro. For such a~situation, % or if you just prefer, \gmdoc\ (\pk{gmutils}) provides a~robust command % \TextUsage\cs, which takes one obligatory argument, the macro's name @@ -1555,39 +1642,43 @@ % verbatim and without a~backslash, e.g., |\env{an environment}| % produces \env{an environment}. % -% For usage in the inline comments there are \TextUsage\incs\ and +% For usage in the in-line comments there are \TextUsage\incs\ and % \TextUsage\inenv\ commands that take analogous arguments and precede % the typeset command and environment names with a~|%| if at the -% beginning of a~new line. +% beginning of a~new line. To those who like |\cmd|, there is also +% \TextUsage\incmd, an in-line version of the former. % % And for line breaking at |\cs| and |\env| there is -% \TextUsage\nlpercent\ to ensure |%| if the line breaks at the -% beginning of a~|\cs| or |\env| and \TextUsage\+ to use inside their -% argument for a~discretionary hyphen that'll break to - at the end of -% the upper line and |%| at the beginning of the lower line. By +% \TextUsage\nlperc\ to ensure |%| at the beginning of a~new line and +% \TextUsage\+ to use in |\cs| and |\env| argument for a~discretionary +% hyphen that'll break to - at the end of the upper line and +% |%| at the beginning of the lower line. By % default hyphenation of |\cs| and |\env| arguments is off, you can % allow it only at |\-| or |\+|. % -% \stanza By default the multiline inline comments are typeset with +% There is also \TextUsage\nlpercent\ if you wish a~discretionary |%| +% without |\incs| or |\inverb|. +% +% \stanza By default the multi-line in-line comments are typeset with % a~hanging indent (that is constant relatively to the current % indent of the code) and justified. Since vertical alignment is % determined by the parameters as they are at the moment of \cs{par}, % no one can set the code line to be typeset ragged right (to break -% nicely if it's long) and the following inline comment to be +% nicely if it's long) and the following in-line comment to be % justified. Moreover, because of the hanging indent the lines of -% multiline inline comments are relatively short, you may get lots of +% multi-line in-line comments are relatively short, you may get lots of % overfulls. Therefore there is a~Boolean switch \TextUsage*{ilrr} % (\acro{OCSR}), -% whose name stands for `InLine RaggedRight' and the inline comments +% whose name stands for `In-Line Ragged-Right' and the in-line comments % (and their codelines) are typeset justified in the scope of % |\ilrrfalse| which is the default. -% When you write |\ilrrtrue|, then all inline comments in its scope +% When you write |\ilrrtrue|, then all in-line comments in its scope % (and their codelines) will be typeset ragged right % (and still with the hanging indent). Moreover, you are provided % \TextUsage\ilrr\ and \TextUsage\ilju\ commands that set |\ilrrtrue| -% and |\ilrrfalse| for the current inline comment only. Note you can +% and |\ilrrfalse| for the current in-line comment only. Note you can % use them anywhere within such a~comment, as they set |\rightskip| -% basically. |\ilrr| and |\ilju| are no-ops in the standalone narration. +% basically. |\ilrr| and |\ilju| are no-ops in the stand-alone narration. % % % @@ -1699,16 +1790,16 @@ % by \cs{Pro\-vid\-es\-Class/Pack\-age/Fi\-le} declarations. The % information of the file you process with \gmdoc\ % is provided (and therefore getable) if the file is also loaded (or -% the |\Provide...| line occurs in a~|\StraightEOL| scope). +% the |\Provide›…| line occurs in a~|\StraightEOL| scope). % -% If the input file doesn't contain |\Provides...| in the code layer, +% If the input file doesn't contain |\Provides›…| in the code layer, % there are commands \TextUsage\ProvideFileInfo|{|\<file name with ^^B % extension>|}[|\<info>|]|. (\<info> should consist of: % \<year>|/|\<month>|/|\<day>| |\<version number>| |\<a~short note>.) % % Since we may documentally input files that we don't load, \docfm\ in % \pk{gmdoc} e.g., we provide a~declaration to be put (in the comment -% layer) before the line(s) containing |\Provides...|. The +% layer) before the line(s) containing |\Provides›…|. The % \TextUsage\FileInfo\ command takes the subsequent stuff till the % closing |]| and subsequent line end, extracts from it the info and % writes it to the \file{.aux} and rescans the stuff. We use an @@ -1734,7 +1825,7 @@ % % \stanza To get `\CS' which is `CS' in small caps (in |\acro| to be % precise), you can write \TextUsage\CS. This macro is |\protected| so -% you can use it safely in |\changes| e.g. Moreover, it checks +% you can use it safely in |\changes| e.g.\ Moreover, it checks % whether the next token is a~letter and puts a~space if so so you % don't have to bother about \verb*|\CS\ |. % @@ -1801,12 +1892,12 @@ % % Within their scope/argument the \TextUsage*{macrocode} environments % behave as in \docfm, i.e.\ they are a~kind of verbatim and require to be -% ended with |% \end{macrocode(*)}|. +% ended with |% \end{macrocode›[*›]}|. % -% The default behaviour of \env{macrocode(*)} with the `new' input +% The default behaviour of \env{macrocode›[*›]} with the `new' input % commands is different however. Remember that in the `new' fashion the code % and narration layers philosophy is in force and that is sustained -% within \env{macrocode(*)}. Which means basically that with `new' +% within \env{macrocode›[*›]}. Which means basically that with `new' % settings when you write %\begin{verbatim} %% \begin{macrocode} @@ -1831,7 +1922,7 @@ % % \stanza % For a~more detailed discussion of what is \docfm-compatible and how, -% see the code section \gmiflink[doccompa]{\docfm-compatibiliy}. +% see the code section \gmiflink[doccompa]{\docfm-compatibility}. % %^^A \docstrip %<*package> @@ -1869,11 +1960,11 @@ % % The advantage of \TextUsage\skiplines…\TextUsage\endskiplines\ over % |\iffalse…\fi| is that the latter has to contain balanced \cs{if}s -% and \cs{fi}s while the former hasn't because it sanitizes the +% and \cs{fi}s while the former hasn't because it sanitises the % stuff. More precisely, it uses the \cs{dospecials} list, so it -% sanitizes also the braces. +% sanitises also the braces. % -% Moreover, when the |countalllines(*)| option is in force, +% Moreover, when the |countalllines›[*›]| option is in force, % |\skipfiles|…|\endskipfiles| keeps the score of skipped lines. % % \label{Driver} @@ -1887,9 +1978,15 @@ \ifnum\catcode`\@=12 +\errorcontextlines=100 + % \CodeUsgIndex*{outeroff} \CodeUsgIndex*{mwrep} \documentclass[countalllines, codespacesgrey, outeroff, debug, mwrep, -pagella, fontspec=quiet]{gmdocc} +pagella, trebuchet, cursor, fontspec=quiet]{gmdocc} + +\verbLongDashes + +\DoNotIndex{\gmu@tempa \gmu@tempb \gmu@tempc \gmu@tempd \gmu@tempe \gmu@tempf} \twocoltoc \title{The \pk{gmdoc} Package\\ i.e., \pk{gmdoc.sty} and @@ -1897,7 +1994,7 @@ pagella, fontspec=quiet]{gmdocc} \author{Grzegorz `Natror' Murzynowski} \date{\ifcase\month\relax\or January\or February\or March\or April\or May\or June\or July\or August\or September\or October\or November\or - December\fi\ 2008} + December\fi\ \the\year} %|%\includeonly{gmoldcomm}| %^^A\includeonly{gmeometric,gmoldcomm} @@ -1923,11 +2020,11 @@ pagella, fontspec=quiet]{gmdocc} % three auxiliary packages: \skipgmlonely[\stanza The remarks about installation and compiling of the documentation are analogous to those in the chapter - \pk{gmdoc.sty} and therefore ommitted.\stanza] + \pk{gmdoc.sty} and therefore omitted.\stanza] \DocInclude{gmutils} \DocInclude{gmiflink} \DocInclude{gmverb} -\DocInclude{gmeometric} +%^^A\DocInclude{gmeometric} \DocInclude{gmoldcomm} \typeout{% Produce change log with^^J% @@ -1983,7 +2080,7 @@ pagella, fontspec=quiet]{gmdocc} % As mentioned in the preface, this package aims at a~minimal markup % of the working code. A~package author writes \hisher\ splendid code % and adds a~brilliant comment in |%|ed lines and that's all. Of -% course, if \heshe\ wants tomake a~|\section| or |\emph|asise, +% course, if \heshe\ wants to make a~|\section| or |\emph|asise, % \heshe\ has to type respective \CSs. % % I~see the feature described above to be quite a~convenience, @@ -1993,7 +2090,7 @@ pagella, fontspec=quiet]{gmdocc} % \stanza % % More detailedly, the idea is to make |^^M| (end of line char) active -% and to define it to check if the next char i.e., the beginnig of the +% and to define it to check if the next char i.e., the beginning of the % next line is a~|%| and if so % to gobble it and just continue usual typesetting or else to start % a~verbatim scope. In fact, every such a~line end starts a~verbatim @@ -2016,6 +2113,7 @@ pagella, fontspec=quiet]{gmdocc} % % Maybe someone wants the code lines not to be numbered. + \newif\if@linesnotnum \DeclareOption{linesnotnum}{\@linesnotnumtrue} @@ -2033,7 +2131,8 @@ pagella, fontspec=quiet]{gmdocc} \newif\if@countalllines \newif\if@printalllinenos -\DeclareOption{countalllines}{% +\DeclareOption{countalllines}{% to use the \incs{inputlineno} + % primitive and print real line numbers % in a~file. \@countalllinestrue \@printalllinenosfalse} @@ -2152,10 +2251,12 @@ pagella, fontspec=quiet]{gmdocc} % possibility with the |\gmhypertarget| and |\gmiflink| macros. It % \emph{has} to be loaded \emph{after} \pk{hyperref}. \RequirePackage{gmiflink} -% And a~slight redefinition of \env{verbatim}, |\verb(*)| and -% providing of |\MakeShortVerb(*)|. +% And a~slight redefinition of \env{verbatim}, |\verb›[*›]| and +% providing of |\MakeShortVerb›[*›]|. \RequirePackage{gmverb}[2008/08/20] +\StoreMacros{\@verbatim\verb} + \if@noindex \AtBeginDocument{\gag@index}% for the latter macro see line % \ref{gag@index}. @@ -2183,7 +2284,7 @@ pagella, fontspec=quiet]{gmdocc} % \cs{NewCommentChar}; also the internal \cs{code@delim} is renamed % from as much confusing \cs{commentchar} and a~\cs{glet} for % \cs{verb}s \cs{verbhyphen} is added; similarly -% \cs{[Un]CodeDelimAnd} renamed from \cs{[un]commentand}} +% \cs{›[Un›]CodeDelimAnd} renamed from \cs{›[un›]commentand}} % % \changes{v0.98m}{06/11/10}{\cs{CDAnd} and \cs{CDPerc} renamed from % \cs{CodeDelimAnd} and \cs{UnCodeDelimAnd} and both those commands @@ -2192,14 +2293,15 @@ pagella, fontspec=quiet]{gmdocc} % \changes{v0.99a}{06/12/1}{split into the starred and unstarred % versions} % -\def\CodeDelim{\@ifstar\Code@Delim@St\Code@Delim} +\def\CodeDelim{\@bsphack\gm@ifstar\Code@Delim@St\Code@Delim} -\def\Code@Delim#1{% +\def\Code@Delim@St#1{% {\escapechar\m@ne - \@xa\gdef\@xa\code@delim\@xa{\string#1}}} + \@xa\gdef\@xa\code@delim\@xa{\string#1}}% + \@esphack} % (|\@xa| is |\expandafter|, see \pk{gmutils}.)\DoNotIndex\@xa -\def\Code@Delim@St#1{\Code@Delim{#1}\VerbHyphen{#1}} +\def\Code@Delim#1{\VerbHyphen{#1}\Code@Delim@St{#1}} % It is an invariant of \gmdoc ing that |\code@delim| stores the % current code delimiter (of catcode 12). @@ -2208,7 +2310,13 @@ pagella, fontspec=quiet]{gmdocc} % a~code delimiter. I~don't think it \emph{really} to be a~limitation. % % And let's assume you do as we all do: -\CodeDelim*\% +\CodeDelim\% + +% And to typeset this code delimiter pretty, let's |\def|: +\pdef\narrationmark{{\tt\verbhyphen}{\normalfont\enspace}\ignorespaces} +% \chgs{2008/11/30 v0.99s added and introduced---\cs{code@delim} forked to what +% delimits the code (\cs{code@delim}) and what is typeset at the +% boundary of code: \cs{narrationmark}} % We'll play with |\everypar|, a~bit, and if you use such things as % the |{itemize}| environment, an error would occur if we didn't @@ -2220,7 +2328,7 @@ pagella, fontspec=quiet]{gmdocc} \newcommand*\settexcodehangi{% \hangindent=\verbatimhangindent \hangafter=\@ne}% we'll use -% it in the inline comment case. |\verbatimhangindent| is provided by the +% it in the in-line comment case. |\verbatimhangindent| is provided by the % \pk{gmverb} package and\equals3\,em by default. % \DefIndex\@@settexcodehangi \@ifdefinable\@@settexcodehangi{\let\@@settexcodehangi=\settexcodehangi} @@ -2245,8 +2353,8 @@ pagella, fontspec=quiet]{gmdocc} % poetry. % \Define\stanzaskip \stanzaskip=\medskipamount -\advance\stanzaskip by-.25\medskipamount% to preserve the stretch- and -% shrinkability.\par + %^^A \advance\stanzaskip by-.25\medskipamount% to preserve the stretch- and + %^^A % shrinkability.\par % %\stanza % A~vertical space between the commentary and the code seems @@ -2283,7 +2391,7 @@ pagella, fontspec=quiet]{gmdocc} \advance\belowdisplayshortskip by\smallskipamount \advance\belowdisplayshortskip by-1\smallskipamount% We advance % \incs{be\+low\+dis\+play\+short\+skip} forth and back to - % give it the \nlpercent\cs{small\+skip\+am\+ount}'s shrink- and + % give it the \incs{small\+skip\+am\+ount}'s shrink- and % stretchability components. \topsep=\stanzaskip \partopsep=\z@ @@ -2334,23 +2442,23 @@ pagella, fontspec=quiet]{gmdocc} \if@codeskipput\unless\if@nostanza\vskip-\CodeTopsep\relax\fi\fi \@codeskipputgtrue\@nostanzagtrue \@afternarrgfalse\@aftercodegtrue}% In the `code -% to narration' case the first switch is enough but in the countercase +% to narration' case the first switch is enough but in the counter-case % `narration to code' both the second and third are necessary while % the first is not. % %\stanza % To count the lines where they have begun not before them\nostanza \newgif\if@newline -% |\newgif| is |\newif| with global effect i.e., it defines |\...gtrue| -% and |\...gfalse| switchers that switch respective Boolean switch +% |\newgif| is |\newif| with a~global effect i.e., it defines |\›…gtrue| +% and |\›…gfalse| switchers that switch respective Boolean switch % \emph{globally}. See \pk{gmutils} package for details. % \stanza % -% To handle the \ds\ directives not \emph{any} |%<...|\,. +% To handle the \ds\ directives not \emph{any} |%<›…|\,. % \Define\if@dsdir \newgif\if@dsdir % This switch will be falsified at the first char of a~code line. (We -% need a~switch independent of the one indicationg whether the line +% need a~switch independent of the one indicating whether the line % has or has not been counted because of two reasons: 1.\ line % numbering is optional, 2.\ counting the line falsifies that switch % \emph{before} the first char.) @@ -2361,11 +2469,11 @@ pagella, fontspec=quiet]{gmdocc} % The macros used by it are defined later. % -\newcommand*\DocInput{\bgroup\@makeother\_\Doc@Input} +%^^A\newcommand*\DocInput{\bgroup\@makeother\_\Doc@Input} \begingroup\catcode`\^^M=\active% \firstofone{\endgroup% - \newcommand*{\Doc@Input}[1]{\egroup\begingroup% + \newcommand*{\DocInput}[1]{\begingroup% % \changes{v0.98}{06/09/05}{\cs{@makeother\protect\bslash_} added} % \DefIndex\gmd@inputname \edef\gmd@inputname{#1}% we'll use it in some notifications. @@ -2388,7 +2496,7 @@ pagella, fontspec=quiet]{gmdocc} \@xa\@makeother\csname\code@delim\endcsname% % \CodeUsgIndex\gmd@resetlinecount \gmd@resetlinecount% due to the option |uresetlinecount| - % we reset the linenumber counter or do nothing. + % we reset the line number counter or do nothing. % \Define*{^^M} \QueerEOL% \changes{v0.99m}{2008/08/09}{there was % \cs{let}\hathat{M} but \cs{QueerEOL} is better: it also @@ -2417,7 +2525,7 @@ pagella, fontspec=quiet]{gmdocc} }% we add guardians after % |\input|ing a~file; somehow an error occurred without them. \catcode`\%=9 % for \docfm -compatibility.\label{ignorePercent} - \setcounter{CheckSum}{0}% we initialize the counter for the number + \setcounter{CheckSum}{0}% we initialise the counter for the number % of the escape chars (the assignment is |\global|). \everyeof{\relax}% |\@nx| moved not to spoil input of toc e.g. \@xa\@xa\@xa^^M\gmd@guardedinput%\label{eeeEOL} @@ -2428,7 +2536,7 @@ pagella, fontspec=quiet]{gmdocc} % \docfm-(not)likeliness notifications. \glet\@currentlabel=\gmd@currentlabel@before% we restore % value from before this group. In a~very special case this could - % cause unexpected behaviour of crossrefs, but anyway we acted + % cause unexpected behaviour of cross-refs, but anyway we acted % globally and so acts \pk{hyperref}. \endgroup% }% end of |\Doc@Input|'s definition. @@ -2474,6 +2582,8 @@ pagella, fontspec=quiet]{gmdocc} % \CodeUsgIndex\ttverbatim \ttverbatim% it does |\tt| and makes specials % other or |\active|-and-breakable. + % to turn verbatim specials off in + % \incmd\scanverb s. \gmd@DoTeXCodeSpace% \@makeother\|% because |\ttverbatim| doesn't do that. \MakePrivateLetters% see line \ref{MPL}.\par @@ -2486,6 +2596,8 @@ pagella, fontspec=quiet]{gmdocc} % process the leading spaces supposed there are any and, if after % them is a~|%|, we just continue the commentary as in the % previous case or else we typeset the \TeX\ code. + \texcode@hook% we add some special stuff, e.g.\ in \pk{gmdocc.cls} we + % make star low. \@xa\@ifnextchar\@xa{\code@delim}{%\label{ifContNarr} % \CodeUsgIndex\gmd@continuenarration \gmd@continuenarration}{% \CodeUsgIndex\gmd@dolspaces @@ -2493,6 +2605,9 @@ pagella, fontspec=quiet]{gmdocc} }% end of |\@ifnextchar|'s else. }% end of |\gmd@textEOL|'s definition. + +\emptify\texcode@hook + \def\gmd@setclubpenalty{\clubpenalty=3333 } % \stanza @@ -2526,15 +2641,48 @@ pagella, fontspec=quiet]{gmdocc} % and \cs{PrintChanges} modified to work properly in the `queer line % ends' environment.} -\long\def\@ifEOLactive#1#2{% - \ifnum\catcode`\^^M=\active \afterfi{#1}\else\afterfi{#2}\fi} +\def\@ifEOLactive{%\ + % \begin{enumargs} + % \item what if end of line is active, + % \item what if not. + % \end{enumargs} + \ifnum\catcode`\^^M=\active \@xa\@firstoftwo\else\@xa\@secondoftwo\fi} \foone\obeylines{% - \long\def\@ifQueerEOL#1#2{%% \changes{v0.98a}{06/09/06}{added} - \@ifEOLactive{\ifx^^M\gmd@textEOL\afterfi{#1}\else\afterfi{#2}\fi}% - {#2}}% of \cs{@ifQueerEOL} + \def\@ifQueerEOL{%\ + % \begin{enumargs} + % \item what if line end is ‘queer’, + % \item what if not ‘queer’. + % \end{enumargs} + % \changes{v0.98a}{06/09/06}{added} + \@ifEOLactive{% + \ifx^^M\gmd@textEOL\@xa\@firstoftwo\else\@xa\@secondoftwo\fi}% + {\@secondoftwo}}% of \cs{@ifQueerEOL} }% of \cs{foone} +% A~footnote for the ‘queer’ line ends scope.\nostanza +\pdef\qfootnote{% + \@ifQueerEOL + {\begingroup\StraightEOL\qfootnote@}% + {\footnote}} + +\DeclareCommand\qfootnote@{o>Lm}{% + \endgroup % yes, we close the group: the arguments are already + % parsed and passed to this macro. + \edef\gmu@tempa{% + \@nx\footnote \IfValueT{#1}{[#1]}}% + \gmu@tempa{#2}% +} + +% An emphasis command for ‘queer’ line ends.\nostanza +\pdef\qemph{% + \@ifQueerEOL + {\begingroup\StraightEOL\qemph@}% + {\emph}} + +\pdef\qemph@#1{\endgroup\emph{#1}} + + % The declaration below is useful if you % wish to put sth.\ just in the nearest input/included file and no % else: at the moment of putting the stuff it will erase it from the @@ -2545,7 +2693,9 @@ pagella, fontspec=quiet]{gmdocc} %^^A\newcounter{hook@oncecnt} % \Define\gmd@ABIOnce \@emptify\gmd@ABIOnce -\AtBegInput\gmd@ABIOnce +\AtEndOfPackage{\AtBegInput\gmd@ABIOnce} +% \chgs{2008/11/30 v0.99s deferred till the end of package to allow +% adding titles \cs{AtBegInputOnce}} \long\def\AtBegInputOnce#1{% % \changes{v0.98a}{06/09/05}{The counter \cs[]{hook@oncecnt} added @@ -2589,7 +2739,7 @@ pagella, fontspec=quiet]{gmdocc} % \DefIndex\gmd@texcodespace \gdef\CodeSpacesBlank{% \let\gmd@DoTeXCodeSpace\gmobeyspaces% -\let\gmd@texcodespace=\ }% the latter |\let| is for the |\if...|s. +\let\gmd@texcodespace=\ }% the latter |\let| is for the |\if›…|s. %\stanza % \Define\CodeSpacesSmall \gdef\CodeSpacesSmall{% @@ -2651,7 +2801,7 @@ pagella, fontspec=quiet]{gmdocc} % counter. Note we decrease it by $-1$ to get the proper value % for the next line. (Well, I~don't quite know why, but it % works.) %^^A~we'll step its value by 1 because it will be put - % ^^Aat the beninning of the \emph{next} line. + % ^^Aat the beginning of the \emph{next} line. \ifnum\value{#1}<\inputlineno \csname c@#1\endcsname\numexpr\inputlineno-1\relax \ifvmode\leavevmode\fi% this line is added 2008/08/10 after an @@ -2659,7 +2809,7 @@ pagella, fontspec=quiet]{gmdocc} % all-night debuggery ;-) that showed that at one point % \incs{gmd@grefstep} was called in vmode which caused adding % \incs{penalty 10000} to the main vertical list and thus - % forbidding pagebreak during entire \inenv{oldmc}. + % forbidding page break during entire \inenv{oldmc}. \grefstepcounter{#1}% \fi}% We wrap stepping the counter in an \incs{ifnum} to avoid % repetition of the same ref-value (what would result in the @@ -2671,7 +2821,7 @@ pagella, fontspec=quiet]{gmdocc} % made % to \incs{refstepcounter} by \pk{hyperref}. - \if@printalllinenos% Note that checking this swich makes only + \if@printalllinenos% Note that checking this switch makes only % sense when |countalllines| is true. \def\gmd@cpnarrline{% count and print narration line \if@newline @@ -2693,7 +2843,7 @@ pagella, fontspec=quiet]{gmdocc} \setcounter{codelinenum}{\inputlineno}% it's global. \let\gmd@grefstep\hgrefstepcounter} -\else% not |countallines| (and therefore we won't print the narration +\else% not |countalllines| (and therefore we won't print the narration % lines' numbers either) \@emptify\gmd@cpnarrline \let\gmd@grefstep\hgrefstepcounter% \label{let grefstep} if we don't @@ -2782,7 +2932,7 @@ pagella, fontspec=quiet]{gmdocc} \@nx\hangindent=\the\hangindent% and also set the % hanging indent setting for the same line comment case. \acro{BTW}., % this |%| or rather lack of it costed me five hours of - % debugging and rewriting. Active lineends require extreme + % debugging and rewriting. Active line ends require extreme % caution. \@nx\hangafter=1\space}%^^A~\@nx\relax \else% @@ -2795,12 +2945,12 @@ pagella, fontspec=quiet]{gmdocc} % hmode. \@aftercodegtrue% we want to know later that now we are % typesetting a~codeline. - \if@ilgroup\aftergroup\egroup\@ilgroupfalse\fi% when we are in the inline + \if@ilgroup\aftergroup\egroup\@ilgroupfalse\fi% when we are in the in-line % comment group (for ragged right or justified), we want % to \label{inline.egroup.2} % close it. But if we did it % here, we would close the verbatim group for the code. But we set - % the swich false not to repeat \inverb|\aftergroup\egroup|. + % the switch false not to repeat \inverb|\aftergroup\egroup|. % ^^A\special{color push gray 0.2712}% before that penalty \gmd@charbychar% we'll eat the code char by char to scan all the % macros and thus to deal properly with the case |\%| in which the @@ -2866,7 +3016,7 @@ pagella, fontspec=quiet]{gmdocc} \else \if\code@delim\@nx#1% \gmd@ldspaceswd=\z@ - \afterfifi{\gmd@continuenarration#1}%\label{ContNarr2} + \afterfifi{\gmd@continuenarration\narrationmark}%\label{ContNarr2} % \changes{v0.99n}{2008/08/30}{\cs{afterfifi} added---a~bug fix} \else \afterfifi{\gmd@typesettexcode#1}% \fi @@ -2921,7 +3071,7 @@ pagella, fontspec=quiet]{gmdocc} % One more inner macro because |^^M| in \TeX\ code wants to peek at the % next char and possibly launch |\gmd@charbychar|. We deal with -% counting the lines thorougly. Increasing the counter is divided into +% counting the lines thoroughly. Increasing the counter is divided into % cases and it's very low level in one case because |\refstepcounter| and % |\stepcounter| added some stuff that caused blank lines, at % least with \pk {hyperref} package loaded. @@ -2929,7 +3079,7 @@ pagella, fontspec=quiet]{gmdocc} %^^A \debug@special{2829}% \ifx\gmd@texcodeEOL#1% \if@newline - % ^^A\special{color push gray 0.281600}% no occurence + % ^^A\special{color push gray 0.281600}% no occurrence % ^^A \if@countalllines\global\advance\c@codelinenum by\@ne obsolete % ^^A\fi \@newlinegfalse @@ -2969,12 +3119,12 @@ pagella, fontspec=quiet]{gmdocc} % we wish to print |%| (or another code delimiter). \def\gmd@percenthack{% - \ifprevhmode\code@delim\aftergroup~% We add a~space after |%|, + \ifprevhmode\aftergroup\narrationmark% We add a~space after |%|, % because I~think it looks better. It's done |\aftergroup| to make % the spaces possible after the |%| not to be % typeset. % \changes{v0.99n}{2008/08/21}{\cs{space} replaced with a~tilde to - % forbid a~linebreak before an inline comment} + % forbid a~line break before an in-line comment} \else\aftergroup\gmd@narrcheckifds@ne% remember that % \cs{gmd\-@\-pre\-cent\-hack} is only called when we've the code % delimiter and soon we'll close the verbatim group and right after @@ -3043,7 +3193,7 @@ pagella, fontspec=quiet]{gmdocc} \if@afternarr \if@aftercode \if@ilgroup\egroup\fi% \label{inline.egroup.1}if we are both after code - % and after narration it means we are after an inline + % and after narration it means we are after an in-line % comment. Then we probably end a~group opened in line % \ref{inline.bgroup} \if@codeskipput\else\gmd@codeskip2\@aftercodegfalse\fi @@ -3080,13 +3230,13 @@ pagella, fontspec=quiet]{gmdocc} \fi} -% Now a~special treatment for an inline comment: +% Now a~special treatment for an in-line comment: \newif\ifilrr \def\ilrr{%\changes{v0.99n}{2008/08/21}{added} \if@aftercode \unless\if@ilgroup\bgroup\@ilgrouptrue\fi% \label{inline.bgroup} If we are - % `aftercode', then we are in an inline comment. Then we open + % `aftercode', then we are in an in-line comment. Then we open % a~group to be able to declare e.g.\ \cs{raggedright} for that % comment only. This group is closed in line \ref{inline.egroup.1} % or \ref{inline.egroup.2}. @@ -3097,7 +3247,7 @@ pagella, fontspec=quiet]{gmdocc} \def\gmd@setilrr{\rightskip0ptplus\textwidth} -\def\ilju{% when inline comments are ragged right in general but we +\def\ilju{% when in-line comments are ragged right in general but we % want just this one to be justified. \if@aftercode \unless\if@ilgroup\bgroup\@ilgrouptrue\fi @@ -3125,7 +3275,7 @@ pagella, fontspec=quiet]{gmdocc} \else% With the option turned off\dots \newcounter{DocInputsCount}% \newcounter{codelinenum}[DocInputsCount]% \dots\ we declare the - % |\DocInput|s' number counter andthe codeline counter + % |\DocInput|s' number counter and the codeline counter % to be reset with stepping of it. % \changes[\c@DocInputsCount]{v0.98c}{06/9/8}{added for fixing % duplication of \pk{hyperref} labels in the case of a~multiple @@ -3197,7 +3347,7 @@ pagella, fontspec=quiet]{gmdocc} \fi % We'll wish to execute |\gmd@codeskip| wherever a~codeline (possibly with -% an inline comment) is followed by a~homogenic comment line or +% an in-line comment) is followed by a~homogeneous comment line or % reverse. Let us dedicate a~Boolean switch to this then. % \Define\if@aftercode \newgif\if@aftercode @@ -3226,8 +3376,8 @@ pagella, fontspec=quiet]{gmdocc} \fi \leftskip\TextIndent% this line is a~patch against % a~bug-or-feature that in certain cases the narration |\leftskip| - % is left equal the code leftskip. (It happens when there're - % subsequent code lines after an inline comment not ended with + % is left equal the code leftskip. (It happens when there are + % subsequent code lines after an in-line comment not ended with % an explicit |\par|.) Before v0.99n it was just after line \ref{codeskip5}. \@aftercodegfalse\@nostanzagtrue % \changes{v0.99o}{2008/09/04}{a~bug fix: added \cs{@nostanzagtrue}} @@ -3293,7 +3443,7 @@ pagella, fontspec=quiet]{gmdocc} % \pk{inputenc}) may re|\catcode| such unusual characters. % % \changes{v0.98d}{06/9/11}{re\cs{catcode}ing and defining -% \cs{char1} and \cs{char2} added atto begin doc input} +% \cs{char1} and \cs{char2} added at-to begin doc input} % % \stanza % As you see the |^^B| active char is defined to gobble everything @@ -3330,7 +3480,7 @@ pagella, fontspec=quiet]{gmdocc} % not only of redefining the line end but also these little things % related to it. % -% One usefulness of |\StraightEOL| is allowing linebreaking of the +% One usefulness of |\StraightEOL| is allowing line-breaking of the % command arguments. Another---making possible executing some code lines % during the documentation pass. % @@ -3374,13 +3524,13 @@ pagella, fontspec=quiet]{gmdocc} %^^A % \skiplines %^^A % They won't work in \verb+|verbatim|+ scopes but the clubs redefine -%^^A % the active lineend to be a~breakable (and visible) space, so +%^^A % the active line end to be a~breakable (and visible) space, so %^^A % breaking a~`clubbed' text in two lines will not cause a~disaster but -%^^A % you get e.g., |...^^B %...|. +%^^A % you get e.g., |›…^^B %›…|. %^^A % \endskiplines % \gmhypertarget[closingspace]{To make} |^^M| behave more like a~`normal' -% lineend I~command it to add a~| |${}\subs{10}$ at first. It works +% line end I~command it to add a~| |${}\subs{10}$ at first. It works % but has one unwelcome feature: if the line has nearly |\textwidth|, % this closing space may cause line breaking and setting a~blank line. % To fix this I~|\advance| the |\parfillskip|: @@ -3390,7 +3540,7 @@ pagella, fontspec=quiet]{gmdocc} \par}% \if@ilgroup\aftergroup\egroup\@ilgroupfalse\fi% we are in the % verbatim group so we - % close the inline comment group after it if the closing is not yet set. + % close the in-line comment group after it if the closing is not yet set. } % We'll put it in a~group surrounding |\par| but we need to check if % this |\par| is executed after narration or after the code, @@ -3419,7 +3569,7 @@ pagella, fontspec=quiet]{gmdocc} % \env{countalllines} package option lets \cs{}\hathat{M} to it} % % The |\QueerEOL| declaration will |\let| it to |\^^M| to make -% |\^^M| behave properly. If this definition was ommitted, |\^^M| +% |\^^M| behave properly. If this definition was omitted, |\^^M| % would just expand to |\ | and thus not gobble the leading |%| of the % next line leave alone typesetting the \TeX\ code. I~type |\ | etc. % instead of just |^^M| which adds a~space itself because I~take @@ -3430,14 +3580,14 @@ pagella, fontspec=quiet]{gmdocc} % We'll need it for restoring queer definitions for \docfm-compatibility. % % -% \subdivision{Adjustment of \env{verbatim} and \cs{verb}} +% \subdivision{Adjustments of \env{verbatim} and \cs{verb}} % -% To make \env{verbatim(*)} typeset its contents with the \TeX\ code's +% To make \env{verbatim›[*›]} typeset its contents with the \TeX\ code's % indentation: % \Define\@verbatim \gaddtomacro\@verbatim{\leftskip=\CodeIndent} -% And a~one more little definition to accomodate |\verb| and pals for the +% And a~one more little definition to accommodate |\verb| and pals for the % lines commented out. \AtBegInput{\long\def\check@percent#1{% \gmd@cpnarrline% to count the verbatim lines and possibly print @@ -3466,11 +3616,24 @@ pagella, fontspec=quiet]{gmdocc} \@ifEOLactive{^^M}{\@ehc}}}}% \endgroup +% To distinguish the code typewriter from the narrative typewriter: +\ampulexdef\@verbatim\ttverbatim\verbatim@specials +{\ttverbatim\narrativett\verbatim@specials} + +\ampulexdef\verb\ttverbatim\verbatim@specials +{\ttverbatim\narrativett\verbatim@specials}% + +\pdef\texttt#1{{\narrativett#1}} + +% We rollback the |\ampulexdef| made to |\verb| in the index, see line \ref{verb:ampulex:index} + + + % \subdivision{Macros for marking of the macros} % % A~great inspiration for this part was the \docfm\ package again. % I~take some macros from it, and some tasks I~solve a~different way, -% e.g., the |\| (or another escapechar) is not active, because anyway +% e.g., the |\| (or another escape char) is not active, because anyway % all the chars of code are scanned one by one. And exclusions from % indexing are supported not with a~list stored as |\toks| register % but with separate control sequences for each excluded \CS. @@ -3518,7 +3681,7 @@ pagella, fontspec=quiet]{gmdocc} \@ifundefined{MakePrivateLetters}{%\label{MPL} \def\MakePrivateLetters{\makeatletter\catcode`\*=11 }}{} % A~tradition seems to exist to write about e.g., `command |\section| and -% command |\section*|' and such an uderstanding also of `macro' is +% command |\section*|' and such an understanding also of `macro' is % noticeable in \docfm. Making the |*| a~letter solves the problem of % scanning starred commands. % @@ -3539,10 +3702,19 @@ pagella, fontspec=quiet]{gmdocc} % `environments' names;} % Now the main macro indexing a~macro's name. It would be a~verbatim -% :-) copy of the \docfm 's one if I~didn't ommit some lines +% :-) copy of the \docfm 's one if I~didn't omit some lines % irrelevant with my approach. -\def\scan@macro#1{% we are sure to scan at least one token and - % therefore we define this macro as one-parameter.\par + +\foone\obeylines{% + \def\scan@macro#1{% + \ifx#1^^M\@xa#1\else\afterfi{\scan@macro@#1}\fi% + }% of |\scan@macro|, +}% of |\foone|. + + +\def\scan@macro@#1{% we are sure to scan at least one token which is + % not the line end and + % therefore we define this macro as one-parameter.\par % Unlike in \docfm , here we have the escape char \catother\ so we % may just have it printed during main scan char by char, i.e., in the % lines \ref{printhashone1} and \ref{printhashone2}.\par @@ -3564,7 +3736,7 @@ pagella, fontspec=quiet]{gmdocc} % name of the macro later.\par % We |\string| it here and in the lines \ref{stringing1} and % \ref{stringing2} to be sure it is whole \catother\ for easy - % testing for special indexentry formats, see line + % testing for special index entry formats, see line % \ref{pnametestDef} etc. Here we are sure the result of |\string| % is \catother\ since its argument is \catletter. \afterfi{\@ifnextcat{a}{\gmd@finishifstar#1}{\finish@macroscan}}% @@ -3582,7 +3754,7 @@ pagella, fontspec=quiet]{gmdocc} \xdef\macro@iname{\gmd@maybequote\macro@iname}% \xdef\macro@pname{\xiistring#1}%\label{stringing1} \afterfi \finish@macroscan - \fi} + \fi}% of |\scan@macro@|. % The |\xiistring| macro, provided by \pk{gmutils}, is used instead of % original |\string| because we wish to get | |\catother (`other' space). % @@ -3608,7 +3780,7 @@ pagella, fontspec=quiet]{gmdocc} \def\gmd@finishifstar#1{% \if*\@nx#1\afterfi\finish@macroscan% note we protect |#1| against % expansion. In \pk{gmdoc} verbatim scopes some chars are active - % (e.g. \inverb|\|\,). + % (e.g.\ \inverb|\|\,). \else\afterfi\continue@macroscan \fi} @@ -3618,34 +3790,12 @@ pagella, fontspec=quiet]{gmdocc} % |\uccode|ing but then |#1| meant |#|\<\#1> in |\uppercase|'s % argument, of course. \uppercase{% \DefIndex\gmd@maybequote - \gmd@ifinmeaning 9\of \indexcontrols + \@ifinmeaning 9\of \indexcontrols {\glet\gmd@maybequote\quotechar}% {\g@emptify\gmd@maybequote}% }% }} -% And now let's take care of the MakeIndex control characters. We'll -% define a~list of them to check whether we should quote a~char or -% not. But we'll do it at |\begin{document}| to allow the user to use -% some special MakeIndex style and in such a~case to redefine the four -% MakeIndex controls' macros. We enrich this list with the backslash -% because sometimes MakeIndex didn't like it unquoted. -% \Define\indexcontrols -% \changes{v0.98d}{06/9/15}{relativized to the index control macros: -% previously the controls were given explicitly as the standard ones.} -\AtBeginDocument{\xdef\indexcontrols{% - \bslash\levelchar\encapchar\actualchar\quotechar}} - -\long\def \gmd@ifinmeaning#1\of#2#3#4{% explained in the text - % paragraph below. \changes{v0.99g}{2007/11/06}{made more elegant: - % \cs{if} changed to \cs{ifx} made four parameters and not expanding - % to an open \cs{iftrue/false}. Also renamed from \cs{@ifismember}} - \long\def\gmd@in@@##1#1##2\gmd@in@@{% - \ifx^^A##2^^A\afterfi{#4}% - \else\afterfi{#3}% - \fi}% - \@xa\gmd@in@@#2#1\gmd@in@@}% - % This macro is used for catching chars that are % MakeIndex's controls. How does it work? @@ -3657,24 +3807,16 @@ pagella, fontspec=quiet]{gmdocc} % |\catcode| remains so \cs{gmd\-@\-if\-in\-mean\-ing} gets |\quote@char|'s |#1| % `other'ed as the first argument. % -% The meaning of the |\gmd@ifinmeaning| parameters is as follows: -%\begin{enumargs}^^B -%\item the token(s) whose presence we check, -%\item the macro in whose meaning we search |#1| (the first token of -% this argument is expanded one level with |\expandafter|), -%\item the `if found' stuff, -%\item the `if not found' stuff. -%\end{enumargs} % -% In |\quote@char| the second argument for |\gmd@ifinmeaning| is +% In |\quote@char| the second argument for \pk{gmutils} |\@ifinmeaning| is % |\indexcontrols| defined as the (expanded and `other') sequence of -% the MakeIndex controls. |\gmd@ifinmeaning| defines its inner macro +% the MakeIndex controls. |\@ifinmeaning| defines its inner macro % |\gmd@in@@| to take two parameters separated by the first and the -% second |\gmd@ifinmeaning|'s parameter, which are here the char +% second |\@ifinmeaning|'s parameter, which are here the char % investigated by |\quote@char| and the |\indexcontrols| list. The % inner macro's parameter string is delimited by the macro itself, why % not. |\gmd@in@@| is put before a~string consisting of -% |\gmd@ifinmeaning|'s second and first parameters (in such a~reversed +% |\@ifinmeaning|'s second and first parameters (in such a~reversed % order) and |\gmd@in@@| itself. In such a~sequence it looks for % something fitting its parameter pattern. |\gmd@in@@| is sure to find % the parameters delimiter (|\gmd@in@@| itself) and the separator, @@ -3682,21 +3824,35 @@ pagella, fontspec=quiet]{gmdocc} % just there. But the investigated char may be found not near the end, % where we put it, but among the MakeIndex controls' list. Then the % rest of this list and |\ifismember|'s |#1| put by us become the -% secong argument of |\gmd@in@@|. What |\gmd@in@@| does with its +% second argument of |\gmd@in@@|. What |\gmd@in@@| does with its % arguments, is just a~check whether the second one is empty. This may % happen \emph{iff} the investigated char hasn't been found among the % MakeIndex controls' list and then |\gmd@in@@| shall expand to -% |\iffalse|, otherwise it'll expand to |\iftrue|. (The |\after...| -% macros are employed not to (mis)match just got |\if...| with the +% |\iffalse|, otherwise it'll expand to |\iftrue|. (The |\after›…| +% macros are employed not to (mis)match just got |\if›…| with the % test's |\fi|.) ``(Deep breath.) You got that?'' If not, try % \docfm's explanation of |\ifnot@excluded|, pp.\,36--37 of the v2.1b % dated 2004/02/09 documentation, where a~similar construction is % attributed to Michael Spivak. % -% Since version 0.99g |\gmd@ifinmeaning| is used also in testing +% Since version 0.99g |\@ifinmeaning| is used also in testing % whether a~detector is already present in the carrier in the % mechanism of automatic detection of definitions (line \ref{550}). +% And now let's take care of the MakeIndex control characters. We'll +% define a~list of them to check whether we should quote a~char or +% not. But we'll do it at |\begin{document}| to allow the user to use +% some special MakeIndex style and in such a~case to redefine the four +% MakeIndex controls' macros. We enrich this list with the backslash +% because sometimes MakeIndex didn't like it unquoted. +% \Define\indexcontrols +% \changes{v0.98d}{06/9/15}{relativized to the index control macros: +% previously the controls were given explicitly as the standard ones.} +\AtBeginDocument{\xdef\indexcontrols{% + \bslash\levelchar\encapchar\actualchar\quotechar}} + + + \newif\ifgmd@glosscs% we use this switch to keep the information % whether a~history entry is a~\CS or not. @@ -3705,10 +3861,10 @@ pagella, fontspec=quiet]{gmdocc} % First we check if the current \CS is not just being defined. The % switch may be set true in line \ref{519} \ifgmd@adef@cshook% if so, we throw it into marginpar and index as - % a~def entry\dots - \@ifundefined{gmd/iexcl/\macro@pname}{% \dots\ if it's not excluded - % from indexing. - \@xa\Code@MarginizeMacro\@xa{\macro@pname}% + % a~def entry\dots + \gm@ifundefined{gmd/iexcl/\macro@pname\space}{% \dots\ if it's not excluded + % from indexing. + \@xa\Code@MarginizeMacro\@xa{\macro@pname}% \@xa\@defentryze\@xa{\macro@pname}{1}}{}%% here we declare the kind of % index entry and define |\last@defmark| used by \cs{changes} \global\gmd@adef@cshookfalse% we falsify the hook that was set @@ -3716,7 +3872,7 @@ pagella, fontspec=quiet]{gmdocc} \fi % We have the \CS's name for indexing in |\macro@iname| and % for print in |\macro@pname|. So we index it. We do it a~bit - % countercrank way because we wish to use more general indexing + % counter-crank way because we wish to use more general indexing % macro. \if\verbatimchar\macro@pname% \label{3039}it's important that |\verbatimchar| % comes before the macro's name: when it was reverse, the |\tt| \CS @@ -3727,41 +3883,48 @@ pagella, fontspec=quiet]{gmdocc} % |\verb| another delimiter, namely |$|: ^^A$ \def\im@firstpar{[$%^^A$ ]}% - \else\def\im@firstpar{}\fi - \@xa \index@macro\im@firstpar\macro@iname\macro@pname - % \label{3049} - \maybe@marginpar\macro@pname - \if\xiispace\macro@pname\relax\gmd@texcodespace - \else\macro@pname - \fi - % \changes[\finish@macroscan]{v0.99n}{2008/09/30}{the case of - % \cs{\vs} taken care of} - \let\next\gmd@charbychar - \gmd@detectors% \label{519} for automatic detection of - % definitions. Defined and - % explained in the next section. It redefines - % |\next| if detects a~definition command and thus - % sets the switch of line \ref{506} true. - \next - % \label{next 3690} - } + \else\def\im@firstpar{}% + \fi + \@xa \index@macro\im@firstpar\macro@iname\macro@pname + % \label{3049} + \maybe@marginpar\macro@pname + \if\xiispace\macro@pname\relax\gmd@texcodespace + \else + {\noverbatimspecials\RestoreMacro\verb + \@xa\scanverb\@xa{\macro@pname}}% we typeset scanned \CS. + \fi + % \changes[\finish@macroscan]{v0.99n}{2008/09/30}{the case of + % \cs{\vs} taken care of} + \let\next\gmd@charbychar + \gmd@detectors% \label{519} for automatic detection of + % definitions. Defined and + % explained in the next section. It redefines + % |\next| if detects a~definition command and thus + % sets the switch of line \ref{506} true. + \next + % \label{next 3690} +} % Now, the~macro that checks whether the just scanned macro should be % put into a~marginpar: it checks the meaning of a~very special \CS: % whose name consists of |gmd/2marpar/| and of the examined macro's % name. \def\maybe@marginpar#1{% - %^^A\ifx#1\mname@tomarginpar - \@ifundefined{gmd/2marpar/#1}{}{% - \@xa\Text@Marginize\@xa{\bslash#1}% |\expandafter|s - % \possfil because the |\Text@Marginize| command applies |\string| to its - % argument. \incs{macro@pname}, which will be the only possible + \gm@ifundefined{gmd/2marpar/\@xa\detokenize\@xa{#1}}{}{% + \edef\gmu@tempa{% + \unexpanded{\Text@Marginize*}% + {\bslash\@xa\unexpanded\@xa{#1}}% ^^A + }\gmu@tempa + % ^^A % |\expandafter|s + % ^^A % \possfil because the |\Text@Marginize| command applies |\string| to its + % ^^A % argument. + % \incs{macro@pname}, which will be the only possible % argument to % \incs{may\+be\+@mar\+g\+in\+par}, % contains the macro's name - % without the escapechar so we added it here. - % ^^A\gdef\mname@tomarginpar{} - \@xa\g@relaxen\csname gmd/2marpar/#1\endcsname% we reset the switch. + % without the escape char so we added it here. + \@xa\g@relaxen + \csname gmd/2marpar/\@xa\detokenize\@xa{#1}\endcsname% we reset the switch. }} % Since version 0.99g we introduce automatic detection of definitions, @@ -3794,14 +3957,10 @@ pagella, fontspec=quiet]{gmdocc} % the user, they are assigned the default values as in \pk{xkeyval}: % |KVpref| letters |KV| and |KVfam| the input file name. The latter % assignment is done only for the |\DeclareOptionX| defining command -% because in other \pk{xkeyval} definitions (|\define@(...)key|) the +% because in other \pk{xkeyval} definitions (|\define@›«[…]»key|) the % family is mandatory. % %\stanza -% Let's make a~version of |\@ifstar| that would work with -% |*|\catletter. It's analogous to |\@ifstar|. -\foone{\catcode`\*=11 } - {\def\@ifstarl#1{\@ifnextchar *{\@firstoftwo{#1}}}} % % \subsubdivision{\cs{DeclareDefining} and the detectors} % @@ -3810,7 +3969,7 @@ pagella, fontspec=quiet]{gmdocc} % version of a~command. The effect of this command is always global. \outer\def\DeclareDefining{\begingroup \MakePrivateLetters - \@ifstarl + \gm@ifstar {\gdef\gmd@adef@defaulttype{text}\Declare@Dfng}% {\gdef\gmd@adef@defaulttype{cs}\Declare@Dfng}% } @@ -3820,7 +3979,7 @@ pagella, fontspec=quiet]{gmdocc} \newcommand*\Declare@Dfng[2][]{% \endgroup \Declare@Dfng@inner{#1}{#2}% - \ifgmd@adef@star% this swith may be set false in first + \ifgmd@adef@star% this switch may be set false in first % \incs{Declare@Dfng@inner} (it's the |star| key). \Declare@Dfng@inner{#1}{#2*}% The catcode of |*| doesn't matter since % it's in @@ -3839,7 +3998,7 @@ pagella, fontspec=quiet]{gmdocc} }% \gmd@adef@setkeysdefault \setkeys[gmd]{adef}{#1}% - \@xa\gmd@ifinmeaning + \@xa\@ifinmeaning \csname gmd@detect@\gmd@adef@currdef\endcsname % \label{550} \of\gmd@detectors{}{% @@ -3873,9 +4032,9 @@ pagella, fontspec=quiet]{gmdocc} \define@boolkey[gmd]{adef}{star}[true]{} -% The |prefix@|\<command> keyvalue will be used to create additional +% The |prefix@|\<command> key-value will be used to create additional % index entry for detected definiendum (a~\textbf{definiendum} is the -% thing defined, e.g. in |\newenvironment{foo}| the env.\ \env{foo}). +% thing defined, e.g.\ in |\newenvironment{foo}| the env.\ \env{foo}). % For instance, |\newcounter| is declared with |[prefix=\bslash c@]| % in line \ref{newcounter} and therefore |\newcounter{foo}| occurring % in the code will index both |foo| and |\c@foo| (as definition @@ -3934,7 +4093,7 @@ pagella, fontspec=quiet]{gmdocc} def, newcommand, cs,% equivalent to the two above, covers all the cases of defining - % a~\CS, including the \PlainTeX\ \inverb|\new...| and + % a~\CS, including the \PlainTeX\ \inverb|\new›…| and % \LaTeX\ |\newlength|. newenvironment, text,% equivalent to the one above, covers all the commands defining @@ -3992,7 +4151,7 @@ pagella, fontspec=quiet]{gmdocc} \gmd@resa} -% We initialize the carrier of detectors: +% We initialise the carrier of detectors: \emptify\gmd@detectors @@ -4004,9 +4163,9 @@ pagella, fontspec=quiet]{gmdocc} \def\gmd@adef@cs{\global\gmd@adef@cshooktrue\gmd@charbychar} % For other kinds of definitions we'll employ active chars of their -% arguments' opening braces, brackets and seargants. In \pk{gmdoc} +% arguments' opening braces, brackets and sergeants. In \pk{gmdoc} % code layer scopes the left brace is active so we only add a~hook to -% its meaning (see line \ref{gm@lbracehook} in \pk{gmverb}) and \ref and here +% its meaning (see line \ref{gm@lbracehook} in \pk{gmverb}) and here % we switch it according to the type of detected definition. \def\gmd@adef@text{\gdef\gmd@lbracecase{1}\gmd@charbychar} @@ -4016,7 +4175,7 @@ pagella, fontspec=quiet]{gmdocc} % ^^A>\] \catcode`\<\active} {%\par - % The detector of \pk{xkeyval} |\define@(...)key|: + % The detector of \pk{xkeyval} |\define@›«[…]»key|: \def\gmd@adef@dk{% \let[\gmd@adef@scanKVpref \catcode`\[\active @@ -4055,7 +4214,7 @@ pagella, fontspec=quiet]{gmdocc} % After a~|\DeclareOptionX|-like defining command not only the prefix % in square brackets may occur but also the family in -% seargants. Therefore we have to test presence of both of them. +% sergeants. Therefore we have to test presence of both of them. \def\gmd@adef@checkDOXopts{% \@ifnextchar[\gmd@adef@scanKVpref%^^A] {\@ifnextchar<\gmd@adef@scanDOXfam\gmd@charbychar}} @@ -4112,7 +4271,7 @@ pagella, fontspec=quiet]{gmdocc} % The hook of the left brace consists of \cs{ifcase} that logically -% consists of three subcases: +% consists of three sub-cases: % \begin{itemize}^^B % \item [0]---the default: do nothing in particular; % \item [1]---the detected defining command has one mandatory @@ -4129,7 +4288,7 @@ pagella, fontspec=quiet]{gmdocc} \afterfi{% \gdef\gmd@lbracecase{0}% \gmd@adef@scanname}% - \or% when 2---the first mandatory argument of two (|\define@(...)key|) + \or% when 2---the first mandatory argument of two (|\define@›«[…]»key|) \afterfi{% \gdef\gmd@lbracecase{3}% \gmd@adef@scanDKfam}% @@ -4139,7 +4298,7 @@ pagella, fontspec=quiet]{gmdocc} \gmd@adef@scanname}% \fi} -\def\gmd@lbracecase{0}% we initialize the hook caser. +\def\gmd@lbracecase{0}% we initialise the hook caser. % And we define the inner left brace macros: @@ -4169,7 +4328,7 @@ pagella, fontspec=quiet]{gmdocc} \@gobble#1}% \gmd@charbychar] ] - +% \label{738} \def\gmd@adef@dofam{% \ifnum1=0\csname gmd@adef@KVfamset@\gmd@adef@currdef\endcsname @@ -4186,7 +4345,10 @@ pagella, fontspec=quiet]{gmdocc} \fi} \def\gmd@adef@deftext#1{% - \edef\macro@pname{\@gobble#1}% we gobble |\gmd@charbychar|, cf. above. + \@xa\def\@xa\macro@pname\@xa{\@gobble#1}%% we gobble |\gmd@charbychar|, cf. above. + \edef\macro@pname{\@xa\detokenize\@xa{\macro@pname} }% note the + % space at the end. + \edef\macro@pname{\@xa\@xiispaces\macro@pname\@@nil}% \@xa\Text@Marginize\@xa{\macro@pname}% \gmd@adef@indextext \edef\gmd@adef@altindex{% @@ -4214,8 +4376,8 @@ pagella, fontspec=quiet]{gmdocc} \def\gmd@adef@indextext{% \@xa\@defentryze\@xa{\macro@pname}{0}% declare the definiendum has to - % have a~definition entry and in the changes history should appear - % without backslash. + % have a~definition entry and should appear + % without backslash in the changes history. \gmd@doindexingtext% redefine |\do| to an indexing macro. % \label{gmd@doindexingtext 2nd use} \@xa\do\@xa{\macro@pname}} @@ -4241,20 +4403,23 @@ pagella, fontspec=quiet]{gmdocc} % \ResumeAllDefining But |\def| definitely \emph{not always} defines % an important macro. Sometimes it's just a~scratch assignment. % Therefore we define the next declaration. It turns the next -% occurence of |\def| off (only the next one). +% occurrence of |\def| off (only the next one). \def\UnDef{{% \changes{v0.99n}{2008/08/30}{a~bug fixed: % \cs{gmd@charbychar} appended to \cs{next}---without it - % a~subsequent inline comment was typeset verbatim} + % a~subsequent in-line comment was typeset verbatim} % \UnDef \gmd@adef@selfrestore\def }} +% \UnPdef +\def\UnPdef{{\gmd@adef@selfrestore\pdef}} + \StoreMacro\UnDef% because the `hiding' commands relax it. \def\HideDef{% \changes{v0.99n}{2008/08/30}{added the starred version % that calls \cs{UnDef}} - \@ifstar\UnDef{\HideDefining\def\relaxen\UnDef}} + \gm@ifstar\UnDef{\HideDefining\def\relaxen\UnDef}} \def\ResumeDef{\ResumeDefining\def\RestoreMacro\UnDef} @@ -4273,6 +4438,7 @@ pagella, fontspec=quiet]{gmdocc} \DeclareDefining[star=false]\newwrite \DeclareDefining[star=false]\newlength \DeclareDefining[star=false]\DeclareDocumentCommand +\DeclareDefining[star=false]\DeclareCommand % \changes{v0.99p}{2008/10/04}{added} @@ -4285,7 +4451,10 @@ pagella, fontspec=quiet]{gmdocc} \DeclareDefining*\newenvironment \DeclareDefining*\renewenvironment -\DeclareDefining*\DeclareOption +\DeclareDefining*[star=false]\DeclareOption +% \chgs{2008/11/30 v0.99s declared as defining if without star because +% \cs{DeclareOption*} doesn't define a~named option and so it doesn't +% have a~text argument} %|%\DeclareDefining*\@namedef| % \HideDefining\DeclareDefining @@ -4371,7 +4540,7 @@ pagella, fontspec=quiet]{gmdocc} % One remark more: if you define (in the code) a~new defining command % (I~did: a~shorthand for |\DeclareOptionX[gmcc]<>|), declare it as % defining (in the commentary) \emph{after} it is defined. Otherwise -% its first occurence shall fire the detector and mark next \CS or +% its first occurrence shall fire the detector and mark next \CS or % worse, shall make the detector expect some arguments that it won't % find. @@ -4392,7 +4561,7 @@ pagella, fontspec=quiet]{gmdocc} \fi \global\emptify\gmd@detectors}% we make the carrier |\empty| not |\relax| to % be able to declare new defining command in - % the scope of |\HideAll...| + % the scope of |\HideAll›…| % The |\ResumeAllDefining| command takes no arguments and restores the % meaning of the detectors' carrier stored with |\HideAllDefining| @@ -4404,7 +4573,7 @@ pagella, fontspec=quiet]{gmdocc} \fi} % Note that |\ResumeAllDefining| discards the effect of any -% |\DeclareDefining| that could have occured between +% |\DeclareDefining| that could have occurred between % |\HideAllDefining| and itself. % % \stanza @@ -4417,7 +4586,7 @@ pagella, fontspec=quiet]{gmdocc} % \changes{v0.99n}{2008/08/30}{Added the starred version that hides % the defining command only once} \MakePrivateLetters - \@ifstarl\Hide@DfngOnce\Hide@Dfng} + \gm@ifstar\Hide@DfngOnce\Hide@Dfng} \def\Hide@Dfng#1{%%\UnDef \escapechar\m@ne @@ -4447,7 +4616,7 @@ pagella, fontspec=quiet]{gmdocc} % ^^A \inverb|\next| not restore the macro here just in case of % ^^A multiple declaration of |\def| (in that case there would % ^^A~be - % ^^A multiple occurences of the macro to be restored in the + % ^^A multiple occurrences of the macro to be restored in the % ^^A~carrier % ^^A \inverb|\gmd@detectors| and we wish % ^^A all of them not to fire this one time) That's probably too @@ -4480,14 +4649,15 @@ pagella, fontspec=quiet]{gmdocc} % \changes{v0.98}{06/09/05}{Indexing the codelines improved to sort % with account of the \cs{filesep} (\cs{HLPrefix})} \newcommand*\index@macro[3][\verbatimchar]{{% - \@ifundefined{gmd/iexcl/#3}%\label{iexcltest} + \gm@ifundefined{gmd/iexcl/\@xa\detokenize\@xa{#3 }}%\label{iexcltest} {% |#3| is not excluded from index - \@ifundefined{gmd/defentry/#3}% \label{pnametestDef} + % ^^A\typeout{@@@ :::\@xa\string\csname gmd/iexcl/\@xa\detokenize\@xa{#3 }\endcsname::::}% + \gm@ifundefined{gmd/defentry/\@xa\detokenize\@xa{#3 }}% \label{pnametestDef} {% |#3| is not def entry - \@ifundefined{gmd/usgentry/#3}%\label{pnametestUsg} - {% |#3| is not usg entry + \gm@ifundefined{gmd/usgentry/\@xa\detokenize\@xa{#3 }}%\label{pnametestUsg} + {% |#3| is not usg.\ entry \edef\kind@fentry{\CommonEntryCmd}}%\label{CECmd} - {% |#3| is usg entry + {% |#3| is usg.\ entry \def\kind@fentry{UsgEntry}% \un@usgentryze{#3}}%\label{usgentryrs} }% @@ -4511,7 +4681,7 @@ pagella, fontspec=quiet]{gmdocc} \encapchar\gmu@tempa}% \@xa\special@index\@xa{\gmu@tempa}% We give the % indexing macro the argument expanded so that \pk{hyperref} may - % see the explicit encapchar in order not to add its own + % see the explicit encap-char in order not to add its own % encapsulation of \verb+|hyperpage+ when the (default) % |hyperindex=true|\TextCommonIndex*{hyperindex} option is in % force. (After this setting the |\edef|s in the above may be @@ -4527,7 +4697,9 @@ pagella, fontspec=quiet]{gmdocc} \def\un@defentryze#1{% - \@xa\g@relaxen\csname gmd/defentry/#1\endcsname + \ifcsname gmd/defentry/\@xa\detokenize\@xa{#1 }\endcsname + \@xa\g@relaxen\csname gmd/defentry/\@xa\detokenize\@xa{#1 }\endcsname + \fi \ifx\gmd@detectors\empty \g@relaxen\last@defmark \fi}% the last macro (assuming \cs{fi} is not a~macro :-) @@ -4538,7 +4710,9 @@ pagella, fontspec=quiet]{gmdocc} % |\last@defmark|'s value keeps until the next definition. \def\un@usgentryze#1{% - \@xa\g@relaxen\csname gmd/usgentry/#1\endcsname} + \ifcsname gmd/usgentry/\@xa\detokenize\@xa{#1 }\endcsname + \@xa\g@relaxen\csname gmd/usgentry/\@xa\detokenize\@xa{#1 }\endcsname + \fi} \@emptify\EntryPrefix% this macro seems to be obsolete now % (v0.98d). @@ -4550,7 +4724,7 @@ pagella, fontspec=quiet]{gmdocc} \newcommand*\quoted@eschar{\quotechar\bslash}% we'll redefine it when % indexing an environment. -% Let's initialize |\IndexPrefix| +% Let's initialise |\IndexPrefix| \def\IndexPrefix{} % The |\IndexPrefix| and |\HLPrefix| (`HyperLabel Prefix') macros are % given with account of a~possibility of documenting several files @@ -4586,7 +4760,7 @@ pagella, fontspec=quiet]{gmdocc} % |\refstepcounter| and |codelinenum.123| made by % |\gmhypertarget|). But since v0.98 it is not a~problem anymore % because during the automatic \inverb|\hypertarget|ing the - % lines are labeled |clnum.|\<number>. When |\HLPrefix| was + % lines are labelled |clnum.|\<number>. When |\HLPrefix| was % defined as dot, MakeIndex rejected the entries as `illegal page % number'. \changes[\HLPrefix]{v0.98a}{06/09/05}{again % \cs{@empty}fied since \cs{hypertarget}ing the codelines names @@ -4599,7 +4773,7 @@ pagella, fontspec=quiet]{gmdocc} % I~design the index to contain hyperlinking numbers whether they are % the line numbers or page numbers. In both cases the last parameter % is the number, the one before the last is the name of a~formatting macro -% and in linenumber case the first parameter is a~prefix for proper +% and in line number case the first parameter is a~prefix for proper % reference in multi-doc. @@ -4627,7 +4801,10 @@ pagella, fontspec=quiet]{gmdocc} \outer\def\DefIndex{\begingroup \MakePrivateLetters - \@ifstarl{\MakePrivateOthers\Code@DefIndexStar}{\Code@DefIndex}} + \gm@ifstar + {\@sanitize\MakePrivateOthers%^^A\verbatim@specials + \Code@DefIndexStar}% + {\Code@DefIndex}} % \changes{v0.98d}{06/9/11}{The macros indexing and marginizing % macros (and other sequences) made \cs{long}} @@ -4640,52 +4817,77 @@ pagella, fontspec=quiet]{gmdocc} % \DefIndex\Code@DefIndexStar \long\def\Code@DefIndexStar#1{% - \endgroup + \endgroup{% \addto@estoindex{#1}% - \@defentryze{#1}{0}} + \@defentryze{#1}{0}}% +} \def\gmd@justadot{.} \long\def\@defentryze#1#2{% - \@xa\glet\csname gmd/defentry/\string#1\endcsname\gmd@justadot% The\\ - % \LaTeX\ \inverb|\@namedef| macro could not be used since it's not `long'.\ilrr + \@xa\glet\csname gmd/defentry/\detokenize{#1 }\endcsname\gmd@justadot% The\\ + % \LaTeX\ \inverb|\@namedef| macro could not be used since it's not + % `long'. The space to sound with the checker. \ilrr % \Define\last@defmark - \xdef\last@defmark{\string#1}% we |\string| the argument just in case it's + \ifcat\relax\@xa\@nx\@firstofmany#1\@@nil + % \nostanza if we meet a~\CS, then maybe it's a~\CS to be + % ‘defentryzed’ or maybe it's a~‘verbatim special’ \CS. The only way + % to distinguish those cases is to assume there shouldn't be + % a~verbatim containing only a~‘verbatim special’ \CS. + \@xa\def\@xa\gmu@tempa\@xa{\@allbutfirstof#1\@@nil}% + \ifx\gmu@tempa\@empty + \afterfifi\@firstoftwo% if |#1| is a~single \CS, we + % \incmd\xiistring\ it. Otherwise we \incmd\detokenize\ it. + \else\afterfifi\@secondoftwo + \fi + \else\@xa\@secondoftwo + \fi + {\xdef\last@defmark{\xiistring#1}}% we |\string| the argument just in case it's % a~control sequence. But when it can be a~\CS, we |\@defentryze| in % a~scope of |\escapechar=-1|, so there will never be a~backslash at % the beginning of |\last@defmark|'s meaning (unless we % |\@defentryze| |\\|). - \@xa\gdef\csname gmd/isaCS/\last@defmark\endcsname{#2}}% |#2| is + {\xdef\last@defmark{\detokenize{#1}}}% + \@xa\gdef\csname gmd/isaCS/\last@defmark\endcsname{#2}% |#2| is % either 0 or 1. It is the information whether this entry is a~\CS or % not. +}% of |\@defentryze|. \long\def\@usgentryze#1{% - \@xa\let\csname gmd/usgentry/\string#1\endcsname\gmd@justadot} + \@xa\let\csname gmd/usgentry/\detokenize{#1}\endcsname\gmd@justadot} -% Initialize |\envirs@toindex| +% Initialise |\envirs@toindex| \@emptify\envirs@toindex % Now we'll do the same for the `usage' entries: \outer\def\CodeUsgIndex{\begingroup \MakePrivateLetters - \@ifstarl{\MakePrivateOthers\Code@UsgIndexStar}{\Code@UsgIndex}} + \gm@ifstar + {\@sanitize\MakePrivateOthers%^^A\verbatim@specials + \Code@UsgIndexStar}% + {\Code@UsgIndex}} % The |*| possibility is for marking environments etc. % \DefIndex\Code@UsgIndex -\long\def\Code@UsgIndex#1{\endgroup{% +\long\def\Code@UsgIndex#1{% + \endgroup{% \escapechar\m@ne \global\@usgentryze{#1}}} % \DefIndex\Code@UsgIndexStar \long\def\Code@UsgIndexStar#1{% \endgroup + {%^^A\verbatim@specials \addto@estoindex{#1}% - \@usgentryze{#1}} + \@usgentryze{#1}}% +} % For the symmetry, if we want to mark a~control sequence or an % environment's name to be indexed as a~`normal' entry, let's have: \outer\def\CodeCommonIndex{\begingroup \MakePrivateLetters - \@ifstarl{\MakePrivateOthers\Code@CommonIndexStar}{\Code@CommonIndex}} + \gm@ifstar + {\MakePrivateOthers\@sanitize\Code@CommonIndexStar}% + {\Code@CommonIndex}} % \DefIndex\Code@CommonIndex \long\def\Code@CommonIndex#1{\endgroup} @@ -4699,6 +4901,7 @@ pagella, fontspec=quiet]{gmdocc} % environments occurring in the narrative. \long\def\text@indexmacro#1{% {\escapechar\m@ne \xdef\macro@pname{\xiistring#1}}% + % ^^A \typeout{@@@@ 4803}% \@xa\quote@mname\macro@pname\relax% we process the \CS's % name char by char and quote MakeIndex controls. |\relax| is the % iterating macro's stopper. The scanned \CS's quoted name shall be the @@ -4717,13 +4920,33 @@ pagella, fontspec=quiet]{gmdocc} \def\macro@iname{}% \quote@charbychar} -% \DefIndex\quote@charbychar \def\quote@charbychar#1{% - \if\relax#1% finish quoting when you meet |\relax| or: + \ifx\relax#1% finish quoting when you meet |\relax| or: \else - \quote@char#1% - \xdef\macro@iname{\macro@iname \gmd@maybequote#1}% - \afterfi\quote@charbychar + \ifnum0\ifcat\@nx#1\@nx~1\fi\ifcat\@nx#1\relax1\fi>0 % we can meet + % active char and/or control sequences (made by) verbatim + % specials, therefore we check whether \inhash1 is an active char + % and if it is a~\CS. + \afterfifi{% we can meet an active char or a~\CS iff we use + % verbatim specials. + \ifdefined\verbatim@specials@list + \afterfi{% + \begingroup + \escapechar\@xa\@xa\@xa`\@xa\@firstofmany\verbatim@specials@list\@@nil + \@xa\endgroup + \@xa\quote@charbychar\detokenize{#1}%% for a~\CS\ + % \incs{detokenize} adds a~space but if so, it will be ignored + % by the argument scanner. + }% of |\afterfi|. + \else\PackageError{gmdoc}{Please report a\space bug in + \bslash quote@charbychar in line 4934}% + \fi% of |\ifdefined\verbatim@specials@list|. + }% of |\afterfifi|. + \else + \quote@char#1% + \xdef\macro@iname{\macro@iname \gmd@maybequote#1}% + \afterfifi\quote@charbychar + \fi \fi} % The next command will take one argument, @@ -4732,7 +4955,7 @@ pagella, fontspec=quiet]{gmdocc} % made other by |\MakePrivateOthers| macro, taken in the curly braces. \def\TextUsgIndex{\begingroup \MakePrivateLetters - \@ifstarl{\MakePrivateOthers\Text@UsgIndexStar}{\Text@UsgIndex}} + \gm@ifstar{\MakePrivateOthers\Text@UsgIndexStar}{\Text@UsgIndex}} % \DefIndex\Text@UsgIndex \long\def\Text@UsgIndex#1{% @@ -4743,7 +4966,8 @@ pagella, fontspec=quiet]{gmdocc} \long\def\Text@UsgIndexStar#1{\endgroup\@usgentryze{#1}% \text@indexenvir{#1}} -\long\def \text@indexenvir#1{% +\long\def\text@indexenvir#1{% + {\verbatim@specials \edef\macro@pname{\xiistring#1}% \if\bslash\@xa\@firstofmany\macro@pname\@@nil% if % |\string|ed |#1| begins with a~backslash, we will gobble it @@ -4754,11 +4978,12 @@ pagella, fontspec=quiet]{gmdocc} \let\gmu@tempa\macro@pname \@tempswafalse \fi + % ^^A \typeout{@@@@@ 4858}% \@xa\quote@mname\gmu@tempa\relax% \label{quote@mname comm}we - % process |\sting|ed |#1| char by char and quote MakeIndex + % process |\string|ed |#1| char by char and quote MakeIndex % controls. |\relax| is the iterating macro's stopper. The quoted % |\string|ed |#1| shall be the meaning of |\macro@iname|. - {\if@tempswa + \if@tempswa \def\quoted@eschar{\quotechar\bslash}% \else\@emptify\quoted@eschar\fi% we won't print any backslash before % an environment's name, but we will before a~\CS's name. @@ -4767,7 +4992,7 @@ pagella, fontspec=quiet]{gmdocc} \def\TextCommonIndex{\begingroup \MakePrivateLetters - \@ifstarl{\MakePrivateOthers\Text@CommonIndexStar}{\Text@CommonIndex}} + \gm@ifstar{\MakePrivateOthers\Text@CommonIndexStar}{\Text@CommonIndex}} %\DefIndex\Text@CommonIndex \long\def\Text@CommonIndex#1{\endgroup @@ -4784,7 +5009,7 @@ pagella, fontspec=quiet]{gmdocc} % to be put in marginpars. So: \outer\def\CodeMarginize{\begingroup \MakePrivateLetters - \@ifstarl + \gm@ifstar {\MakePrivateOthers\egCode@MarginizeEnvir} {\egCode@MarginizeMacro}} @@ -4796,8 +5021,11 @@ pagella, fontspec=quiet]{gmdocc} \Code@MarginizeMacro#1} % \DefIndex\Code@MarginizeMacro -\long\def\Code@MarginizeMacro#1{{\escapechar\m@ne - \@xa\glet\csname gmd/2marpar/\string#1\endcsname\gmd@justadot +\long\def\Code@MarginizeMacro#1{{% |#1| is always a~\CS. + % ^^A \typeout{@@@@ :::\xiistring#1:::}% + % ^^A \show\detokenize + \escapechar\m@ne + \@xa\glet\csname gmd/2marpar/\xiistring#1\endcsname\gmd@justadot %^^A \xdef\mname@tomarginpar{\xiistring#1} }} @@ -4809,21 +5037,22 @@ pagella, fontspec=quiet]{gmdocc} \long\def\Code@MarginizeEnvir#1{\addto@estomarginpar{#1}} % And a~macro really putting the environment's name in a~marginpar -% shall be trigged at the beginning of the nearest codeline. +% shall be triggered at the beginning of the nearest codeline. % % Here it is: \def\mark@envir{%\label{mark@envir} \ifx\envirs@tomarginpar\@empty \else - \let\do\Text@Marginize + \def\do{\Text@Marginize*}% \envirs@tomarginpar% \g@emptify\envirs@tomarginpar% \fi \ifx\envirs@toindex\@empty \else - \gmd@doindexingtext - \envirs@toindex - \g@emptify\envirs@toindex% + {\verbatim@specials + \gmd@doindexingtext + \envirs@toindex + \g@emptify\envirs@toindex}% \fi} \def\gmd@doindexingtext{% @@ -4842,8 +5071,9 @@ pagella, fontspec=quiet]{gmdocc} \@xa\quote@mname\gmd@resa\relax% see line % \ref{quote@mname comm} \& subs. for commentary. {\if@tempswa - \def\quoted@eschar{\quotechar\bslash}% - \else\@emptify\quoted@eschar\fi + \def\quoted@eschar{\quotechar\bslash}% + \else\@emptify\quoted@eschar + \fi \index@macro\macro@iname{##1}}}% } @@ -4857,27 +5087,41 @@ pagella, fontspec=quiet]{gmdocc} % ourselves with |\makeatletter| for instance when we want mark some % \CS. And |\MakePrivateOthers| for the environment and other string % case. -\outer\def\Define{\begingroup +\outer\def\Define{% note that since it's |\outer|, it doesn't have to + % be \incmd\protected. + \begingroup \MakePrivateLetters -% We do |\MakePrivateLetters| before |\@ifstarl| in order to avoid +% We do |\MakePrivateLetters| before |\gm@ifstar| in order to avoid % a~situation that \TeX\ sees a~control sequence with improper name % (another \CS than we wished) -% (because |\@ifstarl| establishes the |\catcode|s for the next token): - \@ifstarl{\MakePrivateOthers\Code@DefEnvir}{\Code@DefMacro}} +% (because |\gm@ifstar| establishes the |\catcode|s for the next token): + \gm@ifstar{\@sanitize%^^A\verbatim@specials + \Code@DefEnvir}{\Code@DefMacro}} \outer\def\CodeUsage{\begingroup \MakePrivateLetters - \@ifstarl{\MakePrivateOthers\Code@UsgEnvir}{\Code@UsgMacro}} + \gm@ifstar{% + \@sanitize%^^A\verbatim@specials + \MakePrivateOthers + \Code@UsgEnvir}{\Code@UsgMacro}} % And then we launch the macros that close the group and do the work. -\long\def\Code@DefMacro#1{% - \Code@DefIndex#1% we use the internal macro; it'll close the group. - \Code@MarginizeMacro#1} +\DeclareCommand\Code@DefMacro\long{om}{% + \Code@DefIndex#2% we use the internal macro; it'll close the group. + \IfValueTF{#1}% + {\Code@MarginizeMacro#1}% + {\Code@MarginizeMacro#2}% +} + % \DefIndex\Code@UsgMacro -\long\def\Code@UsgMacro#1{% - \Code@UsgIndex#1% here also the internal macro; it'll close the group - \Code@MarginizeMacro#1} +\DeclareCommand\Code@UsgMacro\long{om}{% + \Code@UsgIndex#2% here also the internal macro; it'll close the + % group + \IfValueTF{#1}% + {\Code@MarginizeMacro#1}% + {\Code@MarginizeMacro#2}% +} % The next macro is taken verbatim ;-) from \docfm\ and the subsequent % |\let|s, too. @@ -4908,7 +5152,7 @@ pagella, fontspec=quiet]{gmdocc} % \env{codelineindex} option which seems to be more reasonable % especially with the \env{countalllines} option} -% We initialize it due to the option (or lack of the option): +% We initialise it due to the option (or lack of the option): \AtBeginDocument{% \if@pageindex \let\special@index=\index @@ -4943,33 +5187,43 @@ pagella, fontspec=quiet]{gmdocc} % the `def' or `usage' use of an environment should be declared before % the line where the environment occurs. Note the slight difference % between these and the commands to declare a~\CS marking: the latter -% do not require to be used \emph{immediately} before the line containig the +% do not require to be used \emph{immediately} before the line containing the % \CS to be marked. We separate indexing from marginizing to leave % a~possibility of doing only one of those things. -% \DefIndex\Code@DefEnvir -\long\def\Code@DefEnvir#1{% +% +\DeclareCommand\Code@DefEnvir\long{om}{% \endgroup - \addto@estomarginpar{#1}% - \addto@estoindex{#1}% - \@defentryze{#1}{0}} + % ^^A \typeout{@@@@@ 5069: \unexpanded{#1}}% + {%^^A\verbatim@specials + \IfValueTF{#1}% + {\addto@estomarginpar{#1}}% + {\addto@estomarginpar{#2}}% + \addto@estoindex{#2}% + \@defentryze{#2}{0}}} % \DefIndex\Code@UsgEnvir -\long\def\Code@UsgEnvir#1{% +\DeclareCommand\Code@UsgEnvir\long{om}{% \endgroup - \addto@estomarginpar{#1}% - \addto@estoindex{#1}% - \@usgentryze{#1}} + {%^^A~\verbatim@specials + \IfValueTF{#1}% + {\addto@estomarginpar{#1}}% + {\addto@estomarginpar{#2}}% + \addto@estoindex{#2}% + \@usgentryze{#2}}} + -% \DefIndex\addto@estomarginpar \long\def\addto@estomarginpar#1{% - \edef\gmu@tempa{\@nx\do{\xiistring#1}}% we |\string| the argument to - % allow it to be a~control sequence. - \@xa\addtomacro\@xa\envirs@tomarginpar\@xa{\gmu@tempa}} + % ^^A \def\gmu@tempa{\do{#1}}% we |\string|ed the argument to + % ^^A % allow it to be a~control sequence but now (2008/12/14) it's not + % ^^A % necessary because |#1| is sanitised. + % ^^A \@xa\gaddtomacro\@xa\envirs@tomarginpar\@xa{\gmu@tempa} +\gaddtomacro\envirs@tomarginpar{\do{#1}}} -% \DefIndex\addto@estoindex \long\def\addto@estoindex#1{% - \edef\gmu@tempa{\@nx\do{\xiistring#1}} - \@xa\addtomacro\@xa\envirs@toindex\@xa{\gmu@tempa}} + % ^^A \typeout{@@@@ \unexpanded{#1}}% + % ^^A \edef\gmu@tempa{\@nx\do{\xiistring#1}} + % ^^A \@xa\gaddtomacro\@xa\envirs@toindex\@xa{\gmu@tempa} + \gaddtomacro\envirs@toindex{\do{#1}}} % And now a~command to mark a~`usage' occurrence of a~\CS, environment @@ -4977,36 +5231,59 @@ pagella, fontspec=quiet]{gmdocc} % has plain and starred version, first for \CSs appearing explicitly and the % latter for the strings and \CSs appearing implicitly. \def\TextUsage{\begingroup - %\label{TextUsage} + % \chgs{2008/12/8 v0.99s added \cmd\@sanitize\ in the starred + % version} + % \label{TextUsage} \MakePrivateLetters - \@ifstarl{\MakePrivateOthers\Text@UsgEnvir}{\Text@UsgMacro}} + \gm@ifstar{\@sanitize\MakePrivateOthers +%^^A \verbatim@specials + \Text@UsgEnvir}{\Text@UsgMacro}} % \DefIndex\Text@UsgMacro -\long\def\Text@UsgMacro#1{% - \endgroup{\tt\xiistring#1}% - \Text@Marginize#1% - \begingroup\Code@UsgIndex#1% we declare the kind of formatting of the entry. - \text@indexmacro#1} +\DeclareCommand\Text@UsgMacro\long{om}{% + \endgroup + % \chgs[\narrativett]{2008/12/12 v0.99s introduced in \pk{gmutils} + % and employed in the narrative verbatims, including \cs{ampulexdef} + % of the \pk{gmverb} macros} + \IfValueTF{#1}% + {\Text@Marginize*{#1}{\scanverb*{#1}}}% + {\Text@Marginize*{#2}{\scanverb*{#2}}}% + \begingroup\Code@UsgIndex#2% we declare the kind of formatting of the entry. + \text@indexmacro#2} % \DefIndex\Text@UsgEnvir -\long\def\Text@UsgEnvir#1{% - \endgroup{\tt\xiistring#1}% - \Text@Marginize{#1}% - \@usgentryze{#1}% we declare the `usage' kind of formatting of the +\DeclareCommand\Text@UsgEnvir\long{om}{% + \endgroup + % ^^A \typeout{@@@@ :::\detokenize{#1}::::}% + % ^^A \typeout{@@@@ :::\detokenize{#2}::::}% + \IfValueTF{#1}% + {\Text@Marginize*{#1}{\scanverb*{#1}}}% + {\Text@Marginize*{#2}{\scanverb*{#2}}}% + \@usgentryze{#2}% we declare the `usage' kind of formatting of the % entry and index the sequence |#1|. - \text@indexenvir{#1}} + \text@indexenvir{#2}} % We don't provide commands to mark a~macro's or environment's % definition present within the narrative because we think there won't % be any: one defines macros and environments in the code not in % the commentary. -\def\TextMarginize{\begingroup +\pdef\TextMarginize{\@bsphack\begingroup + % \chgs{2008/12/8 v0.99s added \cmd\@sanitize\ in the starred + % version} \MakePrivateLetters - \@ifstarl{\MakePrivateOthers\egText@Marginize}{\egText@Marginize}} + \gm@ifstar{% + \MakePrivateOthers\egText@MarginizeEnv}{\egText@MarginizeCS}} % \DefIndex\egText@Marginize -\long\def\egText@Marginize#1{\endgroup - \Text@Marginize#1} +\long\def\egText@MarginizeEnv#1{\endgroup + \Text@Marginize*{#1}% \chgs{2008/12/07 v0.99s a~bug fixed: braces + % added around \hash1} + \@esphack} + +\long\def\egText@MarginizeCS#1{% + \endgroup + \Text@Marginize*{#1}% +} % We check whether the margin pars are enabled and proceed % respectively in either case. @@ -5027,17 +5304,24 @@ pagella, fontspec=quiet]{gmdocc} \long\def\gmdmarginpar#1{}% \fi -\long\def\Text@Marginize#1{% - \gmdmarginpar{\marginpartt\xiistring#1}} -% Note that the above macro will just gobble its argument if the +\let\gmu@tempa\all@stars +\@xa\addtomacro\@xa\gmu@tempa\@xa{\all@unders} +\@xa\DeclareCommand\@xa\Text@Marginize\@xa!% +\@xa{\@xa Q\@xa{\gmu@tempa}m}{% + \gmdmarginpar{% + \addtomacro\verb@lasthook{\marginpartt}% + \IfValueTF{#1}{\scanverb#1}{\scanverb}{#2}}% +}% of |\Text@Marginize|. +% +% Note that the above command will just gobble its arguments if the % marginpars are disabled.^^A\NoEOF so far O.K. % % It may be advisable to choose a~condensed typewriter font for the % marginpars, if there is any. (The Latin Modern font family provides % a~light condensed typewriter font, it's set in \pk{gmdocc} class.) -\let\marginpartt\tt +\let\marginpartt\narrativett -% If we pront also the narration lines' numbers, then the index entries for \CSs and +% If we print also the narration lines' numbers, then the index entries for \CSs and % environments marked in the commentary should have codeline numbers % not page numbers and that is |\let| in line % \ref{codeline indexnumber declaration}. On the other hand, if we @@ -5055,7 +5339,7 @@ pagella, fontspec=quiet]{gmdocc} % In \docfm\ all the `working' \TeX\ code should be braced in(to) the % \env{macrocode} environments. Here another solutions are taken so to % be \docfm-compatible we only should -% nearly-ignore \env{macrocode(*)}s +% nearly-ignore \env{macrocode›[*›]}s % with their Percent and The Four Spaces Preceding ;-)\,. I.e., to ensure % the line ends are `queer'. And that the \ds\ directives will be % typeset as the \ds\ directives. And that the usual code escape @@ -5066,7 +5350,7 @@ pagella, fontspec=quiet]{gmdocc} % If you know \docfm\ conventions, note that \gmdoc\ \emph{does not} % require |\end{macrocode}| to be preceded ^^A( % with any particular number of any char :-)\,. -% \changes{v0.98b}{06/09/07}{To \env{macrocode(*)} default +% \changes{v0.98b}{06/09/07}{To \env{macrocode›[*›]} default % definitions \cs{QueerEOL} added} \newenvironment*{macrocode*}{%\label{macrocode*} @@ -5120,8 +5404,8 @@ pagella, fontspec=quiet]{gmdocc} % launched within the code. \gmd@ctallsetup \glet\stored@code@delim\code@delim - \@makeother\^^B\CodeDelim\^^B% - \ttverbatim \gmd@DoTeXCodeSpace% + \@makeother\^^B\CodeDelim*\^^B% + \ttverbatim \gmd@DoTeXCodeSpace \@makeother\|% because |\ttverbatim| doesn't do that. \MakePrivateLetters% see line \ref{MPL}.\par % ^^A \@xa\@makeother\code@delim @@ -5141,7 +5425,7 @@ pagella, fontspec=quiet]{gmdocc} \def\gmd@currenvxistar#1*#2\relax{% \edef\@currenvir{#1\if*#2\gm@xistar\fi}} % The trick is that |#2| may be either |*|\catother\ or empty. If it's -% |*|, the test is satisfied and |\if...\fi| expands to +% |*|, the test is satisfied and |\if›…\fi| expands to % |\gm@xistar|. If |#2| is empty, the test is also satisfied since % |\gm@xistar| expands to |*| but there's nothing to expand to. So, if % the environment's name ends with |*|\catother, it'll be substituted @@ -5163,15 +5447,17 @@ pagella, fontspec=quiet]{gmdocc} /xdef/oldmc@def[& /def/@nx/oldmc@end####1/@nx% /@nx\end& /@nx{/@currenvir}[& -####1^^B/@nx/end[/@currenvir]/@nx/gmd@oldmcfinis]]& +####1^^B/@nx/gmd@oldmcfinis]]& /egroup&% now |\oldmc@edef| is defined to have one parameter delimited -&% with |\end|\arg{current env.'s name} +&% with \incmd\end\arg{current env.'s name} /oldmc@def& /oldmc@end]&% \CDPerc ] \def\gmd@oldmcfinis{% - \@xa\CodeDelim\stored@code@delim + \def\gmu@tempa{\end{\@currenvir}}% + \@xa\gmu@tempa\@xa\def\@xa\gmd@lastenvir\@xa{\@currenvir}% + \@xa\CodeDelim\@xa*\stored@code@delim \gmd@mchook}% see line \ref{gmd@mchook} \def\OldMacrocodes{%% \changes{v0.99m}{2008/08/10}{renamed from @@ -5206,10 +5492,10 @@ pagella, fontspec=quiet]{gmdocc} \fi} % % \begin{environment}{macro} -% Almost the same we do with the \env{macro(*)} environments, stating +% Almost the same we do with the \env{macro›[*›]} environments, stating % only their argument to be processed as the `def' entry. Of course, % we should re|\catcode| it first. -% \DefIndex*\macro +% \DefIndex*{\macro} \newenvironment{macro}{%\label{macro} \@tempskipa=\MacroTopsep \if@codeskipput\advance\@tempskipa by-\CodeTopsep\fi @@ -5256,20 +5542,20 @@ pagella, fontspec=quiet]{gmdocc} \def\gmd@ifsingle#1#2\@@nil{% \def\gmu@tempa{#2}% \ifx\gmu@tempa\@empty} -% Note it expands to an open |\if...| test (unbalanced with |\fi|) so it +% Note it expands to an open |\if›…| test (unbalanced with |\fi|) so it % has to be used as all the |\if|s, with optional |\else| and % obligatory |\fi|. And cannot be used in the possibly skipped -% branches of other |\if...|s (then it would result with `extra +% branches of other |\if›…|s (then it would result with `extra % |\fi|/extra |\else|' errors). But the below usage is safe since both % |\gmd@ifsingle| and its |\else| and |\fi| are hidden in a~macro % (that will not be |\expandafter|ed). % -% Note also that giving |\gmd@ifsingle| an |\if...| or so as the first +% Note also that giving |\gmd@ifsingle| an |\if›…| or so as the first % token of the argument will not confuse \TeX\ since the first token -% is just gobbled. The possibility of occurrence of |\if...| or so as +% is just gobbled. The possibility of occurrence of |\if›…| or so as % a~not-first token seems to be negligible. \def\gmd@ifonetoken#1#2#3{% - \def\gmu@tempb{#3}% We hide |#3| from \TeX\ in case it's |\if...| or + \def\gmu@tempb{#3}% We hide |#3| from \TeX\ in case it's |\if›…| or % so. \inverb|\gmu@tempa| is used in \inverb|\gmd@ifsingle|. \ilrr \gmd@ifsingle#3\@@nil \afterfi{\@xa#1\gmu@tempb}% @@ -5283,15 +5569,15 @@ pagella, fontspec=quiet]{gmdocc} % it till the first scanned occurrence or just the first code line met. \long\def\Hybrid@DefMacro#1{% \Code@DefIndex{#1}% this macro closes the group opened by |\macro|. - \Text@MarginizeNext{#1}} + \Text@MarginizeNext{*{#1}}} \long\def\Hybrid@DefEnvir#1{% \Code@DefIndexStar{#1}% this macro also closes the group begun by % |\macro|. - \Text@MarginizeNext{#1}} + \Text@MarginizeNext{*{#1}}} \long\def\Text@MarginizeNext#1{% - \gmd@evpaddonce{\Text@Marginize{#1}\ignorespaces}} + \gmd@evpaddonce{\Text@Marginize#1\ignorespaces}} %^^A~\strut from before Text@Marginize deleted as unnecessary in everypar. % The following macro adds its argument to |\everypar| using an auxiliary @@ -5304,7 +5590,7 @@ pagella, fontspec=quiet]{gmdocc} \@nx\g@relaxen \csname gmd/evp/NeuroOncer\the\gmd@oncenum\endcsname}% Why does it % work despite it shouldn't? Because when the \CS got with - % \inverb|\csname...\endcsname| is undefined, it's equivalent + % \inverb|\csname›…\endcsname| is undefined, it's equivalent to % |\relax| and therefore unexpandable. That's why it passes % \inverb|\edef| and is able to be assigned.\ilrr \@xa\addtomacro\csname gmd/evp/NeuroOncer\the\gmd@oncenum\endcsname{#1}% @@ -5336,19 +5622,19 @@ pagella, fontspec=quiet]{gmdocc} % \docfm\ takes |\index@excludelist| to be a~|\toks| register to store % the list of expelled \CSs. Here we'll deal another way. For each \CS % to be excluded we'll make (|\let|, to be precise) a~control sequence -% and then we'll be checking if it's undefined (|\ifx|-equivalent +% and then we'll be checking if it's undefined (|\ifx|-equivalent to % |\relax|).\footnote{This idea comes from Marcin Woli\nacute ski.} % \def\DoNotIndex{\bgroup\MakePrivateLetters\DoNot@Index} % \changes{v0.97}{06/09/04}{\cs{MakePrivateLetters} added} % \changes{v0.98}{06/09/05}{Removed since it had not worked. The % macros in the argument should be separated with commas. I~understood -% why it didn't work: because 't was iside a~command. So I~put it back} +% why it didn't work: because 't was inside a~command. So I~put it back} % \changes{v0.98d}{06/9/11}{Unmade \cs{global}} \long\def\DoNot@Index#1{\egroup% we close the group, - \let\gmd@iedir\gmd@justadot% we declare the direction of the cluding + \let\gmd@iedir\gmd@justadot% we declare the direction of the \<?>cluding % to be \emph{ex}cluding. We act this way to be able to reverse the % exclusions easily later.\ilrr \dont@index#1.} @@ -5365,7 +5651,8 @@ pagella, fontspec=quiet]{gmdocc} \afterfifi\dont@index \else% what is else shall off the Index be expelled. {\escapechar\m@ne - \xdef\gmu@tempa{\string#1}}% + \xdef\gmu@tempa{\string#1 }}% its to sound with + % \incs{detokenize}s in tests. \@xa\let% \csname gmd/iexcl/\gmu@tempa\endcsname=\gmd@iedir% In the default % case explained e.g.\ by the macro's name, the last macro's @@ -5377,7 +5664,7 @@ pagella, fontspec=quiet]{gmdocc} \fi} %^^A( -% Let's now give the exclude list copied \*verbatim ;-) from +% Let's now give the exclude list copied \texttilde verbatim ;-) from % \pk{doc.dtx}. I~give it in the code layer because I~suppose one will % document not \LaTeX\ source but normal packages. % @@ -5444,14 +5731,14 @@ pagella, fontspec=quiet]{gmdocc} \DoNotIndex{\clearpage \closein \lowercase \@inlabelfalse}% \DoNotIndex{\selectfont \mathcode \newmathalphabet \rmdefault}% \DoNotIndex{\bfdefault}% - % From the above list I~removed some |\new...| declarations because - % I~think it may be useful to see gathered the special |\new...|s of + % From the above list I~removed some |\new›…| declarations because + % I~think it may be useful to see gathered the special |\new›…|s of % each kind. For the same reason I~would not recommend excluding % from the index such declarations as |\AtBeginDocument|, % |\AtEndDocument|, |\AtEndOfPackage|, |\DeclareOption|, % |\DeclareRobustCommand| etc. But the - % common definitions, such as |\new/providecommand| and - % |\(e/g/x)def|s, as the most common, in my opinion excluded should + % common definitions, such as |\›(new⁄|provide›)command| and + % |\›(e⁄|g⁄|x›)def|s, as the most common, in my opinion excluded should % be.^^A\) % % \stanza @@ -5488,7 +5775,7 @@ pagella, fontspec=quiet]{gmdocc} \DoNotIndex{\@input@ \@input}% \DoNotIndex{\@latex@error \@mainaux \@nameuse}% \DoNotIndex{\@nomath \@oddfoot}%|%\@onlypreamble| should be indexed - % \acro{IMO}. + % \acro{IMHO}. \DoNotIndex{\@outerparskip \@partaux \@partlist \@plus}% \DoNotIndex{\@sverb \@sxverbatim}% \DoNotIndex{\@tempcnta \@tempcntb \@tempskipa \@tempskipb}%\\ @@ -5537,7 +5824,7 @@ pagella, fontspec=quiet]{gmdocc} % \changes{v0.97}{06/09/04}{\cs{MakePrivateLetters} added.} % \changes{v0.98}{06/09/05}{\cs{MakePrivateLetters} removed since it % hadn't worked. I~understood why it didn't work: because -% 't was iside a~command and I~put it back} +% 't was inside a~command and I~put it back} % \changes{v0.98d}{06/9/11}{Unmade \cs{global}} \long\def\Do@Index#1{\egroup\@relaxen\gmd@iedir\dont@index#1.}% note @@ -5604,6 +5891,13 @@ pagella, fontspec=quiet]{gmdocc} \long\def\AtDIPrologue#1{\g@addto@macro\gmd@dip@hook{#1}} % \changes{v0.98c}{06/9/8}{added because of need} +% Now we can rollback the |\ampulexdef| made to |\verb|: +\AtDIPrologue{%\label{verb:ampulex:index} + \ampulexdef\verb\ttverbatim\verbatim@specials + {\ttverbatim\verbatim@specials}} + + + % The Author(s) of \docfm\ assume \pk{multicol} is known not to % everybody. My assumption is the other so \RequirePackage{multicol} @@ -5640,7 +5934,7 @@ pagella, fontspec=quiet]{gmdocc} % rigid but that's because of the stretchable space (more % precisely, a~|\dotfill|) between the item and the entries. But % in \pk{gmdoc} we define no such special delimiters, so we add - % an ifinite stretch. + % an infinite stretch. \small \def\@idxitem{\par\hangindent 30pt}% \def\subitem{\@idxitem\hspace*{15pt}}% @@ -5683,15 +5977,15 @@ pagella, fontspec=quiet]{gmdocc} %^^A which would |\active|ate the |<| and the other, assigned to the %^^A active |<|, would do the work and re`other' the |<| back. %^^A -%^^A We provide two versions of the seargant-activating macro: the first -%^^A makes only the first subsequent seargant typeset a~\ds\ +%^^A We provide two versions of the sergeant-activating macro: the first +%^^A makes only the first subsequent sergeant typeset a~\ds\ %^^A directive (and the previous meaning of the |<| will be restored, the %^^A latter doesn't restore the previous meaning of |<| after (by) the %^^A first occurrence and the latter obeys usual scoping rules while the %^^A scoping rules of the first (|\docstrip|) are more strict: the scope %^^A is delimited by the first occurrence of the subject~|<|. %^^A -%^^A Let us remeber that, just as all the control sequences except +%^^A Let us remember that, just as all the control sequences except %^^A |\relax|, you can use |\docstrips| as an environment, i.e., in the %^^A |\begin{docstrips}|\dots |\end{docstrips}| syntax. And, that %^^A \env{macrocode} environment declares it. @@ -5786,7 +6080,7 @@ pagella, fontspec=quiet]{gmdocc} \gmd@textEOL\gmd@modulehashone^^M}% } -% (\*Verbatim ;-) from \docfm:) +% (\texttilde Verbatim ;-) from \docfm:) \providecommand*\Module[1]{{\mod@math@codes$\langle\mathsf{#1}\rangle$}} \providecommand*\ModuleVerb[1]{{\mod@math@codes$\langle\langle\mathsf{#1}$}} @@ -5795,9 +6089,9 @@ pagella, fontspec=quiet]{gmdocc} % \subdivision{The changes history} % -% The contents of this section was copied \*verbatim from the -% \docfm's documentation, with only smallest necessary changes. Then ^^A(( -% my additions were added :-))\,. +% The contents of this section was copied \texttilde verbatim from the +% \docfm's documentation, with only smallest necessary changes. Then +% my additions were added \balsmiley(( :-))\,. % % \begin{quotation}To provide a change history log, the |\changes| % command has been @@ -5809,7 +6103,7 @@ pagella, fontspec=quiet]{gmdocc} % change]. The [second] of these arguments % is otherwise ignored, but the others are written out and may be % used to generate a history of changes, to be printed at the end of -% the document. [\dots\ I~ommit an obsolete remark about then-older +% the document. [\dots\ I~omit an obsolete remark about then-older % MakeIndex's versions.] % % The output of the |\changes| command goes into the @@ -5838,12 +6132,16 @@ pagella, fontspec=quiet]{gmdocc} % defining it as a~gobbling macro} % \def\gmd@DefineChanges{% - \outer\long\def\changes{\@bsphack\begingroup\@sanitize - \catcode`\\\z@ \catcode`\ 10 \MakePercentIgnore - \MakePrivateLetters \StraightEOL - \MakeGlossaryControls + \outer\long\def\changes{% + \gmd@changes@init \changes@}} +\def\gmd@changes@init{% + \@bsphack\begingroup\@sanitize + \catcode`\\\z@ \catcode`\ 10 \MakePercentIgnore + \MakePrivateLetters \StraightEOL + \MakeGlossaryControls} + \newcommand\changes[4][]{\PackageWarningNoLine{gmdoc}{% ^^JThe \bslash changes command used \on@line ^^Jwith no \string\RecordChanges\space declared. @@ -5895,7 +6193,6 @@ pagella, fontspec=quiet]{gmdocc} % whether \inverb|#1| is a~\CS\dots\ilrr \def\gmd@glossCStest{1}%\dots\ and tell the glossary if so. \fi - % ^^A~\@xa\quote@mname\@tempb\relax \fi \@ifundefined{gmd@glossCStest}{\def\gmd@glossCStest{0}}{}% \protected@edef\gmu@tempa{\@nx\gmd@glossary{% @@ -5927,7 +6224,7 @@ pagella, fontspec=quiet]{gmdocc} %^^A\gmd@countlines{#4}% \endgroup\@esphack} -% Let's initialize |\last@defmark| and |\GeneralName|. +% Let's initialise |\last@defmark| and |\GeneralName|. \@relaxen\last@defmark \@emptify\GeneralName @@ -5969,10 +6266,10 @@ pagella, fontspec=quiet]{gmdocc} % \cs[]{\{\<year>/\<month>/\<day>\}}. \def\ChangesStart#1#2{% -% \changes{v0.98e}{06/09/23}{\cs{string}s added before the seargants +% \changes{v0.98e}{06/09/23}{\cs{string}s added before the sergeants % in the message with account of \cs{docstrip(s)}} \gmd@setChDate#2\@@nil\c@ChangesStartDate - \typeout{^^JPackage gmdoc info: ^^JChanges' start date #1 memorized + \typeout{^^JPackage gmdoc info: ^^JChanges' start date #1 memorised as \string<\the\c@ChangesStartDate\string> \on@line.^^J} \advance\c@ChangesStartDate\m@ne% we shall show the changes \emph{at ^^B % the specified day} and later. @@ -6015,7 +6312,7 @@ pagella, fontspec=quiet]{gmdocc} % \stanza % \begin{quotation}The entries [of a~given version number] are sorted % for convenience by the name of [the macro explicitly specified as -% the first argument or] the most recently introduced macroname +% the first argument or] the most recently introduced macro name % (i.e., that in the most recent |\begin{macro}| command [or % |\Define|]). We therefore provide [|\last@defmark|] to % record that argument, and provide a default definition in case @@ -6131,13 +6428,44 @@ pagella, fontspec=quiet]{gmdocc} {\@input@{\jobname.gls}}% \g@emptify\PrintChanges} -\pdef\toCTAN#1#2{%\ +\pdef\toCTAN{%\ % \begin{enumargs} - % \item version number, - % \item date \<year/month/day>. - % \end{enumargs} + % \item \<year/month/day>\textvisiblespace\<version number> + % \end{enumargs} % \changes{v0.99r}{2008/11/22}{added} - \changes{#1}{#2}{put to \acro{CTAN} on #2}} + % \chgs{2008/11/30 v0.99s made a~shorthand for \cs{chgs} not + % \cs{changes}} + \gmd@changes@init + \gmd@toCTAN@} + +\def\gmd@toCTAN@#1{% + \edef\gmu@tempa{\gmd@chgs@parse#1 \@@nil}% + \edef\gmu@tempa{% + \unexpanded{\changes@[\generalname]}% + {\@xa\@firstofthree\gmu@tempa}% + {\@xa\@secondofthree\gmu@tempa}% + {put to \acro{CTAN} on \@xa\@secondofthree\gmu@tempa}}% + \gmu@tempa} + +% To make writing changes easier, to allow copying the date \& version +% string from the |\ProvidesPackage/Class| optional argument. + +\outer\pdef\chgs{\gmd@changes@init\gmd@chgs} +% \chgs{2008/11/30 v0.99s added} + +\DeclareCommand\gmd@chgs{o>!m}{% +% \chgs{2010/03/01 v1.0 made \cmd\long\ (consider it a~bug fix)} + %^^A\typeout{@@@@ \unexpanded{#1}::::\unexpanded{#2}}% + \IfValueTF{#1}{% + %^^A\typeout{@@@@ 6198}% + \edef\gmu@tempa{\@nx\changes@[\unexpanded{#1}]% + \@xa\unexpanded\@xa{\gmd@chgs@parse#2\@@nil}}}% + {\edef\gmu@tempa{\@nx\changes@ + \@xa\unexpanded\@xa{\gmd@chgs@parse#2\@@nil}}}% + \gmu@tempa} + +\long\def\gmd@chgs@parse#1 #2 #3\@@nil{{#2}{#1}{#3}}% +% \chgs{2010/03/01 v1.0 made \cmd\long\ (consider it a~bug fix)} % @@ -6177,7 +6505,7 @@ pagella, fontspec=quiet]{gmdocc} % in \pk{doc.dtx} \env{macrocode}s, I~counted % myself.)\begin{StraightEOL}\footnote{My opinion is that nowadays % a~check sum -% is not necessary for checking the completness of a~file but +% is not necessary for checking the completeness of a~file but % I~like it as a~marker of file development and this more than % that is its r\ocircum le in \gmdoc.} % \end{StraightEOL} @@ -6211,13 +6539,17 @@ pagella, fontspec=quiet]{gmdocc} *****+*+*+*+*+*+*+*+*+*+^^J}} \else \edef\gmu@tempa{% - \@nx\typeout{********!*!*!*!*!*!*!*!*!*!*!*!^^J% + \@nx\typeout{********\gmd@wykrzykniki^^J% *! The input file \gmd@inputname:^^J% *! The CheckSum stated: \the\check@sum\space<> my count: \the\c@CheckSum.^^J% \gmd@chschangeline *! (package gmdoc info.)^^J% - ********!*!*!*!*!*!*!*!*!*!*!*!^^J}}% + ********\gmd@wykrzykniki^^J}}% + % \chgs{2008/11/30 v0.99s + % \env{\quotechar!*\quotechar!*\quotechar!…} sequence changed to + % \env{\quotechar! \quotechar! \quotechar!…} for better + % distinction} \fi \fi \gmu@tempa @@ -6226,6 +6558,11 @@ pagella, fontspec=quiet]{gmdocc} % of \TeX ing not to have to scroll the output far nor search the log. \global\check@sum\z@} +\def\gmd@wykrzykniki{! ! ! ! ! ! ! ! ! ! ! !} +% \chgs{2008/12/01 v0.99s added} +% to be able to change it when we don't want \XeTeX\ to finish with +% Code 1 what usually breaks \pk{make}. + % As I~mentioned above, I~use the check sum mechanism to mark the file % growth. Therefore I~provide a~macro that produces a~line on the % terminal to be put somewhere at the @@ -6242,10 +6579,33 @@ pagella, fontspec=quiet]{gmdocc} \the\c@CheckSum}^^J} % And here the meaning of such a~line is defined: -\newcommand*\chschange[3]{%\label{chschange} - \csname changes\endcsname{#1}{#2}{CheckSum #3}% |\csname...| because - % \nlpercent\cs{cha\+n\+g\+es} is \inverb|\outer|. - \CheckSum{#3}} +\outer\pdef\chschange{% \ + % \begin{enumargs} + % \dc m file version, + % \dc m date, + % \dc checksum, + % \dc o the reason of check sum change, possibly short. + % \end{enumargs} + \@ifQueerEOL + {\def\EOLwasQueer{11}}{\def\EOLwasQueer{10}}% + \gmd@changes@init + \chschange@} + +\DeclareCommand\chschange@{mmmo}{%\label{chschange} + \changes@{#1}{#2}{CheckSum #3 + \IfValueT{#4}{because of #4}% + }% |\csname›…| because + % \incs{cha\+n\+g\+es} is \inverb|\outer|. + \CheckSum{#3}% + \IfValueF{#4}{% + \if\EOLwasQueer + \afterfi{% + \@ifnextchar\par{% + \@xa\gmd@textEOL\gobble}% + {}% + }% of |\afterfi|, + \fi}% of no value of |#4|, +}% of |\chschange@|.\nostanza % It will make a~`General' entry in the change history unless % used in some |\Define|'s scope or inside a~\env{macro} % environment. It's intended to be put @@ -6288,7 +6648,7 @@ pagella, fontspec=quiet]{gmdocc} % %\skiplines % \def\task#1#2{} % % What is this for? Probably to turn an obsolete command off. Or maybe -% % a~\acro{TODO}? +% % a~\acro{TO-DO}? % % \endskiplines %\subdivision{\cs{DocInclude} and the \pk{ltxdoc}-like setup} @@ -6299,7 +6659,7 @@ pagella, fontspec=quiet]{gmdocc} % include them as chapters in the classes that provide % |\chapter|. We'll redefine |\maketitle| so that it make a~chapter or % a~part heading \emph{unlike} in \pk{ltxdoc} where the file parts -% have their titlepages with only the filename and \pk{article}-like titles +% have their title pages with only the filename and \pk{article}-like titles % made by |\maketitle|. % % But we will also provide a~possibility of typesetting multiple files @@ -6315,16 +6675,18 @@ pagella, fontspec=quiet]{gmdocc} % files. % % \changes{v0.98}{06/09/05}{\cs{@makeother\protect\bslash_} added} -\newcommand*\DocInclude{\bgroup\@makeother\_\Doc@Include}% First, we -% make \inverb|_| `other' in order to allow it in the filenames. - -\newcommand*{\Doc@Include}[2][]{% originally it took just one +\DeclareCommand\DocInclude{O{}mO{}}{%\ + % \begin{enumargs} + % \dc o path (with closing slash), will not be printed + % \dc m file name without extension, will be printed + % \dc o file extension (with dot) if not \file{.sty}, \file{.cls}, + % \file{.tex}, \file{.dtx} nor \file{.fdd} + % \end{enumargs}\ + % originally it took just one % argument. Here we make it take two, first of which is intended to % be the path (with the closing \inverb |/|). This is intended not to print % the path in the page footers only the filename.\par % \CodeUsage\HLPrefix - \egroup% having the arguments read, we close the group opened by the - % previous macro for |_|\catother. \gdef\HLPrefix{\filesep}% \gdef\EntryPrefix{\filesep}% we define two rather kernel parameters % to expand to the file marker. The first will bring the information @@ -6332,7 +6694,7 @@ pagella, fontspec=quiet]{gmdocc} % |\if|s. Therefore the % definition is global. The latter is such for symmetry. \def\GeneralName{#2\actualchar\pk{#2} }% \label{GeneralName} for the - % changes'history main level entry. + % changes' history main level entry. % % Now we check whether we try to include ourselves and if % so---we'll (create and) read an \file{.auxx} file instead of @@ -6351,28 +6713,42 @@ pagella, fontspec=quiet]{gmdocc} %^^A\if@ltxDocInclude \clearpage % ^^A\fi - \gmd@docincludeaux - \def\currentfile{gmdoc-IncludeFileNotFound.000}% + \gmd@docincludeaux \def\currentfile{gmdoc-IncludeFileNotFound.000}% \let\fullcurrentfile\currentfile - \IfFileExists{#1#2.fdd}{\edef\currentfile{#2.fdd}}{% it's not \pk{.fdd}, - \IfFileExists{#1#2.dtx}{\edef\currentfile{#2.dtx}}{% it's not \pk{.dtx} - % either, - \IfFileExists{#1#2.sty}{\edef\currentfile{#2.sty}}{% it's not - % \pk{.sty}, - \IfFileExists{#1#2.cls}{\edef\currentfile{#2.cls}}{% it's + \@ifnonempty{#3}% + {% + \unless\if.\@firstofmany#3\relax\@@nil + \PackageError{gmdoc}{Optional \xiihash3 of + \string\DocInclude\space + if present has to begin with a dot (.)}% + \fi + \edef\currentfile{#2#3}% + \IfFileExists{#1\currentfile}{}% + {\PackageError{gmdoc}{\string\DocInclude\space file + \currentfile\space not found}}% + }% of if extension given. + {% if extension not given: + \IfFileExists{#1#2.fdd}{\edef\currentfile{#2.fdd}}{% it's not \pk{.fdd}, + \IfFileExists{#1#2.dtx}{\edef\currentfile{#2.dtx}}{% it's not \pk{.dtx} + % either, + \IfFileExists{#1#2.sty}{\edef\currentfile{#2.sty}}{% it's not + % \pk{.sty}, + \IfFileExists{#1#2.cls}{\edef\currentfile{#2.cls}}{% it's % not \pk{.cls}, - \IfFileExists{#1#2.tex}{\edef\currentfile{#2.tex}}{% it's - % not \pk{.tex}, - \IfFileExists{#1#2.fd}{\edef\currentfile{#2.fd}}{% so it - % must be \pk{.fd} or error. - \PackageError{gmdoc}{\string\DocInclude\space file - #1#2.fdd/dtx/sty/cls/tex/fd not found.}}}}}}}% + \IfFileExists{#1#2.tex}{\edef\currentfile{#2.tex}}{% it's + % not \pk{.tex}, + \IfFileExists{#1#2.fd}{\edef\currentfile{#2.fd}}{% so it + % must be \pk{.fd} or error. + \PackageError{gmdoc}{\string\DocInclude\space file + #1#2.fdd/dtx/sty/cls/tex/fd not found.}}}}}}}% + }% of if no extension given % \changes{v0.98j}{06/10/16}{\pk{.fdd} added in \cs{DocInclude}'s - % search for the extension.} + % search for the extension.} + \edef\currentfile{\@xa\detokenize\@xa{\currentfile}}% \edef\fullcurrentfile{#1\currentfile}% \ifnum\@auxout=\@partaux \@latexerr{\string\DocInclude\space cannot be nested}\@eha - \else \@docinclude{#1}#2 \fi}% Why is |#2| delimited with | | not + \else \@docinclude{#1}#2#3 \fi}% Why is |#2| delimited with | | not % braced as we are used to, one may ask. % \changes[\DocInclude]{v0.97}{06/09/03}{\cs{@docinclude} gets 2 params @@ -6386,13 +6762,15 @@ pagella, fontspec=quiet]{gmdocc} \clearpage %^^A\fi \if@filesw \gmd@writemauxinpaux{#2.\gmd@auxext}\fi% this strange macro with - % a~long name is another thing to allow |_| in the filenames (see - % line \ref{gmd@writemauxinpaux}). + % a~long name is another spurious thing to allow |_| in the filenames (see + % line \ref{gmd@writemauxinpaux}). which are allowed anyway unless + % active or \cat14. \@tempswatrue \if@partsw \@tempswafalse\edef\gmu@tempb{#2}% \@for \gmu@tempa:=\@partlist\do{\ifx\gmu@tempa\gmu@tempb\@tempswatrue\fi}% \fi - \if@tempswa \let\@auxout\@partaux + \if@tempswa% the file is on |\@partlist| + \let\@auxout\@partaux \if@filesw \immediate\openout\@partaux #2.\gmd@auxext\relax% Yes, only |#2|. It's to % create and process the partial \pk{.aux(x)} files always in the main @@ -6430,38 +6808,43 @@ pagella, fontspec=quiet]{gmdocc} % ^^A\fi \gmd@writeckpt{#1#2}% \if@filesw \immediate\closeout\@partaux \fi - \else\@nameuse{cp@#1#2}% + \else% the file isn't on |\@partlist| + \@nameuse{cp@#1#2}% + \g@emptify\gmd@ABIOnce \fi \let\@auxout\@mainaux}% end of |\@docinclude|. % \end{macro} % % (Two is a~sufficient number of iterations to define a~macro for.) -\def\xdef@filekey{{\@relaxen\ttfamily% \label{LetTTFRelax}This - % assignment is very trickly crafted: it makes \emph{all} - % |\ttfamily|s present in the |\filekey|'s expansion unexpandable +\def\xdef@filekey{{\@relaxen\narrativett% \label{LetTTFRelax}This + % assignment is very trickily crafted: it makes \emph{all} + % |\narrativett|s present in the |\filekey|'s expansion unexpandable % not only the one added in this step. - \xdef\filekey{\filekey, \thefilediv={\ttfamily\currentfile}}}} + \xdef\filekey{\filekey, \thefilediv={\narrativett\currentfile}}}} % To allow |_| in the filenames we must assure |_| will be \catother\ % while reading the filename. Therefore define % \DefIndex\gmd@writemauxinpaux \def\gmd@writemauxinpaux#1{% \label{gmd@writemauxinpaux} - % this name comes from `\emph{write} outto \emph main + % this name comes from `\emph{write} out to \emph main % \emph{\pk{.aux}} to \emph{in}put \emph partial % \emph{\pk{.aux}}'.\par % We wrap |\@input{|\<partial \pk{.aux}>|}| in a~|_|\catother\ % hacked scope. This hack is especially recommended here since the % \pk{.aux} file may contain a~non-|\global| stuff that should not - % be localized by a~group that we would have to establish if we + % be localised by a~group that we would have to establish if we % didn't use the hack. (Hope you understand it. If not, notify me % and for now I'll only give a~hint: ``Look at it with the \TeX's % eyes''. More uses of this hack are to be seen in \pk{gmutils} % where they are a~bit more explained.) \immediate\write\@mainaux{% - \bgroup\string\@makeother\string\_% - \string\firstofone{\egroup - \string\@input{#1}}}} + \unexpanded{% + \bgroup + \@makeother\_% to allow underscore + \@makeother\~% to allow paths beginning with |~/| + \firstofone}{\egroup + \string\@input{#1}}}} % We also slightly modify a~\LaTeX\ kernel macro |\@writeckpt| to % allow |_| in the file name. @@ -6470,8 +6853,11 @@ pagella, fontspec=quiet]{gmdocc} % \DefIndex\gmd@writeckpt \def\gmd@writeckpt#1{% \immediate\write\@partaux{% - \string\bgroup\string\@makeother\string\_% - \string\firstofone\@charlb\string\egroup} + \unexpanded{% + \bgroup + \@makeother\_% + \@makeother\~% + \firstofone}\@charlb\egroup}% \@writeckpt{#1}% \immediate\write\@partaux{\@charrb}} @@ -6553,10 +6939,10 @@ pagella, fontspec=quiet]{gmdocc} \gdef\@oddfoot{% The footer of the file pages will be its name and, % if there is a~file info, also the date and version. \@xa\ifx\csname ver@\currentfile\endcsname\relax - File \thefilediv: {\ttfamily\currentfile} % + File \thefilediv: {\narrativett\currentfile} % \else \GetFileInfo{\currentfile}% - File \thefilediv: {\ttfamily\filename} % + File \thefilediv: {\narrativett\filename} % Date: \filedate\ % Version \fileversion \fi @@ -6662,13 +7048,14 @@ pagella, fontspec=quiet]{gmdocc} \providecommand*\maketitle{\par \begingroup \def \thefootnote {\fnsymbol {footnote}}% \setcounter {footnote}\z@ - \def\@makefnmark{\hbox to\z@{$\m@th^{\@thefnmark}$\hss}}% + \def\@makefnmark{\rlap{\@textsuperscript{\normalfont\@thefnmark}}}% \long\def\@makefntext##1{\parindent 1em\noindent - \hbox to1.8em{\hss$\m@th^{\@thefnmark}$}##1}% + \hb@xt@1.8em{% + \hss\@textsuperscript{\normalfont\@thefnmark}}##1}% \if@twocolumn \twocolumn [\@maketitle ]% \else \newpage \global \@topnum \z@ \@maketitle \fi % \begin{quotation}For special formatting requirements (such as in -% \acro{TUG}boat), we use pagestyle |titlepage| for this; this is later defined +% \acro{TUG}boat), we use page style |titlepage| for this; this is later defined % to be |plain|, unless already defined, as, for example, by % \pk{ltugboat.sty}.\end{quotation} \thispagestyle{titlepage}\@thanks \endgroup @@ -6677,13 +7064,13 @@ pagella, fontspec=quiet]{gmdocc} % propagate to the next, so we have to cancel these:\end{quotation} \setcounter {footnote}\z@ \gdef\@date{\today}\g@emptify\@thanks% - \g@emptify\@author\g@emptify\@title% + \g@relaxen\@author\g@relaxen\@title% }%\par % \begin{quotation}When a number of articles are concatenated into % a~journal, for example, it is not usual for the title pages of % such documents to be formatted differently. Therefore, a class % such as \pk{ltugboat} can define this macro in advance. However, - % if no such definition exists, we use pagestyle plain for title + % if no such definition exists, we use page style plain for title % pages.\end{quotation} \@ifundefined{ps@titlepage}{\let\ps@titlepage=\ps@plain}{}% % \par And let's provide |\@maketitle| just in case: an error occurred @@ -6719,7 +7106,7 @@ pagella, fontspec=quiet]{gmdocc} \end{tabular}% \hskip 1em \@plus.17fil% \begin{tabular}[t]{c}}%| % \end{tabular}| - % And finally, let's initialize \cs{tit\+le\+set\+up} if it is not yet. + % And finally, let's initialise \cs{tit\+le\+set\+up} if it is not yet. \providecommand*\titlesetup{}% }% end of |\AtBegInput|. % @@ -6729,12 +7116,12 @@ pagella, fontspec=quiet]{gmdocc} % The \pk{ltxdoc} class redefines the |\maketitle| command to allow % multiple titles in one document. We'll do the same and something % more: our |\Doc/SelfInclude| will turn the file's |\maketitle| into -% a~part or chapter heading. But, if hte |\ltxLookSetup| declaration +% a~part or chapter heading. But, if the |\ltxLookSetup| declaration % is in force, |\Doc/SelfInclude| will make for an included file % a~part's title page and an \pk{article}-like title. % % \stanza -% Let's initialize the file division macros. +% Let's initialise the file division macros. \@relaxen\filediv \@relaxen\filedivname \@relaxen\thefilediv @@ -6750,12 +7137,16 @@ pagella, fontspec=quiet]{gmdocc} \def\InclMaketitle{% % \changes{v0.98a}{06/09/05}{renamed from \cs{incl@maketitle} because % I~needed it in self-input hacks.} + % \chgs{2008/12/10 v0.99s a~bug fixed: \cmd\if\cmd\relax\cmd\@date\ + % changed to \cmd\ifx} + % {\def\and{, }% we make |\and| just a~comma. {\let\thanks=\@gobble% for the toc version of the heading we % discard |\thanks|. - \protected@xdef\incl@titletotoc{\@title\if@fshda\protect\space - (\@author)\fi}% we add the author iff the `files have - % different authors' \nlpercent(|@fshda|) + \protected@xdef\incl@titletotoc{% + \@title\@ifauthor{% + \protect\space(\@author)}{}}% we add the author iff the `files have + % different authors' \emph{and} author exists \nlpercent(|@variousauthors|) }% \def\thanks##1{\footnotemark \protected@xdef\@thanks{\@thanks% to keep the previous |\thanks| @@ -6769,21 +7160,21 @@ pagella, fontspec=quiet]{gmdocc} [{\incl@titletotoc}]% braces to allow |[| and % |]| in the title to toc. {\protect\@title - {\smallerr% this macro is provided by the \pk{gmutils} + {\protect\smallerr% this macro is provided by the \pk{gmutils} % package after the \pk{relsize} package. - \if@fshda\\[0.15em]\protect\@author - \if\relax\@date\relax\else, \fi - \else - \if\relax\@date\relax\else\\[0.15em]\fi - \fi + \@ifauthor + {\protect\\[0.15em]\@nx\@author + \ifx\relax\@date\else, \fi}% after use, |\@date| is let to + % \incmd\relax. + {\ifx\relax\@date\else\protect\\[0.15em]\fi} % The default is that all the included files have the same % author(s). In this case we won't print the author(s) in % the headings. Otherwise we wish to print them. The % information which case are we in is brought by the - % |\if@fshda| switch defined in line \ref{@fshda}. + % |\if@variousauthors| switch defined in line \ref{@variousauthors}. % % If we wish to print the author's name -% (|\if@fshda|), then we'll print the date after the author, separated +% (|\if@variousauthors|), then we'll print the date after the author, separated % with a~comma. If we don't print the author, there still may be % a~date to be printed. In such a~case we break the line, too, and % print the date with no comma. @@ -6806,14 +7197,26 @@ pagella, fontspec=quiet]{gmdocc} % the below switch and declaration. -\newif\if@fshda -% \label{@fshda} (its name comes from \textit file\textit s +\newif\if@variousauthors +% \label{@variousauthors} (its name comes from \textit file\textit s % \textit have \textit different \textit authors). -\newcommand*\PrintFilesAuthors{\@fshdatrue} +\newcommand*\PrintFilesAuthors{\@variousauthorstrue} % And the counterpart, if you change your mind: -\newcommand*\SkipFilesAuthors{\@fshdafalse} +\newcommand*\SkipFilesAuthors{\@variousauthorsfalse} +\def\@ifauthor{%\ + % \begin{enumargs} + % \item what if true + % \item what if false + % \end{enumargs} + \ifnum\numexpr\if@variousauthors1\else0\fi* + \ifx\@author\relax0\else\ifx\@author\@empty0\else1\fi\fi>0 + \@xa\@firstoftwo + \else + \@xa\@secondoftwo + \fi +} % \subdivision{The file's date and version information} @@ -6831,7 +7234,7 @@ pagella, fontspec=quiet]{gmdocc} % Since we may documentally input files that we don't load, as \docfm\ % e.g., let's define a~declaration to be put (in the comment layer) -% before the line(s) containing |\Provides...|. The |\FileInfo| +% before the line(s) containing |\Provides›…|. The |\FileInfo| % command takes the stuff till the closing |]| and subsequent line % end, extracts from it the info and writes it to the \file{.aux} and % rescans the stuff. \eTeX\ provides a~special primitive for that @@ -6874,9 +7277,11 @@ pagella, fontspec=quiet]{gmdocc} \def\gmd@writeFI#1#2#3{% % ^^A \typeout{@@@ write FI}\show\relax - \immediate\write\@auxout{% - \global\@nx\@namedef{% - ver@#2.\if P\@firstofmany#1\@@nil sty\else cls\fi}{#3}}} + {\newlinechar=\endlinechar% \chgs{2008/11/30 v0.99s added assignment + % of \cmd\newlinechar} + \immediate\write\@auxout{% + \global\@nx\@namedef{% + ver@#2.\if P\@firstofmany#1\@@nil sty\else cls\fi}{#3}}}} \foone\obeylines{% \def\gmd@FIrescan#1{% @@ -6884,10 +7289,10 @@ pagella, fontspec=quiet]{gmdocc} % \cs{write} and \cs{@@input} which simplified the macro} % ^^A \newwrite\gmd@docrescanfile % ^^A \immediate\openout\gmd@docrescanfile=\jobname.docrescan\relax - {\newlinechar=`\^^M\scantokens{#1}}\egroup^^M}} + {\newlinechar=\endlinechar\scantokens{#1}}\egroup^^M}} -% And, for the case the input file doesn't contain |\Provides...|, +% And, for the case the input file doesn't contain |\Provides›…|, % a~macro for explicit providing the file % info. It's written in analogy to |\ProvidesFile|, \pk{source ^^B % 2${}_\epsilon$}, file L v1.1g, l.\,102. @@ -6927,11 +7332,11 @@ pagella, fontspec=quiet]{gmdocc} % here: \foone{\obeylines}% {% - \def\IndexInput#1{% \changes{v0.98b}{06/09/07}{\cs{StoreMacro}ing + \pdef\IndexInput#1{% \changes{v0.98b}{06/09/07}{\cs{StoreMacro}ing %% and \cs{RestoreMacro}ing % \cs{code@delim} added} \StoreMacro\code@delim% - \CodeDelim\^^Z% + \CodeDelim*\^^Z% \def\gmd@iihook{% \label{iihook}this hook is |\edef|ed! \@nx^^M% \code@delim\relax\@nx\let\@nx\EOFMark\relax}%^^A\@nx^^M @@ -6975,7 +7380,7 @@ pagella, fontspec=quiet]{gmdocc} % \foone{\catcode`\_=8 }% we ensure the standard |\catcode| of |_|. -{ +{% \newcommand*\catother{${}_{12}$}%\par % Similarly, if we need to say some char is of category 13 (`active'), % we'll write \catactive, got by |\catactive| @@ -7024,79 +7429,105 @@ pagella, fontspec=quiet]{gmdocc} % whether% there is a~stretch or shrink part%% and therefore it % gobbled the% \incs{gmd@textEOL}'s space. % -% When a~verbatim text occurs in an inline comment, it's advisable to +% When a~verbatim text occurs in an in-line comment, it's advisable to % precede it with |%| if it begins a~not first line of such a~comment % not to mistake it for a~part of code. Moreover, if such a~short verb % breaks in its middle, it should break with the percent at the -% beginning of the new line. For this purpose provide -\newcommand*\inverb{% +% beginning of the new line. For this purpose provide |\inverb|. It +% breaks with a~|%| at the beginning of new line. Ist starred version +% puts |%| also at the end of the upper line. +\pdef\inverb{% % \changes{v0.99g}{2007/11/12}{added} - \@ifstar{% - \def\gmu@tempa{{\tt\xiipercent}}% - \@emptify\gmu@tempb% here and in the paralell points of the other - % case and \inverb|\nlpercent| I~considered an \inverb|\ifhmode| - % test but it's not possible to be in vertical mode while in an - % inline comment. If there happens vertical mode, the commentary - % begins to be `outline' (main text). + \gm@ifstar{% + \def\gmu@tempa{\verbhyphen}% the pre-break. + \@emptify\gmu@tempb% the no-break. \gmd@inverb}% - {\@emptify\gmu@tempa - \def\gmu@tempb{\gmboxedspace}% + {\@emptify\gmu@tempa% the pre-break empty + \def\gmu@tempb{\gmboxedspace}% the no-break boxed space. \gmd@inverb}} \newcommand*\gmboxedspace{\hbox{\normalfont{ }}} -\newcommand*\gmd@nlperc[1][]{% \changes{v0.99n}{2008/08/22}{% added +\pdef\gmd@nlperc{% \changes{v0.99n}{2008/08/22}{% added % \cs{hbox}es in \cs{discretionary} to score \cs{hyphenpenalty} not % \cs{exhyphenpenalty}} + % \chgs{2008/12/06 v0.99s \cs{newcommand*} replaced with \cs{pdef} + % and optional argument's declaration removed since nothing is done + % to \texttt{\#1} in the body of now-macro. Wrapped in a~group for + % setting \cmd\hyphenpenalty} \ifhmode\unskip\fi + \begingroup\hyphenpenalty\inverbpenalty\relax \discretionary{\hbox{\gmu@tempa}}% (pre-break). I~always put % a~\incs{hbox} here to make this discretionary score the % \incs{hyphenpenalty} not \incs{exhyphenpenalty} (\TB\ p.~96) since % the latter may be 10,000 in Polish typesetting. - {{\tt\xiipercent\gmboxedspace}}% (post-break) + {\hbox{\narrationmark}}% (post-break) {\gmu@tempb}% (no-break). + \endgroup \penalty10000\hskip0sp\relax} -\newcommand*\gmd@inverb[1][]{% +\def\inverbpenalty{-1000} + +\pdef\gmd@inverb{% \gmd@nlperc \ifmmode\hbox\else\leavevmode\null\fi \bgroup \ttverbatim + \narrativett \def\breakablevisspace{% - \discretionary{\visiblespace}{\xiipercent\gmboxedspace}{\visiblespace}}% + \discretionary{\visiblespace}{\narrationmark}{\visiblespace}}% \def\breakbslash{% - \discretionary{}{\xiipercent\gmboxedspace\bslash}{\bslash}}% + \discretionary{}{\narrationmark\type@bslash}{\type@bslash}}% \def\breaklbrace{% \discretionary {\xiilbrace\verbhyphen}% - {\xiipercent\gmboxedspace}% + {\narrationmark}% {\xiilbrace}}% \gm@verb@eol - %^^A \@ifstar {\@sverb@chbsl} + %^^A \gm@ifstar {\@sverb@chbsl} %^^A~ {\gmobeyspaces\frenchspacing\@sverb@chbsl} \@sverb@chbsl% It's always with visible spaces. } -\newcommand*\nlpercent{% - \@ifstar{\def\gmu@tempa{{\tt\xiipercent}}% - \@emptify\gmu@tempb - \gmd@nlperc}% - {\@emptify\gmu@tempa - \def\gmu@tempb{\gmboxedspace}% - \gmd@nlperc}} +\pdef\nlperc{\newline\narrationmark\ignorespaces} + +\pdef\nlpercent{% + % ^^A \gm@ifstar{\def\gmu@tempa{{\tt\xiipercent}}% + % ^^A \@emptify\gmu@tempb + % ^^A \gmd@nlperc}% + % ^^A { + % \chgs{200/12/7 v0.99s starred version discarded as never used and + % undocumented} + % \UnDef + \@emptify\gmu@tempa + \def\gmu@tempb{\gmboxedspace}% + \gmd@nlperc + % ^^A} +} -\newcommand*\incs{% an inline \cs{cs} + +\pdef\incs{% an in-line \cs{cs} % \changes{v0.99m}{008/08/07}{added} - \@ifstar{\def\gmu@tempa{{\tt\xiipercent}}% - \@emptify\gmu@tempb - \gmd@nlperc\cs}% - {\@emptify\gmu@tempa - \def\gmu@tempb{\gmboxedspace}% - \gmd@nlperc\cs}} + % \chgs{200/12/7 v0.99s starred version discarded as never used and + % undocumented} + % ^^A \gm@ifstar{\def\gmu@tempa{{\tt\xiipercent}}% + % ^^A \@emptify\gmu@tempb + % ^^A \gmd@nlperc\cs}% + % ^^A { + % \UnDef + \@emptify\gmu@tempa + \def\gmu@tempb{\gmboxedspace}% + \gmd@nlperc\cs + % ^^A} +} \def\inenv{\incs[]}% an in-line \cs{env} +\def\incmd{% it has to be |\def| to let it expand to let \incmd\cmd\ + % convert its argument to a~safe string. + \nlpercent\cmd} +\def\inhash{\nlpercent\hash} % As you see, |\inverb| and |\nlpercent| insert a~discretionary that % breaks to |%| @@ -7107,15 +7538,19 @@ pagella, fontspec=quiet]{gmdocc} % |\verb*| but the breakables of it break to |%| in the % lower line. % -% \acro{TODO}: make the space flexible (most probably it requires using sth.\ +% \acro{TO-DO}: make the space flexible (most probably it requires using sth.\ % else than |\discretionary|). %\stanza % -% An optional hyphen for \CSs in the inline comment: -\@ifundefined{+}{}{\typeout{^^Jgmdoc.sty: redefining \bslash+.}} -\def\+{\discre{{\normalfont-}}{{\tt\xiipercent\gmboxedspace}}{}} -% -% +% An optional hyphen for \CSs in the in-line comment: +% \Define*{\cs} + +\@xa\ampulexdef\csname\string\cs\endcsname +[\ampulexhash1] [{{\ampulexhash1}}] {\begingroup} {\ifdefined} +{\begingroup \def\+{\discre{\gmv@hyphen}{\narrationmark}{}}% + \ifdefined} + +%^^A\nameshow{\string\cs} \providecommand*\ds{DocStrip} @@ -7139,7 +7574,7 @@ pagella, fontspec=quiet]{gmdocc} % |\usepackage|. \newcommand*\CDAnd{\CodeDelim\&} -\newcommand*\CDPerc{\CodeDelim*\%} +\newcommand*\CDPerc{\CodeDelim\%} % And for documenting in general: % @@ -7170,59 +7605,172 @@ pagella, fontspec=quiet]{gmdocc} \long\def\AfterMacrocode#1#2{\@namedef{gmd@mchook#1}{#2}} % What have I~done? I~declare a~new counter and employ it to count the -% \env{macrocode(*)}s (and \env{oldmc(*)}s too, in fact) and attach +% \env{macrocode›[*›]}s (and \env{oldmc›[*›]}s too, in fact) and attach % a~hook to (after) the end of every such environment. That lets us to % put some stuff pretty far inside the compiled file (for the buggie % in \file{doc.dtx}, to redefine |\gmu@tempb/c|). -% One more detail to expalin and define: the |\gmd@mcdiag| macro may +% One more detail to explain and define: the |\gmd@mcdiag| macro may % be defined to type out a~diagnostic message (the -% \env{macrocode(*)}'s number, code line number and input line number). +% \env{macrocode›[*›]}'s number, code line number and input line number). \@emptify\gmd@mcdiag \def\mcdiagOn{\def\gmd@mcdiag{% - \typeout{^^J\bslash end{\@currenvir} No.\the\c@gmd@mc + \typeout{^^J\bslash end{\gmd@lastenvir} No.\the\c@gmd@mc \space\on@line, cln.\the\c@codelinenum.}}} \def\mcdiagOff{\@emptify\gmd@mcdiag} % % An environment to display the meaning of macro parameters: its % items are automatically numbered as |#1|, |#2| etc. -\newenvironment*{enumargs}[1][1]% -% \changes{v0.99n}{2008/08/21}{developed for the case of inline +\DeclareEnvironment{enumargs}{o}%\ +% the optional argument specifies number of \inverb|#|'s; it's of the +% |o| type to inform if it was not given by the user to handle +% a~possible active char touched by argument's catcher; can be 1 (the +% default), 2 or 4; any else produces one \inverb|#|. +% \changes{v0.99n}{2008/08/21}{developed for the case of in-line % comment} % \changes{v0.99o}{2008/09/04}{added the optional argument which is % the number of hashes (1 by default or 2 or 4)} % \changes{v0.99p}{2008/10/4}{added optional arguments' handling} -{\if@aftercode\edef\gmu@tempa{\the\leftskip}% - \edef\gmu@tempb{\the\hangindent}\fi +% \chgs{2008/12/8 v0.99s added \cmd\StraightEOL to let the in-line +% comment continue after this environment} +{% + \StraightEOL + \if@aftercode + \edef\gmu@tempa{\the\leftskip}% + \edef\gmu@tempb{\the\hangindent}% + \fi \enumerate \if@aftercode \leftskip=\glueexpr\gmu@tempa+\gmu@tempb\relax \fi + \edef\gmd@ea@hashes{% + \#\ifcase\IfValueTF{#1}{#1}{1}\relax + \or\or\#\or\or\#\#\#\fi}% + %\stanza \@namedef{label\@enumctr}{% - \env{\if@aftercode\code@delim\space\fi + \env{\if@aftercode\narrationmark\fi + \relax% to stop |\ignorespaces| \gmd@ea@bwrap - \#\ifcase#1\relax\or\or\#\or\or\#\#\#\fi + \gmd@ea@hashes \csname the\@enumctr\endcsname - \gmd@ea@ewrap}}% + \gmd@ea@ewrap}}% of |\label⁄<@enumctr>|. \let\mand\item \provide\gmd@ea@wraps{% \emptify\gmd@ea@ewrap \emptify\gmd@ea@bwrap}% \gmd@ea@wraps - \def\opt{% + \def\opt{%\HideDef \def\gmd@ea@bwrap{[}\def\gmd@ea@ewrap{]}% \item \gmd@ea@wraps}% -} + %\stanza + \settowidth{\@tempdima}{\narrativett x\gmd@ea@hashes7x}% + \edef\gmd@ea@xxxwd{\the\@tempdima}% + %\stanza + \DeclareCommand\dc !{% + Q{*>} % (1) we check whether there's a~sergeant right of the prefix or + % a~star to suppress parentheses, + Q{P!lL\long iI} % (2) an optional ‘bare’ prefix for a~‘long’ argument + % or for ignored + b % (3) prefix(es) in curly braces + % ( % This way we allow the prefix(es) to be braced or not + % at the author's option), + S{bBcCmoOQsSTAGK\afterassignment} % (4) (optional) argument type + % specifier, + b % (5) (optional) default value of the specified argument or + % (for |K| and |G|) mandatory. + b % (6) default of |K| and |G|. + }{% + \IfAmong *\among{##1}% + {% a~|*| suppresses bracket/brace/parentheses decoration. + \def\gmd@ea@bwrap{\hbox to \gmd@ea@xxxwd\bgroup\hss}% + \def\gmd@ea@ewrap{\hss\egroup}% + }% + {% if there's no |*| in \hash1, be wrap the item label in + % braces/brackets/parentheses. + \IfAmong ##4\among{bB}{% I~decide not to print |m| type + % arguments in braces because the braces are not mandatory for + % this type. + \def\gmd@ea@bwrap{\{}% + \def\gmd@ea@ewrap{\}}% + }{}% + \IfAmong ##4\among{cC}{% + \def\gmd@ea@bwrap{(}% + \def\gmd@ea@ewrap{)}% + }{}% + \IfAmong ##4\among{oO}{% + \def\gmd@ea@bwrap{[}% + \def\gmd@ea@ewrap{]}% + }{}% + \IfAmong ##4\among{G}{% + \def\gmd@ea@bwrap{\detokenize\@xa{\@firstoftwo##5}}% + \def\gmd@ea@ewrap{\detokenize\@xa{\@secondoftwo##5}}%% + }{}% + \IfAmong ##4\among{A}{% + \def\gmd@ea@bwrap{<}% + \def\gmd@ea@ewrap{>}% + }{}% + }% of if no |*| in \hash1. + \IfAmong ##4\among{mQsSTK\afterassignment}{% + \def\gmd@ea@bwrap{\hbox to \gmd@ea@xxxwd\bgroup\hss}% + \def\gmd@ea@ewrap{\hss\egroup}% + }{}% + % we add a~normal space + \addtomacro\gmd@ea@ewrap{{\normalfont\ }}% + \IfValueT{##2}{% + \addtomacro\gmd@ea@ewrap{>\{\string##2\}}}% + \IfValueT{##3}{% + \addtomacro\gmd@ea@ewrap{>\{##3\}}}% + \IfValueT{##4}{% + \ifx s##4% + \addtomacro\gmd@ea@ewrap{% + \llap{\metachar[}\scanverb{*}\metachar]}% + \else\addtomacro\gmd@ea@ewrap{##4}% + \fi}% + \IfValueT{##5}{% + \addtomacro\gmd@ea@ewrap{\{% + %\nostanza|%\ttverbatim| breakable chars won't work because we are in + % the item's label's \incmd\hbox. \nostanza + \scanverb*{##5}% + \}}}% + \IfValueT{##6}{% + \addtomacro\gmd@ea@ewrap{\{% + %\nostanza|%\ttverbatim| breakable chars won't work because we are in + % the item's label's \incmd\hbox. \nostanza + \scanverb*{##6}% + \}}}% + \def\gmd@blubra{% + \addtomacro\gmd@ea@bwrap{% + \begingroup + \relaxen\gmd@ea@hashes + \@namedef{the\@enumctr}{\<ign.>}% + }% + \prependtomacro\gmd@ea@ewrap{% + \endgroup}% + \addtomacro\gmd@ea@ewrap{% + \global \advance \csname c@\@enumctr\endcsname \m@ne + }% + \emptify\gmd@blubra + }% + \IfIntersect {##2}{Ii}{\gmd@blubra}{}% + \IfIntersect {##3}{Ii}{\gmd@blubra}{}% + \IfAmong ##4\among{\afterassignment}{\gmd@blubra}{}% + \item\relax}% + % \stanza + \IfNoValueT{#1}{\@ifnextac\@gobble{}}% to gobble a~possible active line end or + % active \hathat{A} or \hathat{B} that might + % have occurred because of \incmd\futurelet\ of the optional + % argument checker. + }% of begin definition \ResumeDef {\endenumerate} % The starred version is intended for lists of arguments some of which % are optional: to align them in line. \newenvironment*{enumargs*}{% - \def\gmd@ea@wraps{% - \def\gmd@ea@bwrap{ }\def\gmd@ea@ewrap{ }}% + \def\gmd@ea@wraps{% \HideDef + \def\gmd@ea@bwrap{ }\def\gmd@ea@ewrap{ }}% \ResumeDef \enumargs}{\endenumargs} % @@ -7282,6 +7830,7 @@ pagella, fontspec=quiet]{gmdocc} % i.e., they do two things of the three. So let's |\def| them to do these % two things in this package, too: \outer\def\DescribeMacro{% + \@bsphack \begingroup\MakePrivateLetters \gmd@ifonetoken\Describe@Macro\Describe@Env} % Note that if the argument to |\DescribeMacro| is not @@ -7289,34 +7838,39 @@ pagella, fontspec=quiet]{gmdocc} % shall it be processed \emph{except} the \cs{Mak\-ePriv\-at\-e\-Oth\-ers} % re|\catcode|ing shall not be done to it. \outer\def\DescribeEnv{% + \@bsphack \begingroup\MakePrivateOthers\Describe@Env} -% Actually, I've used the |\Describe...| commands myself a~few times, so +% Actually, I've used the |\Describe›…| commands myself a~few times, so % let's |\def| a~common command with a~starred % version: \outer\def\Describe{% It doesn't typeset its argument in the point of % occurrence. + \leavevmode + \@bsphack \begingroup\MakePrivateLetters - \@ifstarl{\MakePrivateOthers\Describe@Env}{\Describe@Macro}} + \gm@ifstar{\MakePrivateOthers\Describe@Env}{\Describe@Macro}} -% The below two definitions are adjusted \*s of |\Text@UsgMacro| and +% The below two definitions are adjusted \texttilde s of |\Text@UsgMacro| and % |\Text@UsgEnvir|. % \DefIndex\Describe@Macro \long\def\Describe@Macro#1{% \endgroup - \strut\Text@Marginize#1% + \strut\Text@Marginize*{#1}% \@usgentryze#1% we declare kind of formatting the entry - \text@indexmacro#1\ignorespaces} + \text@indexmacro#1% + \@esphack} % \DefIndex\Describe@Env \def\Describe@Env#1{% \endgroup - \strut\Text@Marginize{#1}% + \strut\Text@Marginize*{#1}% \@usgentryze{#1}% we declare the `usage' kind of % formatting the entry and index the sequence |#1|. - \text@indexenvir{#1}\ignorespaces} + \text@indexenvir{#1}% + \@esphack} -% Note that here the environments' names are typeset in |\tt| font +% Note that here the environments' names are typeset in |\narrativett| font % just like the macros', \emph{unlike} in \docfm. % % \stanza @@ -7324,7 +7878,7 @@ pagella, fontspec=quiet]{gmdocc} % as causing chaos not beauty. That's the philosophical and \ae^^B % sthetic reason why I~don't provide \TextUsage\MacroFont. In % my opinion there's a~noble tradition of typesetting the \TeX\ code -% in |\tt| font nad this tradition sustained should be. If one wants +% in |\tt| font and this tradition sustained should be. If one wants % to change the tradition, let \himher\ redefine |\tt|, in \TeX\ it's % no problem. I~suppose |\MacroFont| is not used explicitly, and that % it's (re)defined at most, but just in case let's |\let|: @@ -7349,7 +7903,7 @@ pagella, fontspec=quiet]{gmdocc} % \pk{gmdoc}. Instead of it there is \TextUsage\LineNumFont\ % declaration and a~possibility to redefine |\thecodelinenum| as for % all the counters. Here the |\LineNumFont| is used two different -% ways, to set the benchmark width for a~linenumber among others, so it's not +% ways, to set the benchmark width for a~line number among others, so it's not % appropriate to put two things into one macro. Thus let's give the % user a~notice if \heshe\ defined this macro: % @@ -7377,7 +7931,7 @@ pagella, fontspec=quiet]{gmdocc} % \possfil\TextUsage\PrintDescribeEnv\ and % \possfil\TextUsage\PrintEnvName\ are not % supported by \pk{gmdoc}. They seem to me to be too internal to take -% care of them. Note that in the name of (\ae sthetical) minimality +% care of them. Note that in the name of (\ae sthetic) minimality % and (my) convenience I~deprive you of easy knobs to set strange % formats for verbatim bits: I~think they are not advisable. % @@ -7419,22 +7973,22 @@ pagella, fontspec=quiet]{gmdocc} \def\DisableCrossrefs{\@bsphack\@esphack}\@esphack} % The latter definition is made due to the footnote 6 on p.\,8 of the % Frank Mittelbach's \docfm's documentation and both of them are -% copies of lines 302--304 of it modulo |\|(|un|)|gag@index|. +% copies of lines 302--304 of it modulo |\›[un›]gag@index|. % % \stanza -% The subsequent few lines I~copy almost verbatim ;-) from the lines +% The subsequent few lines I~copy almost verbatim \balsmiley( ;-) from the lines % 611--620. -\newcommand*\AlsoImplementation{\@bsphack% +\newcommand*\AlsoImplementation{\@bsphack \long\def\StopEventually##1{\gdef\Finale{##1}}% we define - % \cs{Fi\+n\+a\+le} just to expand to the argument of |\StopEventually| not - % to to add anything to the end input hook because |\Finale| should + % \incs{Fi\+n\+a\+le} just to expand to the argument of \incs{StopEventually} not + % to to add anything to the end input hook because \incs{Finale} should % only be executed if entire document is typeset.\nostanza\par % % \hangindent\verbatimhangindent \hangafter1\relax % \gmdnoindent \leftskip\CodeIndent % |%\init@checksum| is obsolete in % \pk{gmdoc} at this point: the \env{CheckSum} counter is reset just at - % the beginning of (each of virtually numerous) input(s). + % the beginning of (each of probably numerous) input(s). % \nostanza\par \@esphack} @@ -7459,7 +8013,7 @@ pagella, fontspec=quiet]{gmdocc} % The \TextUsage\meta\ macro is so beautifully crafted in \docfm\ that % I~couldn't resist copying it into \pk{gmutils}. It's also available % in Knuthian (\TeXbook\ format's) disguise -% \Describe*{\<...>}|\<|\<the argument>|>|. +% \Describe*{\<⁄kern⁄string-3pt›…>}|\<⁄<the argument>>|. % \stanza % The checksum mechanism is provided and developed for a~slightly % different purpose. @@ -7489,7 +8043,7 @@ pagella, fontspec=quiet]{gmdocc} % % \stanza % Frank Mittelbach in \docfm\ provides the \TextUsage\verbatimchar\ -% macro to (re)define the |\verb(*)|'s delimiter for the index +% macro to (re)define the |\verb›[*›]|'s delimiter for the index % entries. The \gmdoc\ package uses the same macro and its default definition % is |{&}|. When you use \docfm\ you % may have to redefine |\verbatimchar| if you use (and index) the |\+| @@ -7505,12 +8059,12 @@ pagella, fontspec=quiet]{gmdocc} % accordance of the `macro' and the `environment' index entries; the % \cs[]{\$} sign set as its alternative} -% One more a~very neat macro provided by \docfm. I~copy it -% verbatim and put into \pk{gmutils}, too. (|\DeclareRobustCommand| -% doesn't issue an error if its argument has been defined, it only -% informs about redefining.) -\pdef\*{\leavevmode\lower.8ex\hbox{$\,\widetilde{\ }\,$}} -% \changes{v0.98}{06/09/05}{made robust.} +% ^^A % One more a~very neat macro provided by \docfm. I~copy it +% ^^A % verbatim and put into \pk{gmutils}, too. (|\DeclareRobustCommand| +% ^^A % doesn't issue an error if its argument has been defined, it only +% ^^A % informs about redefining.) +% ^^A \pdef\*{\leavevmode\lower.8ex\hbox{$\,\widetilde{\ }\,$}} +% ^^A % \changes{v0.98}{06/09/05}{made robust.} % \TextUsage\IndexPrologue\ is defined in line @@ -7523,7 +8077,7 @@ pagella, fontspec=quiet]{gmdocc} % About how the \ds\ directives are supported by \pk{gmdoc}, % see section \gmiflink[docstrip]{The \ds\dots}. % This support is not \emph{that} sophisticated as in \docfm, among others, it -% doesn't count the modules' nesting. Therefore if we dont want an +% doesn't count the modules' nesting. Therefore if we don't want an % error while \pk{gmdoc}umenting \docfm-prepared files, better let's % define \docfm's counter for the modules' depths. \newcounter{StandardModuleDepth} @@ -7570,7 +8124,7 @@ pagella, fontspec=quiet]{gmdocc} % with \verb+|+ in mind). \docfm's % concept is different, there a~`shortverb' char should in the math % mode work as shortverb. So let it be as they wish: \pk{gmverb} -% provides |\OldMakeShortVerb| and the oldstyle input commands change +% provides |\OldMakeShortVerb| and the old-style input commands change % the inner macros so that also |\MakeShortVerb| works as in \docfm % (cf.\ line \ref{oldmkshvrrb}). % @@ -7584,7 +8138,7 @@ pagella, fontspec=quiet]{gmdocc} % \changes{v0.98}{06/09/05}{\cs{@makeother\protect\bslash_} added} % \changes{v0.98a}{06/09/05}{\cs{AtBegInput} changed into % \cs{AtBegInputOnce}.} -% \changes{v0.98b}{06/09/07}{enrichments of the \env{macrocode(*)} +% \changes{v0.98b}{06/09/07}{enrichments of the \env{macrocode›[*›]} % definitions moved to the default definitions of these envs.} \def\OldDocInput{% \changes{v0.99g}{2007/11/11}{obsolete redefinition % of the \env{macro} environment removed} @@ -7595,13 +8149,13 @@ pagella, fontspec=quiet]{gmdocc} \bgroup\@makeother\_% it's to allow |_| in the filenames. The next % macro will close the group. \Doc@Input} -% We don't swith the |@codeskipput| switch neither we check it because +% We don't switch the |@codeskipput| switch neither we check it because % in `old' world there's nothing to switch this switch in the % narration layer. % % \stanza -% I~had a~hot and wild \TeX\ all the night nad what a~bliss when -% the `Succesfully formated 67 page(s)' message appeared. +% I~had a~hot and wild \TeX\ all the night and what a~bliss when +% the `Successfully formated 67 page(s)' message appeared. % % My package needed fixing some bugs and adding some compatibility % adjustments (listed in the previous section) and the original @@ -7624,7 +8178,7 @@ pagella, fontspec=quiet]{gmdocc} % commented out within \env{macrocode} are considered a~normal % commentary i.e., not verbatim. Therefore some macros `commented out' % to be shown verbatim as an example source must have been `additionally' -% verbatimized for \gmdoc\ with the shortverb chars e.g. You may also +% verbatimized for \gmdoc\ with the shortverb chars e.g.\ You may also % change the code delimiter for a~while, e.g., the line % \CodeDelim\. % \AVerySpecialMacro % delete the first % when.\unskip|..|\par\CDPerc @@ -7645,6 +8199,34 @@ pagella, fontspec=quiet]{gmdocc} % Moreover, it's \TeX ing \docfm\ what inspired adding the % |\StraightEOL| and |\QueerEOL| declarations. % +% \division{\cs{OCRInclude}} +% I~realised that I~want to print all my \TeX\ source files verbatim +% just in case my computers and electronic memories break so that +% I~can reconstruct them via \ac{OCR} . For this purpose I~provide +% \cmd\OCRInclude. It takes the same arguments as |\DocInclude| only +% typesets a~file with no index nor line numbers. + +\DeclareCommand\OCRInclude{O{}mO{}}{% + \StoreMacro\incl@DocInput + \def\incl@DocInput##1{% + \begingroup + \CodeSpacesBlank + \@beginputhook + \title{\currentfile}\maketitle + \noverbatimspecials + \relaxen\@xverbatim + \relaxen\check@percent + \RestoreMacro\@verbatim + \verbatimleftskip\z@skip + \verbatim + \@makeother\|% because |\ttverbatim| doesn't do that. + \texcode@hook% we add some special stuff, e.g.\ in \pk{gmdocc.cls} we + \@input{##1}% + \endgroup}% + \csname\string\DocInclude\endcsname{#1}{#2}{#3}% + \RestoreMacro\incl@DocInput +} + % % % \division{Polishing, development and bugs} @@ -7652,7 +8234,7 @@ pagella, fontspec=quiet]{gmdocc} % \begin*{bulletpars} % \everypar{$\bullet$ } % \label{Tasks}|\MakePrivateLetters| theoretically may interfere -% with |\active|ating some chars to allow linebreaks. But making +% with |\active|ating some chars to allow line breaks. But making % a~space or an opening brace a~letter seems so perverse that we may % feel safe not to take account of such a~possibility. % @@ -7688,7 +8270,7 @@ pagella, fontspec=quiet]{gmdocc} % documentations? If so, I~should `\acro{EOL}-straighten' them like % |\tableofcontents|, I~suppose (cf.\ line \ref{straighttoc}). % -% Some lines of non-printing stuff such as |\Define...| and +% Some lines of non-printing stuff such as |\Define›…| and % |\changes| connecting the narration with the code resulted with % unexpected large vertical space. Adding a~fully blank line between % the printed narration text and not printed stuff helped. @@ -7703,21 +8285,21 @@ pagella, fontspec=quiet]{gmdocc} % \ \par\vspace*{-\baselineskip} % % \def\EOFMark{\<eof>} -% \division{(No) \EOFMark} +% \division{{\mch[No\mch]} \EOFMark} % % Until version 0.99i % a~file that is |\DocInput| had to be ended with a~comment line with % an |\EOF| or |\NoEOF| \CS that % suppressed the end-of-file character to make input end % properly. Since version 0.99i however the proper ending of input is -% acheved with |\everyeof| and therefore |\EOF| and |\NoEOF| become +% achieved with |\everyeof| and therefore |\EOF| and |\NoEOF| become % a~bit obsolete. % % If the user doesn't wish the documentation to be ended by -% `\EOFMark', \heshe\ should redefine the |\EOFMark| \CS or end -% the file with a~comment ending with |\NoEOF| macro defined -% below\footnote{Thanks to Bernd Raichle at Bacho\TeX\ 2006 ^^B Pearl -% Session where he presented \cs{input}ing a~file inside ^^B +% `\EOFMark', \heshe\ should redefine the |\EOFMark| \CS or end the +% file with a~comment ending with |\NoEOF| macro defined +% below\qfootnote{Thanks to Bernd Raichle at Bacho\TeX\ 2006 Pearl +% % Session where he presented \cs{input}ing a~file inside % \cs{edef}.}: % @@ -7732,12 +8314,14 @@ pagella, fontspec=quiet]{gmdocc} % \changes{v0.98l}{06/10/27}{divided in two macros first of which % makes queer \acro{EOL} and the latter gobbles the stuff till the \acro{EOL} to % suppress possible \cs{endinput} when used in \cs{StopEventually}} -% \label{NoEOF} As you probably see, \cs{(No)EOF} have the `immediate' +% \label{NoEOF} As you probably see, |\›[No›]EOF| have the `immediate' % |\endinput| effect: the file ends even in the middle of a~line, the % stuff after \cs{(No)EOF} will be gobbled unlike with a~bare % |\endinput|. + + \endinput %^^A~\docstrip %</package> @@ -7771,7 +8355,7 @@ pagella, fontspec=quiet]{gmdocc} % \changes{v0.98g}{06/10/10}{among others, \cs{discretionary}s for breaking % a~\CS to percent at the beginning of the lower line. Moreover, fixing % a~bug/feature that leaves the code leftskip in the narration when an -% inline comment is followed by another codeline (w.o.\ explicit +% in-line comment is followed by another codeline (w.o.\ explicit % \cs{par}). And lots of finishing touches to the text. A~special font % for the marginpar \CSs among others} % @@ -7779,14 +8363,14 @@ pagella, fontspec=quiet]{gmdocc} % for each use substituted with one macro added at begin input. In % \cs{gmd@evpaddonce} a~counter substituted with a~numeric % macro. \cs{@ifQueerEOL} made polite i.e., a~two-argument not -% expanding to an open \cs{if...}} +% expanding to an open \cs{if›…}} % -% \changes{v0.99}{06/11/24}{\env{oldmc(*)} implemented that's -% (hope)fully compatible with \docfm's \env{macrocode(*)}. Moreover, -% a~declaration letting \gmdoc's \env{macrocode} to \env{oldmc(*)}} +% \changes{v0.99}{06/11/24}{\env{oldmc›[*›]} implemented that's +% (hope)fully compatible with \docfm's \env{macrocode›[*›]}. Moreover, +% a~declaration letting \gmdoc's \env{macrocode} to \env{oldmc›[*›]}} % % \changes{v0.99a}{06/11/30}{The \ds\ directives implemented fully -% automatic (no more need of \cs{doctrip(s)} declarations). Moreover, +% automatic (no more need of \cs{docstrip(s)} declarations). Moreover, % some minor changes due to \TeX ing The Source.} % % \changes{v0.99b}{2007/01/01}{Thanks to the \cs{edverbs} declaration @@ -7819,18 +8403,43 @@ pagella, fontspec=quiet]{gmdocc} % respective macro added in \pk{gmdocc}. I~made a~\file{tds} archive} % % \changes{v0.99i}{2008/08/03}{A~“feature not bug” fix: thanks to -% \cs{everyeof} the \cs{(No)EOF} is now not necessary at the end of +% \cs{everyeof} the \cs{\mch[No\mch]EOF} is now not necessary at the end of % \cs{DocInput} file.} % % \changes{v0.99m}{2008/08/08}{Counting of all lines developed (the % \env{countalllines} package option), now it % uses \cs{inputlineno}} % -% \changes{v0.99n}{2008/08/24}{Inline comments' alignment developed} +% \changes{v0.99n}{2008/08/24}{In-line comments' alignment developed} +% +% \chgs{2008/12/05 v0.99s \cs{gmd@ifinmeaning} moved to \pk{gmutils} +% and renamed to \cs{@ifinmeaning}} +% +% \chgs{2008/12/07 v0.99s \cmd\@bsphack---\cmd\@esphack\ added to +% \cmd\TextMarginize, \cmd\Describe, \cmd\DescribeMacro\ and +% \cmd\DescribeEnv} +% +% % \chgs{2010/03/01 v0.99t Since \pk{geometry} v.5.2 \pk{gmeometric} +% % is obsolete so was removed} % % \Finale % (For my GNU Emacs:) %%% Local Variables: %%% mode: doctex +%%% mode: flyspell +%%% ispell-local-dictionary: "british" %%% End: + +% LocalWords: onlypreamble defentryze MarginizeMacro NoEOF UsgMacro UsgEnvir +% LocalWords: indexmacro indexenvir estomarginpar tomarginpar toindex DefIndex +% LocalWords: DefIndexStar usgentryze UsgIndex UsgIndexStar estoindex justadot +% LocalWords: CommonIndex CommonIndexStar isaCS MarginizeCS marginparsused ea +% LocalWords: MarginizeNext DefEnvir defentryzed KVOfamily delim dolspaces +% LocalWords: DoTeXCodeSpace continuenarration setclubpenalty LocalWords bwrap +% LocalWords: ewrap PrintEnvName DefMacro MarginizeEnv lasthook texcodespace +% LocalWords: pname charbychar firstpar docincludeaux writemauxinpaux mainaux +% LocalWords: writeckpt variousauthors ifauthor variousauthorsfalse textEOL +% LocalWords: variousauthorstrue beginputhook aftercodegtrue CheckSum +% LocalWords: StopEventually +4
\ No newline at end of file diff --git a/Master/texmf-dist/tex/latex/gmdoc/gmdocc.cls b/Master/texmf-dist/tex/latex/gmdoc/gmdocc.cls index 2cfd7c8d979..ff4015c5963 100644 --- a/Master/texmf-dist/tex/latex/gmdoc/gmdocc.cls +++ b/Master/texmf-dist/tex/latex/gmdoc/gmdocc.cls @@ -9,12 +9,12 @@ %% Written by Natror (Grzegorz Murzynowski), %% natror at o2 dot pl %% -%% \copyright\,2006, 2007 by Natror (Grzegorz Murzynowski). +%% ©\,2006–2010 by Natror (Grzegorz Murzynowski). %% %% This program is subject to the \LaTeX\ Project Public License. %% See ^^A %% \url{http://www.ctan.org/tex-archive/help/Catalogue/licenses.lppl.html} ^^A -%% for the details of that license. +%% for the details of that license.\rrthis %% %% LPPL status: "author-maintained".\par %% @@ -37,11 +37,18 @@ % \chschange{v0.79}{2008/8/9}{271} % \chschange{v0.80}{2008/8/30}{276} % \chschange{v0.80}{2008/10/8}{275} -% +% \toCTAN{2008/11/22 v0.81} +% \chschange{v0.82}{2008/12/2}{320} +% \chschange{v0.82}{2008/12/10}{303} +% \chschange{v0.82}{2008/12/14}{316} +% [\cmd\verbatimspecials, hyphenation in verbatims etc.] +% \chschange{v0.83}{2010/3/2}{332} +% [abandoning \pk{gmeometric} since \pk{geometry} v.5.2 provides +% \cmd\newgeometry] \NeedsTeXFormat{LaTeX2e} \ProvidesClass{gmdocc} - [2008/10/08 v0.81 a class for gmdoc driver files (GM)] + [2010/03/02 v0.84 a class for gmdoc driver files (GM)] % % \division{Intro} @@ -113,7 +120,7 @@ % % Moreover, if you like MW's classes (as I~do) and need |\chapter| % (for multiple files' input e.g.), you may declare another \pk{mwcls} -% with the option homonimic with the class'es name: \TextUsage*{mwrep} +% with the option homonymic with the class's name: \TextUsage*{mwrep} % for \pk{mwrep} and \TextUsage*{mwbk} for \pk{mwbk}. For the symmetry % there's also \TextUsage*{mwart} option (equivalent to the default % setting). @@ -129,6 +136,37 @@ % declarations. For use of them check the driver of this documentation % where the \TeX\ Gyre Pagella font is specified as the default Roman. % +% \stanza There are also some options for mono and sans fonts, see the +% changes history for details. +% +% The \TextUsage*{minion} option sets Adobe Minion Pro as the main +% font, the \TextUsage*{pagella} sets \TeX\ Gyre Pagella as the main +% font. +% +% The \TextUsage*{cronos} option sets Adobe Cronos Pro as the +% sans serif font, the \TextUsage*{trebuchet} option sets \ac{MS} +% Trebuchet as sans serif. +% +% The \TextUsage*{cursor} (working only +% with \XeTeX\ \& \pk{fontspec}) option sets \TeX\ Gyre Cursor as the +% typewriter font. It emboldens it to the optical weight of +% Computer/Latin Modern Mono in the code (|embolden=2.5|) and leaves +% light (|embolden=1|) for verbatims in the narrative. Moreover, this +% option also prepares a~condensed version (|extend=0.87|) for +% verbatims in the marginpars. +% +% Note that with no option for the monospaced font the default (with +% \XeTeX) will be Latin Modern Mono and then Latin Modern Mono Light +% Condensed is set for verbatims in marginpars (if available). +% +% \stanza +% This class sets +% \TextUsage\verbatimspecials{\noverbatimspecials|⁄«»[¿]|} if the +% engine is \XeTeX, see the +% \pk{gmverb} documentation to learn about this declaration. Remember +% that |\verbatimspecials| whatever would they be, have no effect on +% the code layer. +% % \stanza % The \TextUsage\EOFMark\ in this class typesets like this (of % course, you can redefine it as you wish):\par\EOFMark @@ -175,7 +213,7 @@ \gm@DOX{article}{\gmcc@class{article}}% you can also % \emph{choose} \pk{article}. % A~meta-remark: When I~tried to do the most natural thing, to -% |\ExecuteOptionsX| inside such declared option, an error occured: +% |\ExecuteOptionsX| inside such declared option, an error occurred: % 'undefined control sequence \inverb|\XKV@resa -> \@nil|'. @@ -193,28 +231,29 @@ \gm@DOX{noindex}{% \PassOptionsToPackage{noindex}{gmdoc}}% This -% option turns the writing outto \file{.idx} file off. +% option turns the writing out to \file{.idx} file off. \newif\if@gmccnochanges \gm@DOX{nochanges}{\@gmccnochangestrue}% This option turns the -% writing outto \file{.glo} file off. - - -\gm@DOX{gmeometric}{}% The \pk{gmeometric} package -% causes the |\geometry| macro provided by \pk{geometry} package -% is not restricted to the preamble. +% writing out to \file{.glo} file off. + + +% ^^A \gm@DOX{gmeometric}{}% The \pk{gmeometric} package +% ^^A % causes the |\geometry| macro provided by \pk{geometry} package +% ^^A % is not restricted to the preamble. +% ^^A % +% ^^A % Since version 0.99g of \pk{gmdoc} the bundle goes \XeTeX\ and that +% ^^A % means \pk{geometry} should be loaded with |dvipdfm| option and the +% ^^A % |\pdfoutput| counter has to be declared and that's what +% ^^A % \pk{gmeometric} does by default if with \XeTeX. And \pk{gmeometric} +% ^^A % has passed enough practical test. Therefore the |gmeometric| option +% ^^A % becomes obsolete and the package is loaded always instead of +% ^^A % original \pk{geometry}. % -% Since version 0.99g of \pk{gmdoc} the bundle goes \XeTeX\ and that -% means \pk{geometry} should be loaded with |dvipdfm| option and the -% |\pdfoutput| counter has to be declared and that's what -% \pk{gmeometric} does by default if with \XeTeX. And \pk{gmeometric} -% has passed enough practical test. Therefore the |gmeometric| option -% becomes obsolete and the package is loaded always instead of -% original \pk{geometry}. -% -% \stanza As already mentioned, since version +% ^^A~As already mentioned, +% Since version % 0.99g the \pk{gmdoc} bundle goes \XeTeX. That means that if \XeTeX\ % is detected, we may load the \pk{fontspec} package and the other two % of basic three \XeTeX-related, and then we |\fontspec| the fonts. @@ -225,36 +264,90 @@ \gm@DOX{sysfonts}{\gmcc@oldfontsfalse} -% Now we define a~key-val option that sets the version of marginpar -% typewriter font definition (relevant only with the |sysfonts| -% option). 0 for OpenType \acro{LMTT LC} visible for the system (not on my -% computer), 1 for \acro{LMTT LC} specially on my computer, any else number to avoid an -% error if you don't have OpenType \acro{LMTT LC} installed (and leave the -% default \pk{gmdoc}'s definition of |\marginpartt|; all the versions -% allow the user to define marginpar typewriter \himher self). -\gm@DOX{mptt}[17]{\def\mpttversion{#1}}% the default value (17) works if -% the user puts the |mptt| option with no value. In that case leaving -% the default \pk{gmdoc}'s definition of marginpar typewriter and -% letting the user to redefine it \himher self seemed to me most natural. - +%^^A % Now we define a~key-val option that sets the version of marginpar +%^^A % typewriter font definition (relevant only with the |sysfonts| +%^^A % option). 0 for OpenType \acro{LMTT LC} visible for the system (not on my +%^^A % computer), 1 for \acro{LMTT LC} specially on my computer, any else number to avoid an +%^^A % error if you don't have OpenType \acro{LMTT LC} installed (and leave the +%^^A % default \pk{gmdoc}'s definition of |\marginpartt|; all the versions +%^^A % allow the user to define marginpar typewriter \himher self). +\gm@DOX{mptt}[17]{\relax}% now a~no-op, left only for backwards +% compatibility. It was an option for setting the marginpar +% typewriter font. +%^^A % ^^A~\def\mpttversion{#1} +%^^A % the default value (17) works if +%^^A % the user puts the |mptt| option with no value. In that case leaving +%^^A % the default \pk{gmdoc}'s definition of marginpar typewriter and +%^^A % letting the user to redefine it \himher self seemed to me most natural. + + +\def\gmcc@tout#1{\typeout{^^J@@@@ gmdocc class: #1^^J}} \def\gmcc@setfont#1{% \gmcc@oldfontsfalse% note that if we are not in \XeTeX, this switch % will be turned true in line \ref{ofstrue} - \AtBeginDocument{% - \@ifXeTeX{% - \defaultfontfeatures{Numbers={OldStyle,Proportional}}% - \setmainfont[Mapping=tex-text]{#1}% - \setsansfont[Mapping=tex-text, Scale=MatchLowercase]{Latin Modern Sans}% - \setmonofont[Scale=MatchLowercase]{Latin Modern Mono}% - \let\sl\it \let\textsl\textit - }{}}% -} + \AtEndOfClass{% + \ifdefined\zf@init\afterfi{% + \gmcc@tout{Main font set to #1}% + \def\gmcc@dff{Numbers={OldStyle, Proportional}} + \@xa\setmainfont\@xa[\gmcc@dff, Mapping=tex-text]{#1}% + % ^^A \setsansfont[Mapping=tex-text]{Latin Modern Sans}% + % ^^A \gmcc@tout{Sans serif font set to Latin Modern Sans}% + % ^^A \setmonofont{Latin Modern Mono}% + % \chgs{2008/12/01 v0.82 I~commented out setting of Latin Modern + % fonts for sans serif and monospaced: \XeTeX\discret/\pk{fontspec} + % does that by default.} + % ^^A \def\sl{\it} \def{\textsl}\textit% we cover original \incs{sl} + % ^^A % and \incs{textsl} with \incs{def} to allow consistent font + % ^^A % change later. + \@xa\defaultfontfeatures\@xa{\gmcc@dff, Scale=MatchLowercase}%\ + % when put before \incs{setmainfont}, + \gmath + \def\LineNumFont{% \chgs{2008/11/30 v0.82 added} + \normalfont\scriptsize\addfontfeature{Numbers=Monospaced}}% + }% + \else\afterfi{\gmcc@tout{I~can set main font to #1 only in + XeTeX/fontspec}}% + \fi + }} \gm@DOX{minion}{\gmcc@setfont{Minion Pro}} -\gm@DOX{pagella}{\gmcc@setfont{TeX Gyre Pagella}% - \def\gmcc@PAGELLA{1}% +\gm@DOX{pagella}{\gmcc@setfont{TeX Gyre Pagella} + % ^^A \def\gmcc@PAGELLA{1}% caused an error } +\gm@DOX{cronos}{% \chgs{2008/12/01 v0.82 added, for Iwona sans font} + \AtEndOfClass{\setsansfont[Mapping=tex-text]{Cronos Pro}}} +\gm@DOX{trebuchet}{% \chgs{2008/12/03 v0.82 added, for Trebuchet + % \ac{MS} sans font} + \AtEndOfClass{\setsansfont[Mapping=tex-text]{Trebuchet MS}}} +\gm@DOX{myriad}{% \chgs{2008/12/03 v0.82 added, for Myriad Web Pro + % sans font} + \AtEndOfClass{\setsansfont[Mapping=text-text]{Myriad Web Pro}}} +\gm@DOX{lsu}{% \chgs{2008/12/03 v0.82 added, for Lucida Sans Unicode + % sans font} + \AtEndOfClass{\setsansfont[Mapping=tex-text]{Lucida Sans Unicode}}} + +\gm@DOX{cursor}{% \chgs{2008/12/01 v0.82 added, for \TeX\ Gyre Cursor + % mono font, which I~embolden a~little and shrink + % horizontally a~little} + % \chgs{2008/12/12 v0.82 subtly distinguished weights of + % the \TeX\ Gyre Cyursor typewriter font in the code + % and in verbatims in the commentary} + \AtEndOfClass{% + \setmonofont[FakeBold=2.5, BoldFeatures={FakeBold=0}, + FakeStretch=0.87, Ligatures=NoCommon + ]{TeX Gyre Cursor}% + \def\marginpartt{\tt\addfontfeature{FakeBold=2, + FakeStretch=0.609}% + \color{black}}% to provide proper color when marginpar occurs + % between lines that break a~coloured text. + \def\narrativett{\ttfamily\addfontfeature{FakeBold=1}}% + \let\UrlFont\narrativett + }% of |\AtEndOfClass|. +}% of the |cursor| option. + + + \gm@DOX{fontspec}{\PassOptionsToPackage{#1}{fontspec}} @@ -264,17 +357,22 @@ \gm@EOX{class=mwart}% \label{EOXmwart}We set the default basic class to % be \pk{mwart}. -\gm@EOX{mptt=0}% We default to set the marginpar typewriter font to -% OpenType \acro{LMTT LC}. +%^^A \gm@EOX{mptt=0}% We default to set the marginpar typewriter font to +%^^A % OpenType \acro{LMTT LC}. + +\PassOptionsToPackage{countalllines}{gmdoc}% \chgs[countalllines]{2008/11/30 +% v0.82 \pk{gmdoc} option here executed by % default} % \HideDefining\DeclareOptionX \DeclareOptionX*{\PassOptionsToPackage{\CurrentOption}{gmdoc}} \ProcessOptionsX[gmcc]<> +%^^A \nameshow{\@currname.\@currext-h@@k} + % \newif\ifSecondClass^^A~to assure \TeX knows ifSecondClass -% ^^A switch and therefore it counts the fis properly. +% ^^A switch and therefore it counts the |\fi|s properly. % \iffalse It's for cooperation with my another class. (Feature under % construction.) \XKV@ifundefined{ifSecondClass}{% @@ -290,26 +388,30 @@ % announced, we do the ontological test to any \pk{mwcls}. \fi \ifgmcc@mwcls - \XKV@ifundefined{XeTeXdefaultencoding}{}{% - \XeTeXdefaultencoding "cp1250"}% \pk{mwcls} are encoding-sensitive - % because MW uses Polish diacritics in the commentaries. +%^^A \XKV@ifundefined{XeTeXdefaultencoding}{}{% +%^^A \XeTeXdefaultencoding "cp1250"}% \pk{mwcls} are encoding-sensitive +%^^A % because MW uses Polish diacritics in the commentaries. \LoadClass[fleqn, oneside, noindentfirst, 11pt, withmarginpar, sfheadings]{\gmcc@CLASS}% - \XKV@ifundefined{XeTeXdefaultencoding}{}{% - \XeTeXdefaultencoding "utf-8"}% +%^^A \XKV@ifundefined{XeTeXdefaultencoding}{}{% +%^^A \XeTeXdefaultencoding "utf-8"}% \else \LoadClass[fleqn, 11pt]{article}% Otherwise the standard \pk{article} is % loaded. \fi % \skiplines \fi -% of ifSecondClass'es \cs{else} (a~feature under construction).\endskiplines +% of |\ifSecondClass|'es \cs{else} (a~feature under construction).\endskiplines -\RequirePackage{gmutils}[2008/10/08]% we load it early to provide \incs{@ifXeTeX}. +\RequirePackage{gmutils}[2008/10/08]% we load it early to provide +% \incs{@ifXeTeX}, but after loading the base class since this package +% redefines some environments. + \ifgmcc@mwcls\afterfi\ParanoidPostsec\fi + \@ifXeTeX{}{\gmcc@oldfontstrue} % \label{ofstrue} @@ -329,8 +431,8 @@ % font encoding. \RequirePackage[T1]{fontenc}% }{}% -% A~couple of diacritics I~met while \pk{gmdocing} these files and The -% Source etc. Somewhy the accents didn't want to work at my \XeTeX\ +% A~couple of diacritics I~met while \pk{gmdoc}ing{} these files and The +% Source etc. Some why the accents didn't want to work at my \XeTeX\ % settings so below I~define them for \XeTeX\ as respective chars. \def\agrave {\`a}% \def\cacute {\'c}% @@ -363,13 +465,15 @@ \fi % Now we set the page layout. -\RequirePackage{gmeometric} -\def\gmdoccMargins{% - \geometry{top=77pt, height=687pt, % =53 lines but the |lines| option - % seems not to work 2007/11/15 with \TeX\ Live 2007 and \XeTeX\ - % 0.996-patch1 +\RequirePackage{geometry} +\def\gmdoccMargins@params{{top=77pt, height=687pt, % =53 lines but the + % |lines| option seems not to work 2007/11/15 with \TeX\ Live 2007 + % and \XeTeX 0.996-patch1 left=4cm, right=2.2cm}} -\gmdoccMargins +\def\gmdoccMargins{% + \@xa \newgeometry\gmdoccMargins@params} + +\@xa\geometry\gmdoccMargins@params \if@debug% For debugging we load also the \pk{trace} package that was @@ -393,9 +497,9 @@ \def\marginpartt{\fontspec{LMTypewriter10 LightCondensed}}% \fi -\ifnum1=0\csname gmcc@PAGELLA\endcsname\relax - \RequirePackage{pxfonts,tgpagella,qpxmath}% -\fi +%^^A \ifnum1=0\csname gmcc@PAGELLA\endcsname\relax +%^^A \RequirePackage{pxfonts,tgpagella,qpxmath}% +%^^A \fi \raggedbottom @@ -416,9 +520,9 @@ % boldface and sans serif. \if@gmccnochanges\let\RecordChanges\relax\fi% If the |nochanges| -% option is on, we discard writing outto the \file{.glo} file. +% option is on, we discard writing out to the \file{.glo} file. -\RecordChanges% We turn the writing the |\changes| outto the +\RecordChanges% We turn the writing the |\changes| out to the % \file{.glo} file if not the above. % \CodeUsgIndex\dekclubs \CodeUsgIndex\smartunder @@ -428,7 +532,7 @@ % shortverbs} \edverbs% to redefine |\[| so that it puts a~shortverb in a~|\hbox|. \smartunder% and we declare the |_| char to behave as usual in the -% math mode and outside math to be just an uderscore. +% math mode and outside math to be just an underscore. \exhyphenpenalty\hyphenpenalty% 'cause \pk{mwcls} set it |=10000| due % to Polish customs. @@ -441,6 +545,27 @@ \DoNotIndex{\@nx \@xa %^^A\count \dimen \box \setbox \copy } +\provide\ac{\acro} +% \chgs{2008/11/30 v0.82 added} + +\def\+{\-\hskip\z@\penalty\@M} % a~discretionary hyphen that allows +% further hyphenation + +\Xedekfracc + + +\let\mch\metachar + +\ATfootnotes +\AtBegInput{\ATfootnotes} + + +\UrlFix + +\GMverbatimspecials + +\let\texcode@hook\makestarlow + \endinput % \changes{v0.677}{06/9/23}{Added checkings if \pk{mwart.cls} and % \pk{lmodern.sty} are available and more standard behaviour if they @@ -461,10 +586,14 @@ % \changes{v0.78}{2007/11/19}{Added the \env{pagella} option not to % use Adobe Minion Pro that is not freely licensed} % +% % \Finale % (For my GNU Emacs:) %%% Local Variables: %%% mode: doctex -%%% TeX-master: "../../../../LaTeX/TeXGuru/gmdoc/gmdocDoc" +%%% mode: flyspell +%%% ispell-local-dictionary: "british" %%% End: + +% LocalWords: lowstar |