summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/newverbs/newverbs.sty
blob: 4c856f47d888023c8de11c46366cd95fdba0445c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
%%
%% This is file `newverbs.sty',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% newverbs.dtx  (with options: `package')
%% 
%%  Copyright (c) 2010-2011 by Martin Scharrer <martin@scharrer-online.de>
%%  WWW: http://latex.scharrer-online.de/
%% 
%%  This work may be distributed and/or modified under the
%%  conditions of the LaTeX Project Public License, either version 1.3
%%  of this license or (at your option) any later version.
%%  The latest version of this license is in
%%   http://www.latex-project.org/lppl.txt
%%  and version 1.3 or later is part of all distributions of LaTeX
%%  version 2005/12/01 or later.
%% 
%%  This work has the LPPL maintenance status `maintained'.
%% 
%%  The Current Maintainer of this work is Martin Scharrer.
%% 
%%  This work consists of the files newverbs.dtx and newverbs.ins
%%  and the derived file newverbs.sty.
%% 
%% $Id: newverbs.dtx 2161 2011-02-16 16:19:38Z martin $
\ProvidesPackage{newverbs}
  [2011/02/16 v1.2 Define new 'verb' commands and short verb. characters]
\newcommand*\newverbcommand{\new@verbcommand\newcommand}
\newcommand*\renewverbcommand{\new@verbcommand\renewcommand}
\newcommand*\provideverbcommand{\new@verbcommand\providecommand}
\def\new@verbcommand#1#2#3#4{%
  #1*#2{%
    \begingroup
    \newverbcommand@settings
    \def\verb@egroup{\verb@orig@egroup#4\endgroup}%
    \def\newverbs@txend{#4\endgroup}
    #3\verb
  }%
}
\def\newverbs@tabularxsupport{%
    \begingroup
    \def\orig@TX@vb##1{\def\@tempa####1##1{\toks@{####1}\edef\@tempa{\the\toks@}%
        \expandafter\TX@v\meaning\@tempa\\ \\\ifnum0=`{\fi}}\@tempa!}
    \ifx\TX@vb\orig@TX@vb
        \endgroup
        \PackageInfo{newverbs}{Patching 'TX@vb' macro of the 'tabularx' package.}%
        \def\TX@vb##1{\def\@tempa####1##1{\toks@{####1}\edef\@tempa{\the\toks@}%
            \expandafter\TX@v\meaning\@tempa\\ \\\ifnum0=`{\fi}\newverbs@txend}\@tempa!}
    \else
        \endgroup
        \PackageWarning{newverbs}{Couldn't patch 'TX@vb' macro of the 'tabularx' package. Definition unknown.}%
    \fi
    \let\newverbs@tabularxsupport\relax
}
\def\newverbs@txend{}
\@ifpackageloaded{tabularx}{%
    \newverbs@tabularxsupport
}{%
    \AtBeginDocument{\@ifpackageloaded{tabularx}{\newverbs@tabularxsupport}{}}%
}
\def\newverbcommand@settings{%
  \let\verb@orig@egroup\verb@egroup
  \let\verbbox\@tempboxa
}
\provideverbcommand{\qverb}{\qverbbeginquote}{\qverbendquote}
\@ifundefined{openinnerquote}{%
  \def\qverbbeginquote{`}%
  \def\qverbendquote{'}%
}{%
  \def\qverbbeginquote{\openinnerquote}%
  \def\qverbendquote{\closeinnerquote}%
}
\newverbcommand{\fverb}
  {\setbox\verbbox\hbox\bgroup\color@setgroup}
  {\color@endgroup\egroup\fbox{\box\verbbox}}
\newcommand*\MakeSpecialShortVerb[1]{%
  \@ifstar
    {\def\@shortvrbdef{#1*}\@MakeShortVerb}%
    {\def\@shortvrbdef{#1}\@MakeShortVerb}%
}
\endinput
%%
%% End of file `newverbs.sty'.