summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/nicetext/niceverb.sty
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/tex/latex/nicetext/niceverb.sty')
-rw-r--r--Master/texmf-dist/tex/latex/nicetext/niceverb.sty111
1 files changed, 70 insertions, 41 deletions
diff --git a/Master/texmf-dist/tex/latex/nicetext/niceverb.sty b/Master/texmf-dist/tex/latex/nicetext/niceverb.sty
index c82ae3deaa0..4ea1d7fda1d 100644
--- a/Master/texmf-dist/tex/latex/nicetext/niceverb.sty
+++ b/Master/texmf-dist/tex/latex/nicetext/niceverb.sty
@@ -1,5 +1,5 @@
\NeedsTeXFormat{LaTeX2e}[1994/12/01]
-\ProvidesPackage{niceverb}[2009/02/21
+\ProvidesPackage{niceverb}[2009/04/15 v0.2
minimize \string\verb\space code (UL)]
%% Copyright (C) 2009 Uwe Lueck,
@@ -32,23 +32,29 @@
\MakeLetter\_
-\newcommand*{\make_iii_other}{\MakeOther\\\MakeOther\{\MakeOther\}}
-
-%% === Parsimonious version of &\verb ===
+% \newcommand*{\make_iii_other}{\MakeOther\\\MakeOther\{\MakeOther\}}
+ %% <- replaced 2009/04/05
+%% === Sloppy variant of &\verb ===
\newcommand*{\begin_min_verb}{%
\relax \ifmmode \hbox \else \leavevmode\null \fi
- %% standard, for $$...$$
+ %% <- standard, for $$...$$
\bgroup \tt %%%\let\do\MakeOther \dospecials
\MakeLetter\_\MakeLetter\@}
\newcommand*{\SimpleVerb}[1]{%
- %% mainly avoid \verb's noligs list which overrides definitions
- %% of some active characters, while cmtt doesn't have any
- %% ligatures anyway.
+%% Mainly avoid `\verb''s noligs list which overrides definitions
+%% of some active characters, while 'cmtt' doesn't have any
+%% ligatures anyway.
\ifx\protect\@typeset@protect
- \begin_min_verb \make_iii_other \MakeActiveLet#1\egroup
+ \begin_min_verb %%%\make_iii_other %% much usual 2009/04/05
+ \let\do\MakeOther \dospecials %% 2009/04/06
+ \MakeOther\|%% probably 'niceverb'
+ \MakeActiveLet#1\niceverb_egroup %% 2009/04/11
+ \verb@eol@error %% TODO change message 2009/04/09
\else \string\SimpleVerb \string#1\fi}
-
-%% === Single quotes make code ===
+%% 2009/04/11: about `etc.'
+\newcommand*{\niceverb_egroup}{\egroup\ifmmode\else\@\fi}
+%%
+%% === Single quotes typeset meta-code ===
\newcommand*{\lq_verb}{%
\ifx\protect\@typeset@protect
\expandafter \lq_double_test
@@ -57,7 +63,7 @@
% \expandafter\expandafter\expandafter
% \protect_corresp_quotes
% \else
-% \RqVerb
+% \rq_verb
% \fi
% \fi}
\newcommand*{\lq_double_test}{%
@@ -69,21 +75,21 @@
\ifx\let_token\lq_verb
\endgroup
\lq\lq \expandafter \@gobble
- %% corresponding right quotes will become ``other'' due to
- %% having no space at the left. TODO to be changed with
- %% wiki.sty
+%% Corresponding right quotes will become ``other'' due to
+%% having no space at the left.
+ %%TODO to be changed with 'wiki.sty'.
\else
\endgroup
% \expandafter \rq_verb
\expandafter \SimpleVerb \expandafter \'%
\fi}
% \newcommand*{\rq_verb}{\SimpleVerb\'}
-% \AtBeginDocument{\MakeActiveLet\`\RqVerb}
+% \AtBeginDocument{\MakeActiveLet\`\rq_verb}
\AtBeginDocument{\MakeActiveLet\`\lq_verb}
%% Strings referred to will be code
%% TODO to be changed with wiki.sty
-
-%% === Single mark for reference to commands ===
+%%
+%% === Ampersand typesets meta-code ===
\newcommand*{\CmdSyntaxVerb}{%
\ifx\protect\@typeset@protect
\expandafter \cmd_syntax_verb
@@ -118,11 +124,8 @@
\def\braces_verb#1{\string{#1\string}\test_more_verb}
\def\brackets_verb[#1]{[#1]\test_more_verb}
\def\star_verb*{*\test_more_verb}
-
-
-\makeatletter
-
-%% === Escape makes meta-code ===
+%%
+%% === Escape character typesets meta-code ===
\DeclareRobustCommand*{\BuildCsSyntax}{%
\futurelet\let_token \build_cs_syntax_sp}
\newcommand*{\build_cs_syntax_sp}{%
@@ -161,50 +164,76 @@
\newcommand*{\EndAutoCmdSyntaxVerb}{\CatCode\\\z@}
\newcommand*{\NormalCommand}{} \let\NormalCommand\@nameuse
-%% Were tests:
+ %% Were tests:
% \futurelet\LetToken\relax \relax
% \show\LetToken \typeout{\ifcat\noexpand\LetToken aa\else x\fi}
\newcommand*{\niceverbNoVerbList}{%
\begin\end\item\verb\EndAutoCmdSyntaxVerb\NormalCommand
- \section\subsection}%% TODO!?
-
+ \section\subsection\subsubsection}%% TODO!?
+\providecommand*{\AddToMacro}[1]{%
+ \expandafter \def \expandafter #1\expandafter}
+%%
%% === Meta-variables ===
\def\niceverb_meta#1>{%
\mbox{\normalfont\itshape $\langle$#1\/$\rangle$}}
%% TODO offer without angles as well
\AtBeginDocument{\MakeActiveLet\<\niceverb_meta}
%% difference to ltxguide.cls: also outside verbatim
-
-%% === Hash mark must be code ===
+%%
+%% === Hash mark is code ===
\newcommand*{\param_verb}[1]{{\tt\##1}}
\AtBeginDocument{\MakeActiveLet\#\param_verb}
-
-%% === Single right quote for &\sf ===
-%% TODO fails in parentheses due to preserving apostrophes
+%%
+%% === Single right quote for &\textsf ===
\newcommand*{\niceverb_rq_sf}{%
+% \relax %% in case of \hskip1sp 2009/04/08
+ %% but spoils ligature 2009/04/09
\ifx\protect\@typeset@protect
\expandafter \niceverb_rq_sf_test
\else \rq \fi}
- %% introduced another macro just to avoid more sequences
- %% of \expandafter ...
+%% Another macro just to avoid more sequences of `\expandafter':
\newcommand*{\niceverb_rq_sf_test}{%
- \ifhmode \ifdim\lastskip>\z@
- \expandafter\expandafter\expandafter \niceverb_rq_sf_exec
- %% TODO but after `('!? make \( active, also for \after_cs!?
- \else \rq \fi
+ \ifhmode
+ \ifdim\lastskip>\z@
+ \expandafter\expandafter\expandafter \niceverb_rq_sf_exec
+ \else
+ \ifnum\spacefactor=1001 %% in parentheses 2009/04/10
+ \expandafter\expandafter\expandafter\expandafter
+ \expandafter\expandafter\expandafter
+ \niceverb_rq_sf_exec
+ \else \rq \fi
+% \rq
+ \fi
\else \ifvmode
\expandafter\expandafter\expandafter \niceverb_rq_sf_exec
\else \rq \fi
\fi}
+\sfcode`\(=1001 %% enable in parentheses 2009/04/10
{\CatCode\'\active \gdef\niceverb_rq_sf_exec#1'{\textsf{#1}}}
-%% TODO to be changed with wiki.sty:
+ %% TODO to be changed with wiki.sty:
\AtBeginDocument{\MakeActiveLet\'\niceverb_rq_sf}
-%% TODO \niceverbswitch{<mode>}{<on/off>} (bzw. Doku ohne {})
-
+ %% TODO \niceverbswitch{<mode>}{<on/off>} (bzw. Doku ohne {})
+%%
%% === Leave package mode ===
-\makeatother
\MakeSub\_
\endinput
+%%
+%% === VERSION HISTORY ===
+
+v0.1 2009/02/21 very first, sent to CTAN
+v0.2 2009/04/04 ...NoVerbList: \subsubsection, \AddToMacro,
+ 2009/04/05 \SimpleVerb makes more other than iii
+ 2009/04/06 just uses \dospecials
+ 2009/04/08 debugging code for rq/sf, +\relax
+ 2009/04/09 +\verb@eol@error, prepared for new doc method,
+ removed spurious \makeat..., -\relax (ligature),
+ 2009/04/10 ('-trick
+ 2009/04/11 \@ after \SimpleVerb
+ 2009/04/14 noted TODO below
+ 2009/04/15 change v0.1 to 2009/02/21
+
+TODO: choose expansions of active characters by options 2009/04/10
+TODO: &\@tempa and &\_tempa fail 2009/04/14