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