]> git.lyx.org Git - lyx.git/blob - lib/reLyX/reLyX.man
just Changelog
[lyx.git] / lib / reLyX / reLyX.man
1 .rn '' }`
2 ''' $RCSfile: reLyX.man,v $$Revision: 1.4 $$Date: 2004/10/28 14:35:19 $
3 '''
4 ''' $Log: reLyX.man,v $
5 ''' Revision 1.4  2004/10/28 14:35:19  leeming
6 ''' Whitespace, only whitespace. Part II.
7 '''
8 ''' Revision 1.3  2002/10/28 09:52:39  poenitz
9 ''' the relyx changes
10 '''
11 ''' Revision 1.2  2000/03/29 23:02:36  karger
12 ''' Very minor changes (sorry kayvan!)
13 '''
14 '''
15 .de Sh
16 .br
17 .if t .Sp
18 .ne 5
19 .PP
20 \fB\\$1\fR
21 .PP
22 ..
23 .de Sp
24 .if t .sp .5v
25 .if n .sp
26 ..
27 .de Ip
28 .br
29 .ie \\n(.$>=3 .ne \\$3
30 .el .ne 3
31 .IP "\\$1" \\$2
32 ..
33 .de Vb
34 .ft CW
35 .nf
36 .ne \\$1
37 ..
38 .de Ve
39 .ft R
40
41 .fi
42 ..
43 '''
44 '''
45 '''     Set up \*(-- to give an unbreakable dash;
46 '''     string Tr holds user defined translation string.
47 '''     Bell System Logo is used as a dummy character.
48 '''
49 .tr \(*W-|\(bv\*(Tr
50 .ie n \{\
51 .ds -- \(*W-
52 .ds PI pi
53 .if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch
54 .if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch
55 .ds L" ""
56 .ds R" ""
57 '''   \*(M", \*(S", \*(N" and \*(T" are the equivalent of
58 '''   \*(L" and \*(R", except that they are used on ".xx" lines,
59 '''   such as .IP and .SH, which do another additional levels of
60 '''   double-quote interpretation
61 .ds M" """
62 .ds S" """
63 .ds N" """""
64 .ds T" """""
65 .ds L' '
66 .ds R' '
67 .ds M' '
68 .ds S' '
69 .ds N' '
70 .ds T' '
71 'br\}
72 .el\{\
73 .ds -- \(em\|
74 .tr \*(Tr
75 .ds L" ``
76 .ds R" ''
77 .ds M" ``
78 .ds S" ''
79 .ds N" ``
80 .ds T" ''
81 .ds L' `
82 .ds R' '
83 .ds M' `
84 .ds S' '
85 .ds N' `
86 .ds T' '
87 .ds PI \(*p
88 'br\}
89 .\"     If the F register is turned on, we'll generate
90 .\"     index entries out stderr for the following things:
91 .\"             TH      Title
92 .\"             SH      Header
93 .\"             Sh      Subsection
94 .\"             Ip      Item
95 .\"             X<>     Xref  (embedded
96 .\"     Of course, you have to process the output yourself
97 .\"     in some meaninful fashion.
98 .if \nF \{
99 .de IX
100 .tm Index:\\$1\t\\n%\t"\\$2"
101 ..
102 .nr % 0
103 .rr F
104 .\}
105 .TH RELYX 1 "Version 2.9.2.2 2.9.2.2" "11/Aug/99" "User Contributed Perl Documentation"
106 .UC
107 .if n .hy 0
108 .if n .na
109 .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'
110 .de CQ          \" put $1 in typewriter font
111 .ft CW
112 'if n "\c
113 'if t \\&\\$1\c
114 'if n \\&\\$1\c
115 'if n \&"
116 \\&\\$2 \\$3 \\$4 \\$5 \\$6 \\$7
117 '.ft R
118 ..
119 .\" @(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2
120 .       \" AM - accent mark definitions
121 .bd B 3
122 .       \" fudge factors for nroff and troff
123 .if n \{\
124 .       ds #H 0
125 .       ds #V .8m
126 .       ds #F .3m
127 .       ds #[ \f1
128 .       ds #] \fP
129 .\}
130 .if t \{\
131 .       ds #H ((1u-(\\\\n(.fu%2u))*.13m)
132 .       ds #V .6m
133 .       ds #F 0
134 .       ds #[ \&
135 .       ds #] \&
136 .\}
137 .       \" simple accents for nroff and troff
138 .if n \{\
139 .       ds ' \&
140 .       ds ` \&
141 .       ds ^ \&
142 .       ds , \&
143 .       ds ~ ~
144 .       ds ? ?
145 .       ds ! !
146 .       ds /
147 .       ds q
148 .\}
149 .if t \{\
150 .       ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u"
151 .       ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u'
152 .       ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u'
153 .       ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u'
154 .       ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u'
155 .       ds ? \s-2c\h'-\w'c'u*7/10'\u\h'\*(#H'\zi\d\s+2\h'\w'c'u*8/10'
156 .       ds ! \s-2\(or\s+2\h'-\w'\(or'u'\v'-.8m'.\v'.8m'
157 .       ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u'
158 .       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'
159 .\}
160 .       \" troff and (daisy-wheel) nroff accents
161 .ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V'
162 .ds 8 \h'\*(#H'\(*b\h'-\*(#H'
163 .ds v \\k:\h'-(\\n(.wu*9/10-\*(#H)'\v'-\*(#V'\*(#[\s-4v\s0\v'\*(#V'\h'|\\n:u'\*(#]
164 .ds _ \\k:\h'-(\\n(.wu*9/10-\*(#H+(\*(#F*2/3))'\v'-.4m'\z\(hy\v'.4m'\h'|\\n:u'
165 .ds . \\k:\h'-(\\n(.wu*8/10)'\v'\*(#V*4/10'\z.\v'-\*(#V*4/10'\h'|\\n:u'
166 .ds 3 \*(#[\v'.2m'\s-2\&3\s0\v'-.2m'\*(#]
167 .ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#]
168 .ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H'
169 .ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u'
170 .ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#]
171 .ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#]
172 .ds ae a\h'-(\w'a'u*4/10)'e
173 .ds Ae A\h'-(\w'A'u*4/10)'E
174 .ds oe o\h'-(\w'o'u*4/10)'e
175 .ds Oe O\h'-(\w'O'u*4/10)'E
176 .       \" corrections for vroff
177 .if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u'
178 .if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u'
179 .       \" for low resolution devices (crt and lpr)
180 .if \n(.H>23 .if \n(.V>19 \
181 \{\
182 .       ds : e
183 .       ds 8 ss
184 .       ds v \h'-1'\o'\(aa\(ga'
185 .       ds _ \h'-1'^
186 .       ds . \h'-1'.
187 .       ds 3 3
188 .       ds o a
189 .       ds d- d\h'-1'\(ga
190 .       ds D- D\h'-1'\(hy
191 .       ds th \o'bp'
192 .       ds Th \o'LP'
193 .       ds ae ae
194 .       ds Ae AE
195 .       ds oe oe
196 .       ds Oe OE
197 .\}
198 .rm #[ #] #H #V #F C
199 .SH "NAME"
200 \fBreLyX\fR \- translate well-behaved LaTeX into LyX
201 .SH "SYNOPSIS"
202 The simplest way to use \fBreLyX\fR is via the File->Import command in LyX. (This
203 option is available starting with version 1.0.0.) That runs \fBreLyX\fR on
204 the given file and loads the resulting file into LyX. You should try that
205 first, and call it from the command line only if you need to use more
206 complicated options.
207 .PP
208 \fBreLyX\fR [ \fB\-c\fR \fItextclass\fR ] [ \fB\-df\fR ] [ \fB\-o\fR \fIoutputdir\fR ] [\fB\-n\fR]
209 [\ \fB\-r\fR\ \fIrenv1\fR[,\fIrenv2\fR...]] [\ \fB\-s\fR\ \fIsfile1\fR[,\fIsfile2\fR...]]
210 \fIinputfile\fR
211 .PP
212 \fBreLyX\fR \fB\-p\fR \fB\-c\fR \fItextclass\fR [ \fB\-df\fR ] [ \fB\-o\fR \fIoutputdir\fR ]
213 [\ \fB\-r\fR\ \fIrenv1\fR[,\fIrenv2\fR...]] [\ \fB\-s\fR\ \fIsfile1\fR[,\fIsfile2\fR...]]
214 \fIinputfiles\fR
215 .PP
216 \fBreLyX\fR \fB\-h\fR
217 .SH "OPTIONS"
218 .Ip "\fB\-c\fR" 4
219 Class. By default, when \fBreLyX\fR sees a \f(CW\edocumentclass{foo}\fR command, it
220 creates a file of textclass \*(L"foo\*(R" and reads the LyX layout file for that class
221 (something like /usr/local/share/lyx/layouts/foo.layout \s-1OR\s0
222 \fB\s-1HOME\s0\fR/.lyx/layouts/foo.layout).  Use \fB\-c\fR to declare a different textclass
223 (and read a different layout file).
224 .Ip "\fB\-d\fR" 4
225 Debug. By default, \fBreLyX\fR gives sparse output and deletes the temporary files
226 which were created during translation. Using the \fB\-d\fR flag will create much
227 more output (both to stdout and stderr) and leave the temporary files around.
228 .Ip "\fB\-f\fR" 4
229 Force. \fBreLyX\fR will not run if the .lyx file it would generate already exists
230 Use the \fB\-f\fR option (carefully) to clobber any existing files.
231 .Ip "\fB\-h\fR" 4
232 Help. Print out usage information and quit.
233 .Ip "\fB\-n\fR" 4
234 Noweb. Translate a noweb (aka literate programming) file. This should be
235 (almost?) equivalent to running \*(L"noweb2lyx foo.tex foo.lyx\*(R". This option
236 requires the \fB\-c\fR option.
237 .Ip "\fB\-o\fR" 4
238 Output directory. With this option, all temporary files and LyX output files
239 (for the given input file, for any included files, or for any file fragments
240 given with the \fB\-p\fR option) will be put into \fIoutputdir\fR. Otherwise, for
241 each file \fIdir/foo.tex\fR, the temporary files and the LyX output file will be
242 created in \fIdir\fR. This can be useful if a file includes files from other
243 directories which you want to consolidate in one directory, or if you don't
244 have write permission on the directory the LaTeX files are in.
245 .Ip "\fB\-p\fR" 4
246 Partial file. The input files are LaTeX fragments, with no preamble matter or
247 \f(CW\ebegin{document}\fR commands. This option requires the \fB\-c\fR option, since there
248 are no \f(CW\edocumentclass\fR commands in the files \fBreLyX\fR is translating. When
249 using this option, you can translate more than one file, as long as all files
250 are the same class. The LyX file created by \fBreLyX\fR can be included in an
251 existing LyX file using the \*(L"Include LyX File\*(R" command from LyX's Insert menu.
252 .Ip "\fB\-r\fR" 4
253 Regular environments (see the section on \fISyntax Files\fR).  If you give more than one
254 environment, separate them with commas (not spaces). You'll probably need to
255 quote the environment list, especially if it has asterisk environments (foo*)
256 in it. If you use this command often, considering creating a personal syntax
257 file.
258 .Ip "\fB\-s\fR" 4
259 Syntax files. Input (one or more quoted, comma-separated) syntax files to read
260 in addition to the default. (see the section on \fISyntax Files\fR for details).
261 .SH "DESCRIPTION"
262 .Sh "Introduction"
263 \fBreLyX\fR will create a LyX file \fIdir/foo.lyx\fR from the LaTeX file
264 \fIdir/foo.tex\fR (unless the \fB\-o\fR option is used).
265 .PP
266 Suffixes .tex, .ltx and .latex are supported. If \fIinputfile\fR
267 does not exist and does not have one of these suffixes, \fBreLyX\fR will try to
268 translate \fIinputfile.tex\fR. (This is similar to the behavior of LaTeX.)
269 .PP
270 The purpose of \fBreLyX\fR is to translate \fIwell-behaved\fR LaTeX2e into LyX. If
271 your LaTeX file doesn't compile---or if you do weird things, like redefining
272 standard LaTex commands---it may choke. LaTeX209 will often be translated
273 correctly, but it's not guaranteed.
274 .PP
275 \fBreLyX\fR has some bugs and lacks a few features. However, its main goals are:
276 .Ip "\(bu" 4
277 Get through a well-behaved LaTeX2e file without crashing
278 .Ip "\(bu" 4
279 Translate a lot of that file.
280 .Ip "\(bu" 4
281 Localize the parts that can't be translated and copy them in TeX mode
282 .PP
283 It achieves these main goals pretty well on most files.
284 .PP
285 There are many improvements that can and will be made to \fBreLyX\fR in the
286 future. However, we wanted to get \fBreLyX\fR out there early on, to make
287 it easier for new LyX users to read in their existing LaTeX files.
288 .Sh "Usage"
289 Here's a more lengthy description of what you should do to translate a LaTeX
290 document into LyX.
291 .Ip "\(bu" 4
292 Run \fBreLyX\fR.
293 .Sp
294 \fBreLyX\fR will inform you of its progress and give any warnings to stderr, so if
295 you don't want any output at all, try (in csh) \*(L'reLyX foo.tex >& /dev/null\*(R'.
296 You should \s-1NOT\s0 redirect standard output to \fIfoo.lyx\fR.
297 .Ip "\(bu" 4
298 Run LyX (version 0.12 or 1.0 or later) on the resulting .lyx file.
299 .Sp
300 In theory, most of the file will have been translated, and anything that's
301 untranslatable will be highlighted in red (TeX mode). In theory, LyX will be
302 able to read in the file, and to create printed documents from it, because all
303 that untranslated red stuff will be passed directly back to LaTeX, which LyX
304 uses as a backend. Unfortunately, reality doesn't always reflect theory. If
305 \fBreLyX\fR crashes, or LyX cannot read the generated LyX file, see the \f(CWBUGS\fR entry elsewhere in this document or the \fI\s-1BUGS\s0\fR file.
306 .Ip "\(bu" 4
307 Change things that are highlighted in red (TeX mode) by hand in LyX.
308 .Sp
309 As mentioned above, you should be able to print out the LyX file even without
310 doing this. However, changing a command in TeX mode to the corresponding LyX
311 object will allow you to take advantage of LyX's \s-1WYSIWYM\s0 editing.
312 .Sp
313 \fBreLyX\fR is not guaranteed to create a LyX file which generates exactly the same
314 output as the LaTeX file, but it should come close. \fBrelyX\fR will generally err
315 on the side of translating less to ensure that dvi or ps files are accurate,
316 even though this leads to more \*(L"evil red text\*(R" and less \s-1WYSIWYM\s0.
317 .Ip "\(bu" 4
318 \s-1PROOFREAD\s0 \s-1THE\s0 \s-1DOCUMENT\s0!!
319 .Sp
320 I'm sure you were planning on doing this anyway, but it's particularly
321 important after translating a LaTeX document. \fBreLyX\fR is, at least now, better
322 at \*(L"macro-translating\*(R" (translating the whole document) than
323 \*(L"micro-translating\*(R" (translating every little detail). For example, you may see
324 extra spaces or deleted spaces. Space handling has improved, but it's
325 not perfect.
326 .Sh "What reLyX Can Handle"
327 \fBreLyX\fR understands many LaTeX commands. It will translate:
328 .Ip "\(bu" 4
329 regular text, including mini-commands like ~, \*(L'\*(R', \f(CW\e@\fR, \f(CW\eTeX\fR, as well as
330 accented characters like \f(CW\e'{a}\fR, and the special cases ?` and !`
331 .Ip "\(bu" 4
332 title commands like \f(CW\eauthor\fR, \f(CW\edate\fR, \f(CW\etitle\fR, \f(CW\ethanks\fR and the
333 abstract environment
334 .Ip "\(bu" 4
335 heading commands like \f(CW\esection\fR including starred commands (\f(CW\esection*\fR)
336 .Ip "\(bu" 4
337 Environments: quote, quotation, and verse; center, flushright, and flushleft
338 .Ip "\(bu" 4
339 itemize, enumerate, and description environments, and their \f(CW\eitem\fR commands.
340 Also, well-behaved nested lists
341 .Ip "\(bu" 4
342 cross-referencing commands: \f(CW\eref\fR, \f(CW\epageref\fR, \f(CW\elabel\fR, and \f(CW\ecite\fR
343 .Ip "\(bu" 4
344 \f(CW\efootnote\fR and \f(CW\emargin\fR
345 .Ip "\(bu" 4
346 font-changing commands including \f(CW\eem\fR, \f(CW\eemph\fR, \f(CW\etextit\fR, and
347 corresponding commands to change family, size, series, and shape
348 .Ip "\(bu " 4
349 \f(CW\einput{foo}\fR (or \f(CW\einput{foo.blah}\fR) and \f(CW\einclude{foo}\fR. Plain TeX
350 \f(CW\einput\fR command \*(L"\f(CW\einput foo.tex\fR\*(R" is also supported.
351 .Ip "\(bu" 4
352 tabular environment, and commands that go inside it like \f(CW\ehline\fR, \f(CW\ecline\fR,
353 and \f(CW\emulticolumn\fR (but see below)
354 .Ip "\(bu" 4
355 float environments table and table*, as well as \f(CW\ecaption\fR commands within
356 them
357 .Ip "\(bu" 4
358 float environments figure and figure*, as well as graphics inclusion commands
359 \eepsf, \eepsffile, \eepsfbox, \eepsfxsize, \eepsfig, \epsfig, and \eincludegraphics.
360 Both the graphics and graphicx forms of \eincludegraphics are supported.
361 Note, however, that many figures will not be translatable into LyX. See
362 the section on \*(L"What LyX Can't Handle\*(R" below.
363 .Ip "\(bu" 4
364 thebibliography environment and \f(CW\ebibitem\fR command, as well as BibTeX's
365 \f(CW\ebibliography\fR and \f(CW\ebibliographystyle\fR commands
366 .Ip "\(bu" 4
367 miscellaneous commands: \f(CW\ehfill\fR, \f(CW\e\fR\f(CW\e\fR, \f(CW\enoindent\fR, \f(CW\eldots\fR...
368 .Ip "\(bu" 4
369 documentclass-specific environments (and some commands) which can be
370 translated to LyX layouts
371 .Ip "\(bu" 4
372 arguments to certain untranslatable commands (e.g. \f(CW\embox\fR)
373 .PP
374 Some of this support may not be 100% yet. See below for details
375 .PP
376 \fBreLyX\fR copies math (almost) verbatim from your LaTeX file. Luckily, LyX reads
377 in LaTeX math, so (almost) any math which is supported by LyX should work just
378 fine. A few math commands which are not supported by LyX will be replaced with
379 their equivalents, e.g., \f(CW\eto\fR is converted to \f(CW\erightarrow\fR. See
380 the section on \fISyntax Files\fR for more details.
381 .PP
382 \fBreLyX\fR will also copy any preamble commands (i.e., anything before
383 \f(CW\ebegin{document}\fR) verbatim, so fancy stuff you've got in your preamble
384 should be conserved in dvi and printed documents, although it will not of
385 course show up in the LyX window. Check Layout->LaTeX Preamble to make sure.
386 .Sh "What reLyX Can't Handle --- But it's \s-1OK\s0"
387 .Ip "\(bu" 4
388 tabular* tables
389 .Ip "\(bu" 4
390 minipages
391 .Ip "\(bu" 4
392 spacing commands (\f(CW\evspace\fR, \f(CW\epagebreak\fR, \f(CW\epar\fR, ...)
393 .Ip "\(bu" 4
394 \f(CW\ecentering\fR, \f(CW\eraggedleft\fR, \f(CW\eraggedright\fR
395 .Ip "\(bu" 4
396 \f(CW\everb\fR and verbatim environment. \fBreLyX\fR is careful to copy \fIexactly\fR in
397 this case, including comments and whitespace.
398 .Ip "\(bu" 4
399 some unknown (e.g., user-defined) environments and commands
400 .PP
401 \fBreLyX\fR copies unknown commands, along with their arguments, verbatim into the
402 LyX file. Also, if it sees a \f(CW\ebegin{foo}\fR where it doesn't recognize the
403 \*(L"foo\*(R" environment, it will copy verbatim until it sees \f(CW\eend{foo}\fR (unless
404 you use the \fB\-r\fR option). Hopefully, then, most of these unknown commands
405 won't cause \fBreLyX\fR to break; they'll merely require you to do some editing
406 once you've loaded the file up in LyX.  That should be less painful than
407 editing either the .tex or the .lyx file using a text editor.
408 .Sh "What reLyX Handles Badly --- aka \s-1BUGS\s0"
409 Since \fBreLyX\fR is relatively new, it's got a number of problems.  As it
410 matures, these bugs will be squished.
411 .PP
412 If \fBreLyX\fR is choking on something, or LyX can't read it after \fBreLyX\fR
413 translates it, the best thing to do is to put \f(CW\ebegin{reLyXskip}\fR before the
414 offending text, and \f(CW\eend{reLyXskip}\fR after it. I call this a \*(L"skip\*(R" block.
415 \fBreLyX\fR will copy this block exactly, in TeX mode. Then edit the resulting
416 LyX file, and translate the unknown stuff by hand. The reLyXskip environment
417 is magical; the \f(CW\ebegin\fR and \f(CW\eend\fR commands will not be put into the LyX
418 file.
419 .Ip "\(bu" 4
420 \*(L"Exact\*(R" copying of unknown environments and commands isn't quite exact.
421 Specifically, newlines and comments may be lost. This will yield ugly LyX, but
422 in almost all cases the output will be the same. However, certain parts of the
423 file will be copied perfectly, including whitespace and comments. This
424 includes: the LaTeX preamble, verbatim environments and \f(CW\everb\fR commands, and
425 skip blocks.
426 .Ip "\(bu" 4
427 \fBreLyX\fR translates only a few options to the \f(CW\edocumentclass\fR command.
428 (Specifically 1[012]pt, [letter|legal|executive|a4|a5|b5]paper,
429 [one|two]side, landscape, and [one|two]column.) Other options are placed in
430 the \*(L"options\*(R" field in the Layout->Document popup.
431 .Sp
432 More importantly, \fBreLyX\fR doesn't translate \f(CW\eusepackage\fR commands, margin
433 commands, \f(CW\enewcommands\fR, or, in fact, anything else from the preamble. It
434 simply copies them into the LaTeX preamble. If you have margin commands in
435 your preamble, then the LyX file will generate the right margins. However,
436 these margins will override any margins you set in the LyX Layout->Paper
437 popup. So you should remove the options from the preamble
438 (Layout->Latex Preamble) to be safe. The same goes for setting your language
439 with babel, \f(CW\einputencoding\fR, \f(CW\epagestyle\fR, etc.
440 .Ip "\(bu" 4
441 The foil class has a couple bugs. \fBreLyX\fR may do weird things with optional
442 arguments to \f(CW\efoilhead\fR commands. Also, it may handle \f(CW\ebegin{dinglist}\fR
443 incorrectly (although the stuff in the environment should translate normally).
444 .PP
445 Less significant bugs can be found in the \fI\s-1BUGS\s0\fR file.
446 .PP
447 \fBreLyX\fR is hopefully rather robust. As mentioned above, it may not translate
448 your file perfectly, but it shouldn't crash. If it does crash---and the
449 problem is not one of those mentioned above or in the \fI\s-1BUGS\s0\fR file---see
450 the section on \fIBug Reports\fR.
451 .Sh "What LyX Can't Handle"
452 LyX itself is missing a couple features, such that even if \fBreLyX\fR translates
453 things perfectly, LyX may still have trouble reading it. If you really need
454 these features, you can export your final document as LaTeX, and put them
455 back in. See \fI\s-1BUGS\s0\fR for more details on these bugs.
456 .Ip "\(bu" 4
457 For a number of commands, LyX does not support the optional argument. Examples
458 include \f(CW\echapter\fR (and other sectioning commands), and \f(CW\e\e\fR.
459 \fBreLyX\fR will automatically discard the optional arguments with a warning to
460 stdout.  LyX also ignores the width argument for the thebibliography
461 environment.
462 .Ip "\(bu" 4
463 Centering (or right or left justifying) works on full paragraphs.
464 .Ip "\(bu" 4
465 LyX support for tables isn't perfect. For complicated tables, use a \*(L"skip\*(R"
466 block, so that they will be copied in TeX mode.
467 .Ip "\(bu" 4
468 The LyX math editor can't handle the \s-1AMS\s0\-LaTeX math environments align, split,
469 etc. So those environments will be copied in TeX mode. You can change
470 equation* environments to the exactly equivalent displaymath, and then they
471 will be translated correctly.
472 .Ip "\(bu" 4
473 Lyx does not support clipping or bounding boxes for included graphics files.
474 Therefore, many graphics inclusion commands will be untranslatable, and
475 copied in TeX mode. In certain cases, you might be able to translate the
476 command by hand within LyX---for example, if you included a bounding box but
477 the bounding box is already in the .eps file.
478 .Sp
479 LyX only allows figures to have sizes in in,cm, or percentages of \etextwidth
480 or \etextheight (or \ecolumnwidth). \fBreLyX\fR will translate from other units, like
481 pt or mm, but it cannot translate other lengths (e.g. if you wanted to scale a
482 figure to size \etopmargin for some reason). \fBreLyX\fR will copy figures with
483 untranslatable sizes in TeX mode. Again, you might be able to fix that within
484 LyX.
485 .Sh "The Future of reLyX"
486 In the future, more commands and environments will be supported by \fBreLyX\fR.
487 Bugs will be eradicated.
488 .PP
489 See the \s-1TODO\s0 file for details.
490 .SH "EXAMPLES"
491 reLyX \fB\-df\fR \fB\-o\fR \*(L"my/dir\*(R" \fB\-r\fR \*(L"myenv\*(R" foo.tex > foo.debug
492 .PP
493 The above will create a file my/dir/foo.lyx from foo.tex, overwriting if
494 necessary.  When it finds a \f(CW\ebegin{myenv} ... \eend{myenv}\fR block, it will
495 translate the stuff within the block, but copy the \f(CW\ebegin\fR and \f(CW\eend\fR
496 commands in TeX mode.  Finally, I'm going to keep the temporary files around
497 (they will also be in my/dir/) and output lots of debugging information into
498 the file foo.debug.
499 .PP
500 reLyX \fB\-n\fR \fB\-c\fR \*(L"literate-article\*(R" foo.tex
501 .PP
502 The above will change a noweb document into a LyX literate-article
503 document. A user would do this if the noweb document had documentclass
504 article.
505 .SH "NOTES"
506 .Sh "Bug Reports"
507 If \fBreLyX\fR is crashing or otherwise acting strangely---in ways
508 other than those described in the section on \fI\s-1BUGS\s0\fR or the \fI\s-1BUGS\s0\fR file---then please run
509 \fBreLyX \-d\fR.  That will allow you to figure out where in the reLyXing process
510 it crashed. That, in turn, will allow you to write a better bug report, which
511 will allow the developers to fix it more quickly and easily.
512 .PP
513 Bug reports should be sent to the LyX developers\*(R' mailing list. Its address
514 is currently lyx-devel@lists.lyx.org, but you can check the LyX home page,
515 http://www.lyx.org if that bounces. If you are running \fBreLyX\fR on a huge file,
516 please do not send all of the output in your bug report. Just include the last
517 ten or twenty lines of output, along with the piece of the LaTeX file it
518 crashed on.  Or, even better, attach a small but complete file which causes
519 the same problem as your original file.
520 .Sh "Implementation Details:"
521 \fBreLyX\fR makes several \*(L"passes\*(R" in order to translate a TeX file. On each pass,
522 it creates one or two files.
523 .Ip "Pass 0" 4
524 Before doing anything, read the syntax file (or files).
525 .Ip "Pass 1a" 4
526 Split preamble (anything before a \f(CW\ebegin{document}\fR command) off the rest
527 of the file. It saves the two pieces in separate files. This is necessary
528 because there may be very strange stuff in a preamble. It also ignores
529 anything after the \f(CW\eend{document}\fR, on the assumption that it isn't LaTeX.
530 .Ip "Pass 1b" 4
531 Translate the preamble. Currently, that just means translating the
532 \f(CW\edocumentclass\fR command and copying the rest exactly into the LyX preamble.
533 .Sp
534 Once you know what class the document is, read the LyX layout file for that
535 class.
536 .Ip "Pass 2" 4
537 \*(L"Clean\*(R" the TeX file, generating slightly stricter LaTeX. This includes:
538 .Ip "\(bu" 12
539 Change, e.g., x^2 to the equivalent but clearer x^{2}
540 .Ip "\(bu" 12
541 Removing optional arguments that LyX can't handle (e.g., from \f(CW\echapter\fR)
542 .Ip "\(bu" 12
543 Changing \f(CW{\eem foo}\fR to \f(CW\eemph{foo}\fR, etc. This is necessary because LyX
544 always writes out the non-local forms anyway. This should very rarely make a
545 difference.
546 .Ip "Pass 3" 4
547 Translate LaTeX text, commands, and environments to LyX.
548 .Ip "Pass 4" 4
549 Put the two pieces back together, and do some final tweaking, to generate the
550 LyX file
551 .PP
552 If there are any \f(CW\einput\fR or \f(CW\einclude\fR commands, \fBreLyX\fR will loop back to
553 the beginning and translate those. It assumes that the included files are the
554 same class as the main file, and that they have no preamble matter. (If you
555 have an \f(CW\einput\fR command in the preamble of a file, the command will be
556 copied exactly into the LaTeX preamble portion of the LyX file, so the
557 included file won't be translated.) So when translating included files, it
558 skips passes 0 and 1.
559 .PP
560 If \fBreLyX\fR doesn't find a file you wanted to include, it will give a warning,
561 but will continue to translate any files it does find.
562 .Sh "Layout Files"
563 \fBreLyX\fR reads a LyX layout file to know how to handle LaTeX environments and
564 commands which get translated to LyX layouts. This file will include all
565 \*(L"normal\*(R" non-math environments (i.e., including quote and itemize, but not
566 tabular, minipage, and some other fancy environments), and commands like
567 \f(CW\esection\fR and \f(CW\etitle\fR. If you want to reLyX a class that doesn't have an
568 existing layout file, then you'll have to create a layout file. But you have
569 to do this anyway, in order to LyX the file, since LyX depends on layout files
570 to know how to display and process its files. Check the LyX documentation for
571 help with this task (which can be hard or easy, depending on the class you
572 want to create a layout file for.) If your class is quite similar to a class
573 that has a layout file, then consider using the \fB\-c\fR option.
574 .Sh "Syntax Files"
575 \fBreLyX\fR always reads at least one syntax file, called the default syntax file.
576 \fBreLyX\fR will read your personal syntax file if it exists; otherwise it will
577 read the system-wide file. \fBreLyX\fR will read additional syntax files if you
578 specify them with the \fB\-s\fR option. (These extra files should have the same
579 format as the default file, but will tend to be shorter, since they only have
580 to specify extra commands not found in the default file.) A syntax file tells
581 \fBreLyX\fR a few things.
582 .PP
583 First, it describes the syntax of each command, that is, how many required
584 arguments and how many optional arguments the command takes. Knowing this
585 makes it easier for \fBreLyX\fR to copy (in TeX mode) commands that it doesn't
586 know how to translate. The syntax file simply has a command, followed by
587 braces or brackets describing its arguments in the correct order. For example,
588 a syntax file entry \f(CW\ebibitem[]{}\fR means that the \f(CW\ebibitem\fR command takes
589 an optional argument followed by a required one, while the entry \f(CW\ebf\fR
590 means that the \f(CW\ebf\fR command takes no arguments at all.  When \fBreLyX\fR
591 encounters a token that it doesn't know how to translate into LyX, it will
592 copy the token---along with the correct number of arguments---exactly.  If the
593 token is not in the syntax file, then \fBreLyX\fR just copies as many arguments
594 as it finds.  This means that it may copy too much. But since the user can
595 specify additional syntax files, that shouldn't happen often.
596 .PP
597 Some commands that cannot be translated to LyX, like \f(CW\embox\fR, have as one of
598 their arguments regular LaTeX text. If the string \*(L"translate\*(R" is put into an
599 argument of an (untranslatable) command in the syntax file, then \fBreLyX\fR will
600 translate that argument instead of copying it verbatim. So, for example, the
601 default syntax file has \f(CW\eraisebox{}[][]{translate}\fR. This means that the
602 \f(CW\eraisebox\fR command and the first argument (and optional arguments if they
603 exist) are copied in TeX mode, but the last argument (which may contain math,
604 complicated LaTeX, other untranslatable commands, etc.) will be translated
605 into LyX. You can't use \*(L"translate\*(R" on optional arguments.
606 .PP
607 User-defined syntax files are allowed to define new commands and
608 their syntax, or override the number of arguments for a command given in the
609 default syntax file. (E.g., if you're using a style that gives an extra
610 argument to some command...) However, this will only be useful for commands
611 copied in TeX mode. Commands which are actually translated by \fBreLyX\fR (like
612 \f(CW\eitem\fR) have their argument syntax hard-coded. The hard-coded commands are
613 identified in the default syntax file.
614 .PP
615 Second, the syntax file describes any \*(L"regular environments\*(R".  Usually, an
616 entire unknown environment will be copied in TeX mode. If you define a regular
617 environment \*(L"foo\*(R", though, then only the \f(CW\ebegin{foo}\fR and \f(CW\eend{foo}\fR
618 commands will be copied in TeX mode; the text within the environment will be
619 treated (i.e., translated) by \fBreLyX\fR as regular LaTeX, rather than being
620 copied into TeX mode. Don't try to declare \*(L"tabbing\*(R" and \*(L"picture\*(R" as regular
621 environments, as the text within those environments will confuse \fBreLyX\fR; use
622 this capability for new environments you create that have plain text or math
623 or simple commands in them. You also can't declare unknown math environments
624 (like equation*) as regular environments, either, since the LyX math editor
625 won't understand them. The names of regular environments appear,
626 whitespace-separated, between \f(CW\ebegin{reLyXre}\fR and \f(CW\eend{reLyXre}\fR
627 statements in the syntax file. (If you have a regular environment which you
628 won't use very often, you can use the \fB\-r\fR option rather than writing a
629 syntax file.)
630 .Sh "Miscellaneous"
631 You need Perl version 5.002 or later to run \fBreLyX\fR. <plug> If you don't have
632 Perl, you should get it anyway (at http://www.perl.com), because it's a really
633 useful tool for pretty much anything. </plug>
634 .SH "DIAGNOSTICS"
635 \fBreLyX\fR should always explain why it crashes, if it crashes. Some diagnostics
636 may be very technical, though, if they come from the guts of the code.
637 \fBreLyX\fR gives much more information while running if you use the \fB\-d\fR option,
638 but you shouldn't need that unless something goes wrong.
639 .PP
640 When it's finished, \fBreLyX\fR will tell you if it finished successfully or
641 died due to some error.
642 .SH "WARNINGS"
643 Always keep a copy of your original LaTeX files either under a different
644 name or in a different directory. There are a couple ways in which using LyX
645 could lead to overwriting the original LaTeX file.
646 .PP
647 If you import foo.tex to create foo.lyx, then edit foo.lyx and want to
648 re-export it, note that it will overwrite the original foo.tex. (LyX will ask
649 you if you want to overwrite it.)
650 .PP
651 If you have the \euse_tempdir variable set to false in your lyxrc, then LyX
652 will create its temporary files in your current directory, which means your
653 LaTeX original may be overwritten (without a warning from LyX) when you \*(L"view
654 dvi\*(R" or print the LyX document.
655 .SH "FILES"
656 .Ip "\fI\s-1MY_LYXDIR\s0\fR/layouts/*.layout" 4
657 User's personal layout files for document classes
658 .Ip "\fI\s-1MY_LYXDIR\s0\fR/reLyX/syntax.default" 4
659 User's personal syntax file
660 .Ip "\fI\s-1LIBDIR\s0\fR/layouts/*.layout" 4
661 System-wide layout files for document classes
662 .Ip "\fI\s-1LIBDIR\s0\fR/reLyX/syntax.default" 4
663 System-wide LaTeX syntax file
664 .PP
665 \fI\s-1LIBDIR\s0\fR is the system-wide LyX directory, usually something like
666 /usr/local/share/lyx/. \fI\s-1MY_LYXDIR\s0\fR is your personal LyX directory, something
667 like .lyx/ in your home directory.
668 .SH "SEE ALSO"
669 \fIlyx\fR\|(1), \fIlatex\fR\|(1)
670 .SH "AUTHORS"
671 Copyright (c) 1998-9 Amir Karger (karger@post.harvard.edu)
672 .PP
673 Code contributors:
674 .Ip "\(bu" 4
675 John Weiss wrote the original CleanTeX pass.
676 .Ip "\(bu" 4
677 Etienne Grossmann
678 .Ip "\(bu" 4
679 Jose\*' Abi\*'lio Oliveira Matos
680 .Ip "\(bu" 4
681 David Suarez de Lis
682 .Ip "\(bu" 4
683 Kayvan Aghaiepour Sylvan added noweb stuff and wrote noweb2lyx
684 .PP
685 Other contributors:
686 .Ip "\(bu" 4
687 Jean-Marc Lasgouttes worked on the wrapper script and offered lots of bug
688 reports, advice, and feature suggestions.
689 .Ip "\(bu" 4
690 Asger K. Alstrup Nielsen and Marc Pavese provided advice.
691 .Ip "\(bu" 4
692 Various members of the LyX developers\*(R' and users\*(R' lists provided bug reports
693 and feature suggestions.
694 .PP
695 \fBreLyX\fR uses a modified version the Perl TeX parser Text::TeX package written
696 by Ilya Zakharevich (ilya@math.ohio-state.edu), available on \s-1CPAN\s0.
697
698 .rn }` ''
699 .IX Title "RELYX 1"
700 .IX Name "B<reLyX> - translate well-behaved LaTeX into LyX"
701
702 .IX Header "NAME"
703
704 .IX Header "SYNOPSIS"
705
706 .IX Header "OPTIONS"
707
708 .IX Item "\fB\-c\fR"
709
710 .IX Item "\fB\-d\fR"
711
712 .IX Item "\fB\-f\fR"
713
714 .IX Item "\fB\-h\fR"
715
716 .IX Item "\fB\-n\fR"
717
718 .IX Item "\fB\-o\fR"
719
720 .IX Item "\fB\-p\fR"
721
722 .IX Item "\fB\-r\fR"
723
724 .IX Item "\fB\-s\fR"
725
726 .IX Header "DESCRIPTION"
727
728 .IX Subsection "Introduction"
729
730 .IX Item "\(bu"
731
732 .IX Item "\(bu"
733
734 .IX Item "\(bu"
735
736 .IX Subsection "Usage"
737
738 .IX Item "\(bu"
739
740 .IX Item "\(bu"
741
742 .IX Item "\(bu"
743
744 .IX Item "\(bu"
745
746 .IX Subsection "What reLyX Can Handle"
747
748 .IX Item "\(bu"
749
750 .IX Item "\(bu"
751
752 .IX Item "\(bu"
753
754 .IX Item "\(bu"
755
756 .IX Item "\(bu"
757
758 .IX Item "\(bu"
759
760 .IX Item "\(bu"
761
762 .IX Item "\(bu"
763
764 .IX Item "\(bu "
765
766 .IX Item "\(bu"
767
768 .IX Item "\(bu"
769
770 .IX Item "\(bu"
771
772 .IX Item "\(bu"
773
774 .IX Item "\(bu"
775
776 .IX Item "\(bu"
777
778 .IX Item "\(bu"
779
780 .IX Subsection "What reLyX Can't Handle --- But it's \s-1OK\s0"
781
782 .IX Item "\(bu"
783
784 .IX Item "\(bu"
785
786 .IX Item "\(bu"
787
788 .IX Item "\(bu"
789
790 .IX Item "\(bu"
791
792 .IX Item "\(bu"
793
794 .IX Subsection "What reLyX Handles Badly --- aka \s-1BUGS\s0"
795
796 .IX Item "\(bu"
797
798 .IX Item "\(bu"
799
800 .IX Item "\(bu"
801
802 .IX Subsection "What LyX Can't Handle"
803
804 .IX Item "\(bu"
805
806 .IX Item "\(bu"
807
808 .IX Item "\(bu"
809
810 .IX Item "\(bu"
811
812 .IX Item "\(bu"
813
814 .IX Subsection "The Future of reLyX"
815
816 .IX Header "EXAMPLES"
817
818 .IX Header "NOTES"
819
820 .IX Subsection "Bug Reports"
821
822 .IX Subsection "Implementation Details:"
823
824 .IX Item "Pass 0"
825
826 .IX Item "Pass 1a"
827
828 .IX Item "Pass 1b"
829
830 .IX Item "Pass 2"
831
832 .IX Item "\(bu"
833
834 .IX Item "\(bu"
835
836 .IX Item "\(bu"
837
838 .IX Item "Pass 3"
839
840 .IX Item "Pass 4"
841
842 .IX Subsection "Layout Files"
843
844 .IX Subsection "Syntax Files"
845
846 .IX Subsection "Miscellaneous"
847
848 .IX Header "DIAGNOSTICS"
849
850 .IX Header "WARNINGS"
851
852 .IX Header "FILES"
853
854 .IX Item "\fI\s-1MY_LYXDIR\s0\fR/layouts/*.layout"
855
856 .IX Item "\fI\s-1MY_LYXDIR\s0\fR/reLyX/syntax.default"
857
858 .IX Item "\fI\s-1LIBDIR\s0\fR/layouts/*.layout"
859
860 .IX Item "\fI\s-1LIBDIR\s0\fR/reLyX/syntax.default"
861
862 .IX Header "SEE ALSO"
863
864 .IX Header "AUTHORS"
865
866 .IX Item "\(bu"
867
868 .IX Item "\(bu"
869
870 .IX Item "\(bu"
871
872 .IX Item "\(bu"
873
874 .IX Item "\(bu"
875
876 .IX Item "\(bu"
877
878 .IX Item "\(bu"
879
880 .IX Item "\(bu"
881