/[escript]/trunk/esys2/doc/user/lstpatch.sty
ViewVC logotype

Contents of /trunk/esys2/doc/user/lstpatch.sty

Parent Directory Parent Directory | Revision Log Revision Log


Revision 82 - (show annotations)
Tue Oct 26 06:53:54 2004 UTC (15 years ago) by jgs
File size: 7009 byte(s)
Initial revision

1 % $Id$
2
3 %%
4 %% This is file `lstpatch.sty', generated manually.
5 %%
6 %% Please read the software license in listings.dtx or listings.dvi.
7 %%
8 %% (w)(c) 2003 Carsten Heinz
9 %%
10 %% This file is distributed under the terms of the LaTeX Project Public
11 %% License from CTAN archives in directory macros/latex/base/lppl.txt.
12 %% Either version 1.0 or, at your option, any later version.
13 %%
14 %% Send comments and ideas on the package, error reports and additional
15 %% programming languages to <cheinz@gmx.de>.
16 %%
17 %% This patch file will remove the following bugs from the listings package.
18 %% Each item contains the bug finder with date of report and first bug fix
19 %% version, a short description of the problem, and the reason for the bug
20 %% in parenthesis.
21 %%
22 %% 1) Werner Struckmann, 2003/06/25, 1.1a (2003/06/25)
23 %%
24 %% undefined control sequence \lst@name
25 %% (init of \lst@name not moved up to \lst@MakeCaption)
26 %%
27 %% 2) Denis Girou, 2003/07/04, 1.1b
28 %%
29 %% problem in list environments with fancyvrb=true
30 %% (wrong \linewidth used)
31 %%
32 %% 3) Carsten Heinz, 2003/07/05, 1.1b
33 %%
34 %% indentation outside list environments with fancyvrb=true
35 %% (unremoved par indentation)
36 %%
37 %% 4) Jared Warren, 2003/07/10, 1.1b
38 %%
39 %% literate replacement produces "ghosts"
40 %% (\lst@BeginDropInput did not suppress output)
41 %%
42 %% 5) David Aspinall, 2003/07/17, 1.1b
43 %%
44 %% loading of .fd file inside tabular produces error
45 %% (& in \lst@nfss@catcodes must be \&)
46 %%
47 %% 6) Edsko de Vries, 2003/07/20, 1.1b (2003/07/22)
48 %%
49 %% bad keywords with language selections only in optional arguments
50 %% (\lst@ProvideFamily defined a marker only locally)
51 %%
52 %%
53 %% Moreover the following features have been added.
54 %%
55 %% a) directive delimiter is adjustable: moredelim=*[directive]\#
56 %%
57 %%
58 \ProvidesFile{lstpatch.sty}[2003/08/13 1.1c (Carsten Heinz)]
59 \lst@CheckVersion{1.1}
60 {\typeout{^^J%
61 ***^^J%
62 *** This is a patch for listings 1.1, but you're using^^J%
63 *** version \lst@version.^^J%
64 ***^^J
65 *** Patch file not loaded.^^J%
66 ***^^J}%
67 \endinput
68 }
69 %
70 % 1) Insert initialization of \lst@name ...
71 \def\lst@MakeCaption#1{%
72 \ifx #1t%
73 \ifx\lst@@caption\@empty\expandafter\lst@HRefStepCounter \else
74 \expandafter\refstepcounter
75 \fi {lstlisting}%
76 \ifx\lst@label\@empty\else \label{\lst@label}\fi
77 % ... here.
78 \let\lst@arg\lst@intname \lst@ReplaceIn\lst@arg\lst@filenamerpl
79 \global\let\lst@name\lst@arg \global\let\lstname\lst@name
80 \lst@ifnolol\else
81 \ifx\lst@@caption\@empty
82 \ifx\lst@caption\@empty
83 \ifx\lst@intname\@empty \else \def\lst@temp{ }%
84 \ifx\lst@intname\lst@temp \else
85 \addcontentsline{lol}{lstlisting}\lst@name
86 \fi\fi
87 \fi
88 \else
89 \addcontentsline{lol}{lstlisting}%
90 {\protect\numberline{\thelstlisting}\lst@@caption}%
91 \fi
92 \fi
93 \fi
94 \ifx\lst@caption\@empty\else
95 \lst@IfSubstring #1\lst@captionpos
96 {\begingroup \let\@@vskip\vskip
97 \def\vskip{\afterassignment\lst@vskip \@tempskipa}%
98 \def\lst@vskip{\nobreak\@@vskip\@tempskipa\nobreak}%
99 \par\normalsize\normalfont
100 \ifx #1t\allowbreak \fi
101 \ifx\lst@title\@empty
102 \expandafter\@makecaption
103 \else
104 \expandafter\lst@maketitle
105 \fi
106 {\noindent\lstlistingname
107 \ifx\lst@@caption\@empty\else~\thelstlisting\fi}%
108 \lst@caption
109 \ifx #1b\allowbreak \fi
110 \endgroup}{}%
111 \fi}
112 %
113 % 2) Save \linewidth and restore it after initialization.
114 \def\lstpatch@fancyvrb{%
115 \gdef\lstFV@VerbatimBegin{%
116 \ifx\FancyVerbFormatLine\lstFV@FancyVerbFormatLine
117 \lsthk@TextStyle \lsthk@BoxUnsafe
118 \lsthk@PreSet
119 \lst@activecharsfalse
120 \let\normalbaselines\relax
121 \xdef\lstFV@RestoreData{\noexpand\linewidth\the\linewidth\relax}%
122 \lst@Init\relax
123 \lst@ifresetmargins \advance\linewidth-\@totalleftmargin \fi
124 \lstFV@RestoreData
125 \everypar{}\global\lst@newlines\z@
126 \lst@mode\lst@nomode \let\lst@entermodes\@empty
127 \lst@InterruptModes
128 %% D.G. modification begin - Nov. 25, 1998
129 \let\@noligs\relax
130 %% D.G. modification end
131 \fi}%
132 % 3) Change \leavevmode to \noindent.
133 \gdef\lstFV@FancyVerbFormatLine##1{%
134 \let\lst@arg\@empty \lst@FVConvert##1\@nil
135 \global\lst@newlines\z@
136 \vtop{\noindent\lst@parshape
137 \lst@ReenterModes
138 \lst@arg \lst@PrintToken\lst@EOLUpdate\lsthk@InitVarsBOL
139 \lst@InterruptModes}}%
140 }
141 %
142 % 4) Suppress the output by \let\lst@OutputBox\@gobble and ...
143 \def\lst@BeginDropInput#1{%
144 \lst@EnterMode{#1}%
145 {\lst@modetrue
146 \let\lst@OutputBox\@gobble
147 \let\lst@ifdropinput\iftrue
148 \let\lst@Process@i\@gobble
149 \let\lst@Process@n\@gobble
150 \let\lst@Process@m\@gobble
151 \let\lst@ProcessSpace\@empty
152 \let\lst@ProcessTabulator\@empty
153 \let\lst@ProcessFormFeed\@empty}}
154 % check for it here:
155 \def\lst@Literate#1#2#3{%
156 \ifx\relax#2\@empty\else
157 \lst@ReplaceInput{#1}%
158 {\ifx\lst@OutputBox\@gobble\else
159 \lst@XPrintToken \let\lst@scanmode\lst@scan@m
160 \lst@token{#2}\lst@length#3\relax
161 \lst@XPrintToken
162 \fi}%
163 \expandafter\lst@Literate
164 \fi}
165 %
166 % 5) Change & to \& at the end of line number four.
167 \def\lst@nfss@catcodes{%
168 \lst@makeletter
169 ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz\relax
170 \@makeother (\@makeother )\@makeother ,\@makeother :\@makeother\&%
171 \@makeother 0\@makeother 1\@makeother 2\@makeother 3\@makeother 4%
172 \@makeother 5\@makeother 6\@makeother 7\@makeother 8\@makeother 9%
173 \@makeother =\lsts@nfss@catcodes}
174 %
175 % 6) Insert \global in front of \@namedef.
176 \def\lstpatch@keywords{%
177 \gdef\lst@ProvideFamily##1{%
178 \@ifundefined{lstfam@##1\ifnum\@tempcnta=\@ne\else\the\@tempcnta\fi}%
179 {\global\@namedef{lstfam@##1\ifnum\@tempcnta=\@ne\else \the\@tempcnta\fi}{}%
180 \expandafter\expandafter\expandafter\lst@ProvideFamily@
181 \csname\@lst @##1@data\endcsname
182 {\ifnum\@tempcnta=\@ne\else \the\@tempcnta \fi}}%
183 {}}%
184 }
185 %
186 % a) Define new delimiter type `directive'.
187 \def\lstpatch@directives{%
188 \lst@AddTo\lst@delimtypes{,directive}
189 \gdef\lst@Delim@directive##1\@empty##2##3##4{%
190 \lst@CArg ##1\relax\lst@DefDelimB
191 {\lst@CalcColumn}%
192 {}%
193 {\ifnum\@tempcnta=\z@
194 \def\lst@bnext{##2\lst@CDmode{##4\lst@Lmodetrue}%
195 \let\lst@currstyle\lst@directivestyle}%
196 \fi
197 \@gobblethree}%
198 ##2\lst@CDmode{##4\lst@Lmodetrue}%
199 }% Disable old mechanism.
200 \lst@AddToHook{SelectCharTable}
201 {\ifx\lst@directives\@empty\else
202 \lst@Let{`\#}\lsts@CCD
203 \fi}%
204 }
205 %%
206 \endinput
207 %%
208 %% End of file `lstpatch.sty'.

Properties

Name Value
svn:eol-style native
svn:keywords Author Date Id Revision

  ViewVC Help
Powered by ViewVC 1.1.26