]> git.lyx.org Git - features.git/blob - lib/reLyX/Text/manpage.3pm
Whitespace, only whitespace. Part II.
[features.git] / lib / reLyX / Text / manpage.3pm
1 .rn '' }`
2 ''' $RCSfile: manpage.3pm,v $$Revision: 1.2 $$Date: 2004/10/28 14:35:19 $
3 '''
4 ''' $Log: manpage.3pm,v $
5 ''' Revision 1.2  2004/10/28 14:35:19  leeming
6 ''' Whitespace, only whitespace. Part II.
7 '''
8 ''' Revision 1.1.1.1  1999/09/27 18:44:35  larsbj
9 ''' This is the new LyX development branch, it is based upon version
10 ''' 1.0.4pre8 and will from now on be used for both development and stable branches.
11 '''
12 '''
13 ''' Revision 1.1.1.1  1998/04/20 21:14:36  larsbj
14 ''' repository moved due to corrupted repository on other machine
15 '''
16 ''' Revision 1.1.2.1  1998/03/02 16:12:47  larsbj
17 ''' two patches added to 0.12.1pre2
18 '''
19 ''' Revision 1.1.2.1  1998/02/07 02:27:30  larsbj
20 ''' patch from jean-marc, and a fix to libdir detection by lgb
21 '''
22 ''' Revision 1.1  1997/10/26 10:22:04  larsbj
23 ''' lots of small changes
24 '''
25 ''' Revision 1.1  1997/10/17 16:52:21  larsbj
26 ''' changes
27 '''
28 '''
29 .de Sh
30 .br
31 .if t .Sp
32 .ne 5
33 .PP
34 \fB\\$1\fR
35 .PP
36 ..
37 .de Sp
38 .if t .sp .5v
39 .if n .sp
40 ..
41 .de Ip
42 .br
43 .ie \\n(.$>=3 .ne \\$3
44 .el .ne 3
45 .IP "\\$1" \\$2
46 ..
47 .de Vb
48 .ft CW
49 .nf
50 .ne \\$1
51 ..
52 .de Ve
53 .ft R
54
55 .fi
56 ..
57 '''
58 '''
59 '''     Set up \*(-- to give an unbreakable dash;
60 '''     string Tr holds user defined translation string.
61 '''     Bell System Logo is used as a dummy character.
62 '''
63 .tr \(*W-|\(bv\*(Tr
64 .ie n \{\
65 .ds -- \(*W-
66 .ds PI pi
67 .if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch
68 .if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch
69 .ds L" ""
70 .ds R" ""
71 .ds L' '
72 .ds R' '
73 'br\}
74 .el\{\
75 .ds -- \(em\|
76 .tr \*(Tr
77 .ds L" ``
78 .ds R" ''
79 .ds L' `
80 .ds R' '
81 .ds PI \(*p
82 'br\}
83 .\"     If the F register is turned on, we'll generate
84 .\"     index entries out stderr for the following things:
85 .\"             TH      Title
86 .\"             SH      Header
87 .\"             Sh      Subsection
88 .\"             Ip      Item
89 .\"             X<>     Xref  (embedded
90 .\"     Of course, you have to process the output yourself
91 .\"     in some meaninful fashion.
92 .if \nF \{
93 .de IX
94 .tm Index:\\$1\t\\n%\t"\\$2"
95 ..
96 .nr % 0
97 .rr F
98 .\}
99 .TH TEX 1 "perl 5.003, patch 07" "30/Oct/96" "User Contributed Perl Documentation"
100 .IX Title "TEX 1"
101 .UC
102 .IX Name "Text::TeX - Perl module for parsing of C<TeX>."
103 .if n .hy 0
104 .if n .na
105 .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'
106 .de CQ          \" put $1 in typewriter font
107 .ft CW
108 'if n "\c
109 'if t \\&\\$1\c
110 'if n \\&\\$1\c
111 'if n \&"
112 \\&\\$2 \\$3 \\$4 \\$5 \\$6 \\$7
113 '.ft R
114 ..
115 .\" @(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2
116 .       \" AM - accent mark definitions
117 .bd B 3
118 .       \" fudge factors for nroff and troff
119 .if n \{\
120 .       ds #H 0
121 .       ds #V .8m
122 .       ds #F .3m
123 .       ds #[ \f1
124 .       ds #] \fP
125 .\}
126 .if t \{\
127 .       ds #H ((1u-(\\\\n(.fu%2u))*.13m)
128 .       ds #V .6m
129 .       ds #F 0
130 .       ds #[ \&
131 .       ds #] \&
132 .\}
133 .       \" simple accents for nroff and troff
134 .if n \{\
135 .       ds ' \&
136 .       ds ` \&
137 .       ds ^ \&
138 .       ds , \&
139 .       ds ~ ~
140 .       ds ? ?
141 .       ds ! !
142 .       ds /
143 .       ds q
144 .\}
145 .if t \{\
146 .       ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u"
147 .       ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u'
148 .       ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u'
149 .       ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u'
150 .       ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u'
151 .       ds ? \s-2c\h'-\w'c'u*7/10'\u\h'\*(#H'\zi\d\s+2\h'\w'c'u*8/10'
152 .       ds ! \s-2\(or\s+2\h'-\w'\(or'u'\v'-.8m'.\v'.8m'
153 .       ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u'
154 .       ds q o\h'-\w'o'u*8/10'\s-4\v'.4m'\z\(*i\v'-.4m'\s+4\h'\w'o'u*8/10'
155 .\}
156 .       \" troff and (daisy-wheel) nroff accents
157 .ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V'
158 .ds 8 \h'\*(#H'\(*b\h'-\*(#H'
159 .ds v \\k:\h'-(\\n(.wu*9/10-\*(#H)'\v'-\*(#V'\*(#[\s-4v\s0\v'\*(#V'\h'|\\n:u'\*(#]
160 .ds _ \\k:\h'-(\\n(.wu*9/10-\*(#H+(\*(#F*2/3))'\v'-.4m'\z\(hy\v'.4m'\h'|\\n:u'
161 .ds . \\k:\h'-(\\n(.wu*8/10)'\v'\*(#V*4/10'\z.\v'-\*(#V*4/10'\h'|\\n:u'
162 .ds 3 \*(#[\v'.2m'\s-2\&3\s0\v'-.2m'\*(#]
163 .ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#]
164 .ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H'
165 .ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u'
166 .ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#]
167 .ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#]
168 .ds ae a\h'-(\w'a'u*4/10)'e
169 .ds Ae A\h'-(\w'A'u*4/10)'E
170 .ds oe o\h'-(\w'o'u*4/10)'e
171 .ds Oe O\h'-(\w'O'u*4/10)'E
172 .       \" corrections for vroff
173 .if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u'
174 .if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u'
175 .       \" for low resolution devices (crt and lpr)
176 .if \n(.H>23 .if \n(.V>19 \
177 \{\
178 .       ds : e
179 .       ds 8 ss
180 .       ds v \h'-1'\o'\(aa\(ga'
181 .       ds _ \h'-1'^
182 .       ds . \h'-1'.
183 .       ds 3 3
184 .       ds o a
185 .       ds d- d\h'-1'\(ga
186 .       ds D- D\h'-1'\(hy
187 .       ds th \o'bp'
188 .       ds Th \o'LP'
189 .       ds ae ae
190 .       ds Ae AE
191 .       ds oe oe
192 .       ds Oe OE
193 .\}
194 .rm #[ #] #H #V #F C
195 .SH "NAME"
196 .IX Header "NAME"
197 Text::TeX -- Perl module for parsing of \f(CWTeX\fR.
198 .SH "SYNOPSIS"
199 .IX Header "SYNOPSIS"
200 .PP
201 .Vb 1
202 \&  use Text::TeX;
203 .Ve
204 .Vb 12
205 \&  sub report {
206 \&    my($eaten,$txt) = (shift,shift);
207 \&    print "Comment: `", $eaten->[1], "'\en" if defined $eaten->[1];
208 \&    print "@{$txt->{waitfors}} ", ref $eaten, ": `", $eaten->[0], "'";
209 \&    if (defined $eaten->[3]) {
210 \&      my @arr = @{ $eaten->[3] };
211 \&      foreach (@arr) {
212 \&        print " ", $_->print;
213 \&      }
214 \&    }
215 \&    print "\en";
216 \&  }
217 .Ve
218 .Vb 3
219 \&  my $file = new Text::TeX::OpenFile 'test.tex',
220 \&    'defaultact' => \e&report;
221 \&  $file->process;
222 .Ve
223 .SH "DESCRIPTION"
224 .IX Header "DESCRIPTION"
225 A new \f(CWTeX\fR parser is created by
226 .PP
227 .Vb 1
228 \&  $file = new Text::TeX::OpenFile $filename, attr1 => $val1, ...;
229 .Ve
230 $filename may be \f(CWundef\fR, in this case the text to parse may be
231 specified in the attribute \f(CWstring\fR.
232 .PP
233 Recognized attributes are:
234 .Ip "\f(CWstring\fR" 12
235 .IX Item "\f(CWstring\fR"
236 contains the text to parse before parsing \f(CW$filename\fR.
237 .Ip "\f(CWdefaultact\fR" 12
238 .IX Item "\f(CWdefaultact\fR"
239 denotes a procedure to submit \f(CWoutput tokens\fR to.
240 .Ip "\f(CWtokens\fR" 12
241 .IX Item "\f(CWtokens\fR"
242 gives a hash of \f(CWdescriptors\fR for \f(CWinput token\fR. A sane default is
243 provided.
244 .PP
245 A call to the method \f(CWprocess\fR launches the parser.
246 .Sh "Tokenizer"
247 .IX Subsection "Tokenizer"
248 When the parser is running, it processes input stream by splitting it
249 into \f(CWinput tokens\fR using some \fIheuristics\fR similar to the actual
250 rules of TeX tokenizer. However, since it does not use \fIthe exact
251 rules\fR, the resulting tokens may be wrong if some advanced TeX command
252 are used, say, the character classes are changed.
253 .PP
254 This should not be of any concern if the stream in question is a
255 \*(L"user\*(R" file, but is important for \*(L"packages\*(R".
256 .Sh "Digester"
257 .IX Subsection "Digester"
258 The processed \f(CWinput tokens\fR are handled to the digester, which
259 handles them according to the provided \f(CWtokens\fR attribute.
260 .Sh "\f(CWtokens\fR attribute"
261 .IX Subsection "\f(CWtokens\fR attribute"
262 This is a hash reference which describes how the \f(CWinput tokens\fR
263 should be handled. A key to this hash is a literal like \f(CW^\fR or
264 \f(CW\efraction\fR. A value should be another hash reference, with the
265 following keys recognized:
266 .Ip "class" 7
267 .IX Item "class"
268 Into which class to bless the token. Several predefined classes are
269 provided. The default is \f(CWText::TeX::Token\fR.
270 .Ip "Type" 7
271 .IX Item "Type"
272 What kind of special processing to do with the input after the
273 \f(CWclass\fR methods are called. Recognized \f(CWType\fRs are:
274 .Ip "report_args" 17
275 .IX Item "report_args"
276 When the token of this \f(CWType\fR is encountered, it is converted into
277 \f(CWText::Tex::BegArgsToken\fR. Then the arguments are processed as usual,
278 and an \f(CWoutput token\fR of type \f(CWText::Tex::ArgToken\fR is inserted
279 between them. Finally, after all the arguments are processed, an
280 \f(CWoutput token\fR \f(CWText::Tex::EndArgsToken\fR is inserted.
281 .Sp
282 The first element of these simulated \f(CWoutput tokens\fR is an array
283 reference with the first element being the initial \f(CWoutput token\fR
284 which generated this sequence. The second element of the internal
285 array is the number of arguments required by the \f(CWinput token\fR. The
286 \f(CWText::Tex::ArgToken\fR token has a third element, which is the ordinal
287 of the argument which ends immediately before this token.
288 .Sp
289 If requested, a token \f(CWText::Tex::LookAhead\fR may be returned instead
290 of \f(CWText::Tex::EndArgsToken\fR. The additional elements of
291 \f(CW$token-\fR[0]> are: the reference to the corresponding \f(CWlookahead\fR
292 attribute, the relevant key (text of following token) and the
293 corresponding value.
294 .Sp
295 In such a case the input token which was looked-ahead would generate
296 an output token of type \f(CWText::Tex::BegArgsTokenLookedAhead\fR (if it
297 usually generates \f(CWText::Tex::BegArgsToken\fR).
298 .Ip "local" 17
299 .IX Item "local"
300 Means that these macro introduces a local change, which should be
301 undone at the end of enclosing block. At the end of the block an
302 output event \f(CWText::TeX::EndLocal\fR is delivered, with \f(CW$token-\fR[0]>
303 being the output token for the \fIlocal\fR event starting.
304 .Sp
305 Useful for font switching.
306 .PP
307 Some additional keys may be recognized by the code for the particular
308 \f(CWclass\fR.
309 .Ip "\f(CWcount\fR" 12
310 .IX Item "\f(CWcount\fR"
311 number of arguments to the macro.
312 .Ip "\f(CWwaitfor\fR" 12
313 .IX Item "\f(CWwaitfor\fR"
314 gives the matching token for a \fIstarting delimiter\fR token.
315 .Ip "\f(CWeatargs\fR" 12
316 .IX Item "\f(CWeatargs\fR"
317 number of tokens to swallow literally and put into the relevant slot
318 of the \f(CWoutput token\fR. The surrounding braces are stripped.
319 .Ip "\f(CWselfmatch\fR" 12
320 .IX Item "\f(CWselfmatch\fR"
321 is used with \f(CWeatargs==1\fR. Denotes that the matching token is also
322 \f(CWeatargs==1\fR, and the swallowed tokens should coinside (like with
323 \f(CW\ebegin{blah} ... \eend{blah}\fR).
324 .Ip "\f(CWlookahead\fR" 12
325 .IX Item "\f(CWlookahead\fR"
326 is a hash with keys being texts of tokens which need to be treated
327 specially after the end of arguments for the current token. If the
328 corresponding text follows the token indeed, a token
329 \f(CWText::Tex::LookAhead\fR is returned instead of
330 \f(CWText::Tex::EndArgsToken\fR.
331 .Sh "Symbol font table"
332 .IX Subsection "Symbol font table"
333 The hash \f(CW%Text::TeX::xfont\fR contains the translation table from TeX
334 tokens into the corresponding font elements. The values are array
335 references of the form \f(CW[fontname, char]\fR, Currently the only font
336 supported is \f(CWsymbol\fR.
337 .SH "AUTHOR"
338 .IX Header "AUTHOR"
339 Ilya Zakharevich, ilya@math.ohio-state.edu
340 .SH "SEE ALSO"
341 .IX Header "SEE ALSO"
342 \fIperl\fR\|(1).
343
344 .rn }` ''