summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/tex/latex')
-rw-r--r--Master/texmf-dist/tex/latex/gmverb/gmverb.sty120
1 files changed, 76 insertions, 44 deletions
diff --git a/Master/texmf-dist/tex/latex/gmverb/gmverb.sty b/Master/texmf-dist/tex/latex/gmverb/gmverb.sty
index 66af1efd33e..2342cae62e6 100644
--- a/Master/texmf-dist/tex/latex/gmverb/gmverb.sty
+++ b/Master/texmf-dist/tex/latex/gmverb/gmverb.sty
@@ -16,7 +16,7 @@
%%Written by Natror (Grzegorz Murzynowski),
%% natror at o2 dot pl
%%
-%% \copyright\,2005, 2006, 2007 by Natror (Grzegorz Murzynowski).
+%% \copyright\,2005, 2006, 2007, 2008 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
@@ -43,11 +43,32 @@
% \chschange{v0.82}{2007/4/26}{663}
% \chschange{v0.83}{2007/11/9}{666}
% \chschange{v0.84}{2007/11/13}{658}
+% \chschange{v0.85}{2008/5/1}{673}
+% \chschange{v0.87}{2008/8/6}{661}
%
+% \iffalse we skip the driver
+\ifnum\catcode`\@=12
+
+\documentclass [codespacesgrey,pagella] {gmdocc}
+\twocoltoc
+\begin{document}
+\DocInput{\jobname.sty}
+% \typeout{%
+% Produce index with^^J%
+% makeindex -r \jobname^^J}
+%
+% \typeout{%
+% Produce change log with^^J%
+% makeindex -r -s gmglo.ist -o \jobname.gls \jobname.glo^^J
+% (gmglo.ist should be put into some texmf/makeindex directory.)^^J}
+\afterfi{\end{document}}
+\fi
+%\fi
+
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{gmverb}
- [2007/11/13 v0.84 After shortvrb (FM) but my way (GM)]
+ [2008/08/06 v0.87 After shortvrb (FM) but my way (GM)]
%
% \tableofcontents
@@ -76,7 +97,7 @@
%
% (If you don't like linebreaking at backslash, there's the
% \TextUsage\fixbslash\ declaration (observing the common scoping
-% rules, hence OCSR) and an analogous
+% rules, hence \acro{OCSR}) and an analogous
% declaration for the left brace: \TextUsage\fixlbrace.)
% \dekmedskip
%
@@ -87,7 +108,7 @@
%
% \stanza
% Another difference is the \TextUsage\verbeolOK\ declaration
-% (OCSR). Within its scope, |\verb| allows an
+% (\acro{OCSR}). Within its scope, |\verb| allows an
% end of a~line in its argument and typesets it just as a~space.
%
% As in the standard version(s), the plain |\verb| typesets the spaces
@@ -123,8 +144,8 @@
%
% There's one more declaration provided by \pk{gmverb}:
% \TextUsage\dekclubs, which is a~shorthand for
-% \verb+\MakeShortVerb*\|+ and \TextUsage\dekclubs*\ for
-% \verb+\OldMakeShortVerb*\|+.
+% \verb+\MakeShortVerb\|+ and \TextUsage\dekclubs*\ for
+% \verb+\OldMakeShortVerb\|+.
%
% So that, after the latter declaration, you can write
%\[\verb+\[|+\<verbatim stuff>\verb+|\]+\]
@@ -134,6 +155,9 @@
%
% Both versions of |\dekclubs| OCSR.
%
+% The \env{verbatim} environment inserts |\topsep| before and after
+% itself, just as in standard version (as if it was a~\env{list}).
+%
%
%
% \stanza
@@ -145,8 +169,8 @@
% Unpack the \file{gmverb-tds.zip} archive (this is an archive
% conforming the \acro{TDS} standard, see \file{CTAN/tds/tds.pdf})
% in a~\file {texmf} directory or put the \pk{gmverb.sty} somewhere
-% in the \file{texmf/\:tex/\:latex} branch on your own. Creating
-% a~\file{texmf/\:tex/\:latex/\:gm} directory may be advisable if
+% in the \file{texmf/tex/latex} branch on your own. Creating
+% a~\file{texmf/tex/latex/gm} directory may be advisable if
% you consider using other packages written by me.
%
% Then you should refresh your \TeX\ distribution's files' database
@@ -156,27 +180,31 @@
% \subdivision{Contents of the \pk{gmverb.zip} Archive}
%
% The distribution of the \pk{gmverb} package consists of the
-% following four files and a~\acro{TDS}-compliant archive.
+% following three files and a~\acro{TDS}-compliant archive.
% \begin{verse}
% \pk{gmverb.sty}\\
% \pk{README}\\
-% \pk{gmverbDoc.tex}\\
-% \pk{gmverbDoc.pdf}\\
+% \pk{gmverb.pdf}\\
% \pk{gmverb.tds.zip}
% \end{verse}
%
+% This package requires another package of mine, \pk{gmutils},
+% also available on \acro{CTAN}.
+%
% \begin{gmlonely}
% \subdivision{Compiling the Documentation}
%
% The last of the above files (the \pk{.pdf}, i.e., \emph{this
% file}) is a~documentation compiled from the \pk{.sty} file by
-% running \LaTeX\ on the \pk{gmverbDoc.tex} file twice,
-% then MakeIndex on the gmverb.idx file, and then \LaTeX\
-% on gmverbDoc.tex once more.
+% running \XeLaTeX\ on the \pk{gmverb.sty} file
+% (|xelatex gmverb.sty| in the directory you wish the
+% documentation to be in, you don't have copy the \file{.sty} file
+% there, \TeX\ will find it) twice, then MakeIndex on the gmverb.idx file, and
+% then \LaTeX\ on gmverb.tex once more.
%
% MakeIndex shell command:
%\begin{verbatim}
-%makeindex -r gmverbDoc
+%makeindex -r gmverb
%\end{verbatim}
% The |-r| switch is to forbid MakeIndex to make implicit ranges since
% the (code line) numbers will be hyperlinks.
@@ -204,14 +232,10 @@
% \DoIndex{\verb \verb*}
% \subdivision{Preliminaries}
%
-\RequirePackage{gmutils}[2007/04/24]
+\RequirePackage{gmutils}[2008/08/06]
% For |\firstofone|, |\afterfi|, |\gmobeyspaces|, |\@ifnextcat|, |\foone| and
% |\noexpand|'s and |\expandafter|'s shorthands |\@nx| and |\@xa| resp.
-% \begin{oldmc}
-\foone{\@makeother\%}
-{\def\xiipercent{%}}
-% \end{oldmc}
% Someone may want to use another char for comment, but we assume here
% `orthodoxy'. Other assumptions in \pk{gmdoc} are made. The `knowledge'
@@ -235,16 +259,10 @@
% \subdivision{The Breakables}
%
% Let's define a~|\discretionary| left brace such that if it breaks,
-% it turns |{%| at the end of line. We'll use it in almost Knuthian
+% it turns |{%| at the end of line. We'll use it in almost Knuthian ^^A}
% |\ttverbatim|---it's part of this `almost'.
-\foone{\catcode`\[=1 \@makeother\{ \catcode`\]=2 }%
-[%
- \def\breaklbrace[\discretionary[{%^^A}
- \verbhyphen][][{%^^A}
- ]]%
- \def\xiilbrace[{%^^A}
- ]%
-]% of |\firstofone|
+\def\breaklbrace{%
+ \discretionary{\xiilbrace\verbhyphen}{}{\xiilbrace}}
\foone{\catcode`\[=1 \catcode`\{=\active \catcode`\]=2 }%
@@ -292,14 +310,16 @@
% we'll use in the almost Knuthian macro making verbatim. This `almost'
% makes a~difference.
\foone{\catcode`\ =12 }% note this space is ${}_{10}$ and is gobbled
-% by parsing the number.
-{\def\xiispace{ }%
-\def\breakablexiispace{\discretionary{ }{}{ }}}
+% by parsing the number. \cs{visiblespace} is |\let| in \pk{gmutils}
+% to \cs{xiispace} or \cs{xxt@visiblespace} of \pk{xltxtra} if available.
+
+\def\breakablevisspace{\discretionary{\visiblespace}{}{\visiblespace}}
+
\foone\obeyspaces% it's just re|\catcode|'ing.
{%
\newcommand*\activespace{ }%
-\newcommand*\dobreakvisiblespace{\def {\breakablexiispace}\obeyspaces}%^^A
+\newcommand*\dobreakvisiblespace{\def {\breakablevisspace}\obeyspaces}%^^A
% |%| |\def|ing it caused a~stack overflow disaster with \pk{gmdoc}.
\newcommand*\dobreakblankspace{\let =\space\obeyspaces}%
}
@@ -343,7 +363,6 @@
%
% The below is copied verbatim ;-) from
% \file{doc.pdf} and then is added my slight changes.
-% \Define\MakeShortVerb \Define*\MakeShortVerb*
\def\MakeShortVerb{%
\@ifstar
@@ -436,23 +455,27 @@
% environment (i.e., |\@currenvir|'s meaning) to set
% their expectation of the environment's |\end| properly. This is done
% to allow the user to define his/her own environments with
-% |\verbatim| inside them. I.e., as with the \pk{verbatim} package,
+% |\verbatim| inside them. I.e., as with the \pk{verbatim} package,
% you may write |\verbatim| in the begdef of your environment and then
-% necessarily |\endverbatim| in its enddef. Of course (or maybe
-% surprisingly), the commands written in the begdef after |\verbatim|
+% necessarily |\endverbatim| in its enddef. Of course (or \emph {maybe ^^B
+% surprisingly}), the commands written in the begdef after |\verbatim|
% will also be executed at \cs{begin\marg{environment}}.
-% \Define\verbatim
% \Define*{verbatim}
-\def\verbatim{\@beginparpenalty \predisplaypenalty \@verbatim
- \frenchspacing \gmobeyspaces \@xverbatim}% in the \LaTeX\ version
-% there's |%\@vobeyspaces| instead of |\gmobeyspaces|.
+\def\verbatim{%
+ \edef\gmv@hyphenpe{\the\hyphenpenalty}%
+ \edef\gmv@exhyphenpe{\the\exhyphenpenalty}%
+ \@beginparpenalty \predisplaypenalty \@verbatim
+ \frenchspacing \gmobeyspaces \@xverbatim
+ \hyphenpenalty=\gmv@hyphenpe\relax
+ \exhyphenpenalty=\gmv@exhyphenpe
+ \hyphenchar\font=\m@ne}% in the \LaTeX\ version
+% there's |%\@vobeyspaces| instead of |%\gmobeyspaces|.
% \changes{v0.73}{06/09/06}{\cs{@vobeyspaces} changed to
% \cs{obeyspaces} to make the blank \cs{verb/atim} spaces breakable}
% \Define*{verbatim*}
\@namedef{verbatim*}{\@beginparpenalty \predisplaypenalty \@verbatim
\@sxverbatim}
-% \Define\endverbatim
\def\endverbatim{\@@par
\ifdim\lastskip >\z@
\@tempskipa\lastskip \vskip -\lastskip
@@ -629,7 +652,7 @@
% one of many possible uses of a~general almost Rainer Sch\"opf's
% macro:
% \Define\dekclubs
-\def\dekclubs{\@ifstar{\OldMakeShortVerb*\|}{\MakeShortVerb*\|}}
+\def\dekclubs{\@ifstar{\OldMakeShortVerb\|}{\MakeShortVerb\|}}
% But even if a~shortverb is unconditional, the spaces in the math
% mode are not printed. So,
@@ -642,7 +665,7 @@
\let\gmv@edismath\]%
\def\[{%^^A\]
\@ifnextac\gmv@disverb\gmv@dismath}%
- \let\edverbs\relax}%
+ \relaxen\edverbs}%
\def\gmv@disverb{%
\gmv@dismath
@@ -701,6 +724,15 @@
% \changes{v0.83}{2007/11/09}{added a~hook in the active left brace
% definition intended for \pk{gmdoc} automatic detection of
% definitions (in line \protect\ref{gm@lbracehook})}
+%
+% \changes{v0.85}{2008/03/29}{added restoring of \cs{hyphenpenalty}
+% and \cs{exhyphenpenalty} and setting \cs{hyphenchar!=-1}}
+%
+% \changes{v0.87}{2008/08/06}{visible space tidyied and taken from
+% \pk{xltxtra} if available. \pk{gmutils} required. The \cs{xii...}
+% \acro{CS}'es moved to \pk{gmutils}. The documentation driver moved
+% into the \file{.sty} file}
+
% \PrintChanges \PrintIndex
% \Finale