]> git.lyx.org Git - lyx.git/blob - src/tex2lyx/tex2lyx.1
Whitespace.
[lyx.git] / src / tex2lyx / tex2lyx.1
1 .rn '' }`
2 ''' $RCSfile: tex2lyx.man,v $$Revision: 1.1 $$Date: 2005/07/16 15:18:14 $
3 '''
4 ''' $Log: tex2lyx.man,v $
5 ''' Revision 1.1  2005/07/16 15:18:14  larsbj
6 ''' drop reLyX like it is hot, and setup to use tex2lyx instead (and remerged po files + no.po small update)
7 '''
8 '''
9 .de Sh
10 .br
11 .if t .Sp
12 .ne 5
13 .PP
14 \fB\\$1\fR
15 .PP
16 ..
17 .de Sp
18 .if t .sp .5v
19 .if n .sp
20 ..
21 .de Ip
22 .br
23 .ie \\n(.$>=3 .ne \\$3
24 .el .ne 3
25 .IP "\\$1" \\$2
26 ..
27 .de Vb
28 .ft CW
29 .nf
30 .ne \\$1
31 ..
32 .de Ve
33 .ft R
34
35 .fi
36 ..
37 '''
38 '''
39 '''     Set up \*(-- to give an unbreakable dash;
40 '''     string Tr holds user defined translation string.
41 '''     Bell System Logo is used as a dummy character.
42 '''
43 .tr \(*W-|\(bv\*(Tr
44 .ie n \{\
45 .ds -- \(*W-
46 .ds PI pi
47 .if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch
48 .if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch
49 .ds L" ""
50 .ds R" ""
51 '''   \*(M", \*(S", \*(N" and \*(T" are the equivalent of
52 '''   \*(L" and \*(R", except that they are used on ".xx" lines,
53 '''   such as .IP and .SH, which do another additional levels of
54 '''   double-quote interpretation
55 .ds M" """
56 .ds S" """
57 .ds N" """""
58 .ds T" """""
59 .ds L' '
60 .ds R' '
61 .ds M' '
62 .ds S' '
63 .ds N' '
64 .ds T' '
65 'br\}
66 .el\{\
67 .ds -- \(em\|
68 .tr \*(Tr
69 .ds L" ``
70 .ds R" ''
71 .ds M" ``
72 .ds S" ''
73 .ds N" ``
74 .ds T" ''
75 .ds L' `
76 .ds R' '
77 .ds M' `
78 .ds S' '
79 .ds N' `
80 .ds T' '
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 TEX2LYX 1 "Version 2.9.2.2 2.9.2.2" "16/Jul/2005" ""
100 .UC
101 .if n .hy 0
102 .if n .na
103 .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'
104 .de CQ          \" put $1 in typewriter font
105 .ft CW
106 'if n "\c
107 'if t \\&\\$1\c
108 'if n \\&\\$1\c
109 'if n \&"
110 \\&\\$2 \\$3 \\$4 \\$5 \\$6 \\$7
111 '.ft R
112 ..
113 .\" @(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2
114 .       \" AM - accent mark definitions
115 .bd B 3
116 .       \" fudge factors for nroff and troff
117 .if n \{\
118 .       ds #H 0
119 .       ds #V .8m
120 .       ds #F .3m
121 .       ds #[ \f1
122 .       ds #] \fP
123 .\}
124 .if t \{\
125 .       ds #H ((1u-(\\\\n(.fu%2u))*.13m)
126 .       ds #V .6m
127 .       ds #F 0
128 .       ds #[ \&
129 .       ds #] \&
130 .\}
131 .       \" simple accents for nroff and troff
132 .if n \{\
133 .       ds ' \&
134 .       ds ` \&
135 .       ds ^ \&
136 .       ds , \&
137 .       ds ~ ~
138 .       ds ? ?
139 .       ds ! !
140 .       ds /
141 .       ds q
142 .\}
143 .if t \{\
144 .       ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u"
145 .       ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u'
146 .       ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u'
147 .       ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u'
148 .       ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u'
149 .       ds ? \s-2c\h'-\w'c'u*7/10'\u\h'\*(#H'\zi\d\s+2\h'\w'c'u*8/10'
150 .       ds ! \s-2\(or\s+2\h'-\w'\(or'u'\v'-.8m'.\v'.8m'
151 .       ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u'
152 .       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'
153 .\}
154 .       \" troff and (daisy-wheel) nroff accents
155 .ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V'
156 .ds 8 \h'\*(#H'\(*b\h'-\*(#H'
157 .ds v \\k:\h'-(\\n(.wu*9/10-\*(#H)'\v'-\*(#V'\*(#[\s-4v\s0\v'\*(#V'\h'|\\n:u'\*(#]
158 .ds _ \\k:\h'-(\\n(.wu*9/10-\*(#H+(\*(#F*2/3))'\v'-.4m'\z\(hy\v'.4m'\h'|\\n:u'
159 .ds . \\k:\h'-(\\n(.wu*8/10)'\v'\*(#V*4/10'\z.\v'-\*(#V*4/10'\h'|\\n:u'
160 .ds 3 \*(#[\v'.2m'\s-2\&3\s0\v'-.2m'\*(#]
161 .ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#]
162 .ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H'
163 .ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u'
164 .ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#]
165 .ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#]
166 .ds ae a\h'-(\w'a'u*4/10)'e
167 .ds Ae A\h'-(\w'A'u*4/10)'E
168 .ds oe o\h'-(\w'o'u*4/10)'e
169 .ds Oe O\h'-(\w'O'u*4/10)'E
170 .       \" corrections for vroff
171 .if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u'
172 .if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u'
173 .       \" for low resolution devices (crt and lpr)
174 .if \n(.H>23 .if \n(.V>19 \
175 \{\
176 .       ds : e
177 .       ds 8 ss
178 .       ds v \h'-1'\o'\(aa\(ga'
179 .       ds _ \h'-1'^
180 .       ds . \h'-1'.
181 .       ds 3 3
182 .       ds o a
183 .       ds d- d\h'-1'\(ga
184 .       ds D- D\h'-1'\(hy
185 .       ds th \o'bp'
186 .       ds Th \o'LP'
187 .       ds ae ae
188 .       ds Ae AE
189 .       ds oe oe
190 .       ds Oe OE
191 .\}
192 .rm #[ #] #H #V #F C
193 .SH "NAME"
194 \fBtex2lyx\fR \- translate well-behaved LaTeX into LyX
195 .SH "SYNOPSIS"
196 The simplest way to use \fBtex2lyx\fR is via the File->Import->LaTeX (plain) menu item
197 in LyX. That runs \fBtex2lyx\fR on the given file and loads the
198 resulting file into LyX. You should try that first, and call it from
199 the command line only if you need to use more complicated options.
200 .PP
201 \fBtex2lyx\fR [ \fB\-df\fR ] [ \fB\-userdir\fR \fIuserdir\fR ] [ \fB\-systemdir\fR \fIsystemdir\fR ]
202 [\fB\-n\fR] [\ \fB\-r\fR\ \fIrenv1\fR[,\fIrenv2\fR...]] [\ \fB\-s\fR\ \fIsfile1\fR[,\fIsfile2\fR...]]
203 \fIinputfile\fR  [ \fB\-c\fR \fItextclass\fR ] 
204 .PP
205 \fBtex2lyx\fR [ \fB\-df\fR ] [ \fB\-userdir\fR \fIuserdir\fR ] [ \fB\-systemdir\fR \fIsystemdir\fR ]
206 [\ \fB\-r\fR\ \fIrenv1\fR[,\fIrenv2\fR...]] [\ \fB\-s\fR\ \fIsfile1\fR[,\fIsfile2\fR...]]
207 \fIinputfiles\fR \fB\-p\fR \fB\-c\fR \fItextclass\fR
208 .PP
209 \fBtex2lyx\fR \fB\-help\fR
210 .SH "OPTIONS"
211 .Ip "\fB\-c\fR" 4
212 Class. By default, when \fBtex2lyx\fR sees a \f(CW\edocumentclass{foo}\fR command, it
213 creates a file of textclass \*(L"foo\*(R" and reads the LyX layout file for that class
214 (something like /usr/local/share/lyx/layouts/foo.layout \s-1OR\s0
215 \fB\s-1HOME\s0\fR/.lyx/layouts/foo.layout).  Use \fB\-c\fR to declare a different textclass
216 (and read a different layout file).
217 .Ip "\fB\-d\fR" 4
218 Debug. By default, \fBtex2lyx\fR gives sparse output and deletes the temporary files
219 which were created during translation. Using the \fB\-d\fR flag will create much
220 more output (both to stdout and stderr) and leave the temporary files around.
221 .Ip "\fB\-f\fR" 4
222 Force. \fBtex2lyx\fR will not run if the .lyx file it would generate already exists.
223 Use the \fB\-f\fR option (carefully) to clobber any existing files.
224 .Ip "\fB\-help\fR" 4
225 Help. Print out usage information and quit.
226 .Ip "\fB\-n\fR" 4
227 Noweb. Translate a noweb (aka literate programming) file. This should be
228 (almost?) equivalent to running \*(L"noweb2lyx foo.tex foo.lyx\*(R". This option
229 requires the \fB\-c\fR option.
230 .Ip "\fB\-p\fR" 4
231 Partial file. The input files are LaTeX fragments, with no preamble matter or
232 \f(CW\ebegin{document}\fR commands. This option requires the \fB\-c\fR option, since there
233 are no \f(CW\edocumentclass\fR commands in the files \fBtex2lyx\fR is translating. When
234 using this option, you can translate more than one file, as long as all files
235 are the same class. The LyX file created by \fBtex2lyx\fR can be included in an
236 existing LyX file using the \*(L"Include LyX File\*(R" command from LyX's Insert menu.
237 .Ip "\fB\-r\fR" 4
238 Regular environments (see the section on \fISyntax Files\fR).  If you give more than one
239 environment, separate them with commas (not spaces). You'll probably need to
240 quote the environment list, especially if it has asterisk environments (foo*)
241 in it. If you use this command often, considering creating a personal syntax
242 file.
243 .Ip "\fB\-s\fR" 4
244 Syntax files. Input (one or more quoted, comma-separated) syntax files to read
245 in addition to the default. (see the section on \fISyntax Files\fR for details).
246 .Ip "\fB\-sysdir\fR" 4
247 Specify a system directory. Normally, you shouldn't need this. Your LyX system directory is
248 chosen. Cf. the section \f(CWFILES\fR for details.
249 .Ip "\fB\-userdir\fR" 4
250 Specify a user directory. Normally, you shouldn't need this. Your LyX user directory is
251 chosen. Cf. the section \f(CWFILES\fR for details.
252 .SH "DESCRIPTION"
253 .Sh "Introduction"
254 \fBtex2lyx\fR will create a LyX file \fIdir/foo.lyx\fR from the LaTeX file
255 \fIdir/foo.tex\fR.
256 .PP
257 Suffixes .tex, .ltx and .latex are supported. If \fIinputfile\fR
258 does not exist and does not have one of these suffixes, \fBtex2lyx\fR will try to
259 translate \fIinputfile.tex\fR. (This is similar to the behavior of LaTeX.)
260 .PP
261 The purpose of \fBtex2lyx\fR is to translate \fIwell-behaved\fR LaTeX2e into LyX. If
262 your LaTeX file doesn't compile---or if you do weird things, like redefining
263 standard LaTeX commands---it may choke. LaTeX209 will often be translated
264 correctly, but it's not guaranteed.
265 .PP
266 \fBtex2lyx\fR lacks a few features. However, its main goals are:
267 .Ip "\(bu" 4
268 Get through a well-behaved LaTeX2e file without crashing
269 .Ip "\(bu" 4
270 Translate a lot of that file.
271 .Ip "\(bu" 4
272 Localize the parts that can't be translated and copy them in TeX mode
273 .PP
274 It achieves these main goals pretty well on most files.
275 .Sh "Usage"
276 Here's a more lengthy description of what you should do to translate a LaTeX
277 document into LyX.
278 .Ip "\(bu" 4
279 Run \fBtex2lyx\fR.
280 .Sp
281 \fBtex2lyx\fR will inform you of its progress and give any warnings to stderr, so if
282 you don't want any output at all, try (in csh) \*(L'tex2lyx foo.tex >& /dev/null\*(R'.
283 You should \s-1NOT\s0 redirect standard output to \fIfoo.lyx\fR.
284 .Ip "\(bu" 4
285 Run LyX (version 1.4 or later) on the resulting .lyx file.
286 .Sp
287 In theory, most of the file will have been translated, and anything that's
288 untranslatable will be transferred to TeX code (ERT in LyX-speak). In theory, LyX will be
289 able to read in the file, and to create printed documents from it, because all
290 that untranslated ERT stuff will be passed directly back to LaTeX, which LyX
291 uses as a backend. Unfortunately, reality doesn't always reflect theory. If
292 \fBtex2lyx\fR crashes, or LyX cannot read the generated LyX file, see the \f(CWBUGS\fR section below.
293 .Ip "\(bu" 4
294 Transform things have been inserted as TeX code manually to LyX features, if possible.
295 .Sp
296 As mentioned above, you should be able to print out the LyX file even without
297 doing this. However, changing a command in TeX code to the corresponding LyX
298 object will allow you to take advantage of LyX's \s-1WYSIWYM\s0 editing.
299 .Sp
300 \fBtex2lyx\fR is not guaranteed to create a LyX file which generates exactly the same
301 output as the LaTeX file, although its goal is to achieve this. \fBtex2lyx\fR will generally err
302 on the side of translating less to ensure that the resulting output files are accurate,
303 even though this leads to more TeX code and less \s-1WYSIWYM\s0.
304 .Ip "\(bu" 4
305 \s-1PROOFREAD\s0 \s-1THE\s0 \s-1DOCUMENT\s0!!
306 .Sp
307 I'm sure you were planning on doing this anyway, but it's particularly
308 important after translating a LaTeX document. \fBtex2lyx\fR is better
309 at \*(L"macro-translating\*(R" (translating the whole document) than
310 \*(L"micro-translating\*(R" (translating every little detail). For example, you may see
311 extra spaces or deleted spaces. Space handling has improved, but it's
312 not perfect.
313 .Sh "What tex2lyx Can Handle"
314 \fBtex2lyx\fR understands many LaTeX commands. It will translate:
315 .Ip "\(bu" 4
316 regular text, including mini-commands like ~, \*(L'\*(R', \f(CW\e@\fR, \f(CW\eTeX\fR, as well as
317 accented characters like \f(CW\e'{a}\fR, and the special cases ?` and !`
318 .Ip "\(bu" 4
319 title commands like \f(CW\eauthor\fR, \f(CW\edate\fR, \f(CW\etitle\fR, \f(CW\ethanks\fR and the
320 abstract environment
321 .Ip "\(bu" 4
322 heading commands like \f(CW\esection\fR including starred commands (\f(CW\esection*\fR)
323 .Ip "\(bu" 4
324 Environments: quote, quotation, and verse; center, flushright, and flushleft
325 .Ip "\(bu" 4
326 itemize, enumerate, and description environments, and their \f(CW\eitem\fR commands.
327 Also, well-behaved nested lists
328 .Ip "\(bu" 4
329 cross-referencing commands: \f(CW\eref\fR, \f(CW\epageref\fR, \f(CW\elabel\fR, and \f(CW\ecite\fR
330 .Ip "\(bu" 4
331 \f(CW\efootnote\fR and \f(CW\emargin\fR
332 .Ip "\(bu" 4
333 font-changing commands including \f(CW\eem\fR, \f(CW\eemph\fR, \f(CW\etextit\fR, and
334 corresponding commands to change family, size, series, and shape
335 .Ip "\(bu " 4
336 \f(CW\einput{foo}\fR (or \f(CW\einput{foo.blah}\fR) and \f(CW\einclude{foo}\fR. Plain TeX
337 \f(CW\einput\fR command \*(L"\f(CW\einput foo.tex\fR\*(R" is also supported.
338 .Ip "\(bu" 4
339 tabular environment, and commands that go inside it like \f(CW\ehline\fR, \f(CW\ecline\fR,
340 and \f(CW\emulticolumn\fR (but see below)
341 .Ip "\(bu" 4
342 float environments table and table*, as well as \f(CW\ecaption\fR commands within
343 them
344 .Ip "\(bu" 4
345 float environments figure and figure*, as well as graphics inclusion commands
346 \eepsf, \eepsffile, \eepsfbox, \eepsfxsize, \eepsfig, \epsfig, and \eincludegraphics.
347 Both the graphics and graphicx forms of \eincludegraphics are supported.
348 .Ip "\(bu" 4
349 thebibliography environment and \f(CW\ebibitem\fR command, as well as BibTeX's
350 \f(CW\ebibliography\fR and \f(CW\ebibliographystyle\fR commands
351 .Ip "\(bu" 4
352 miscellaneous commands: \f(CW\ehfill\fR, \f(CW\e\fR\f(CW\e\fR, \f(CW\enoindent\fR, \f(CW\eldots\fR...
353 .Ip "\(bu" 4
354 documentclass-specific environments (and some commands) which can be
355 translated to LyX layouts
356 .Ip "\(bu" 4
357 arguments to certain untranslatable commands (e.g. \f(CW\embox\fR)
358 .PP
359 Some of this support may not be 100% yet. See below for details
360 .PP
361 \fBtex2lyx\fR copies math (almost) verbatim from your LaTeX file. Luckily, LyX reads
362 in LaTeX math, so (almost) any math which is supported by LyX should work just
363 fine.
364 .PP
365 \fBtex2lyx\fR will copy any preamble commands (i.e., anything before
366 \f(CW\ebegin{document}\fR) verbatim. Fancy stuff you've got in your preamble
367 should thus be conserved in printed documents, although it will not of
368 course show up in the LyX window. Check Document->Settings->LaTeX Preamble to see the result.
369 .Sh "What tex2lyx Can't Handle --- But it's \s-1OK\s0"
370 .Ip "\(bu" 4
371 tabular* tables
372 .Ip "\(bu" 4
373 some spacing commands (\f(CW\ehspace\fR, \f(CW\epagebreak\fR and \f(CW\elinebreak\fR)
374 .Ip "\(bu" 4
375 \f(CW\ecentering\fR, \f(CW\eraggedleft\fR, \f(CW\eraggedright\fR
376 .Ip "\(bu" 4
377 \f(CW\everb\fR and verbatim environment. \fBtex2lyx\fR is careful to copy \fIexactly\fR in
378 this case, including comments and whitespace.
379 .Ip "\(bu" 4
380 unknown (e.g., user-defined) environments and commands
381 .PP
382 \fBtex2lyx\fR copies unknown commands, along with their arguments, verbatim into the
383 LyX file. Also, if it sees a \f(CW\ebegin{foo}\fR where it doesn't recognize the
384 \*(L"foo\*(R" environment, it will copy verbatim until it sees \f(CW\eend{foo}\fR (unless
385 you use the \fB\-r\fR option). Most of these unknown commands
386 won't cause \fBtex2lyx\fR to break; they'll merely require you to do some editing
387 once you've loaded the file up in LyX.  That should be less painful than
388 editing either the .tex or the .lyx file using a text editor.
389 .Sh "What tex2lyx Handles Badly --- aka \s-1BUGS\s0"
390 Since \fBtex2lyx\fR is relatively new, it's got a number of problems.  As it
391 matures, these bugs will be squished.
392 .PP
393 .Ip "\(bu" 4
394 \*(L"Exact\*(R" copying of unknown environments and commands isn't quite exact.
395 This will yield ugly LyX, but in almost all cases the output will be the same. 
396 However, most parts of the file will be copied perfectly, including whitespace 
397 and comments. This includes: the LaTeX preamble, verbatim environments as well as
398 \f(CW\everb\fR commands, and skip blocks.
399 .Ip "\(bu" 4
400 \fBtex2lyx\fR translates only a subset of the document class options to native features.
401 Other options are placed in the \*(L"options\*(R" field in the Document->Settings popup.
402 .Sp
403 More importantly, \fBtex2lyx\fR doesn't translate \f(CW\enewcommands\fR, unknown
404 \f(CW\eusepackage\fR commands and other unknown code in the preamble. It
405 simply copies that into the LaTeX preamble. If you use special commands, e.g. to
406 specify the text layout in a way that that is not understood by LyX, tex2lyx won't
407 recognize it. Note that these settings will be overwritten if you modify the text 
408 layout in LyX's document settings. Better remove these special options from the LaTeX 
409 preamble (Document->Settings->LaTeX Preamble) and use the corresponding LyX document 
410 settings, if possible.
411 .Ip "\(bu" 4
412 \fBtex2lyx\fR doesn't handle unicode yet. So if you have an utf8-encoded tex file, some
413 characters might not be (well) supported. Also, the output format of \fBtex2lyx\fR
414 remains that of LyX 1.4 until unicode support is implemented. This disallows us from
415 supporting newer features natively, which is in fact the most severe issue in current 
416 \fBtex2lyx\fR.
417 .Ip "\(bu" 4
418 The foil document class has a couple of bugs. \fBtex2lyx\fR may do weird things with optional
419 arguments to \f(CW\efoilhead\fR commands. Also, it may handle \f(CW\ebegin{dinglist}\fR
420 incorrectly (although the stuff in the environment should translate normally).
421 .PP
422 All known bugs of \fBtex2lyx\fR can be found on \fI\s-1http://bugzilla.lyx.org\s0\fR.
423 .PP
424 \fBtex2lyx\fR is rather robust. As mentioned above, it may not translate
425 your file perfectly, but the result should be usable and it shouldn't crash. If you encounter
426 problems---and the problem is not one of those mentioned above or on 
427 \fI\s-1http://bugzilla.lyx.org\s0\fR---please report the issue as described in the section 
428 on \fIBug Reports\fR.
429 .Sh "What LyX Can't Handle"
430 LyX itself is missing a couple of features, such that even if \fBtex2lyx\fR translates
431 things perfectly, LyX may still have trouble reading it. If you really need
432 these features, you can export your final document as LaTeX, and put them
433 back in. See \fI\s-1BUGS\s0\fR for more details on these bugs.
434 .Ip "\(bu" 4
435 For a number of commands (such as \f(CW\e\e\fR), LyX does not support the optional argument.
436 \fBtex2lyx\fR will automatically discard the optional arguments with a warning to
437 stdout.  LyX also ignores the width argument for the thebibliography
438 environment.
439 .Ip "\(bu" 4
440 LyX support for tables isn't perfect. For complicated tables, use a \*(L"skip\*(R"
441 block, so that they will be copied in TeX mode.
442 .Ip "\(bu" 4
443 LyX allows figures to have sizes in the units known to TeX, such as in, cm, etc. It also 
444 translates percentages of \etextwidth, \etextheight, \ecolumnwidth, but no other lengths 
445 (e.g. if you wanted to scale a figure to size \etopmargin for some reason). \fBtex2lyx\fR 
446 will copy figures with untranslatable sizes in TeX mode. Again, you might be able to fix 
447 that within LyX.
448 .Sp
449 .Sh "The Future of tex2lyx"
450 \fBtex2lyx\fR is actively maintained. Commands and environments will be added in the future.
451 Bugs will be eradicated. The most important task will be to make \fBtex2lyx\fR unicode
452 compliant.
453 .SH "EXAMPLES"
454 tex2lyx \fB\-df\fR \fB\-r\fR \*(L"myenv\*(R" foo.tex > foo.debug
455 .PP
456 The above will create a file foo.lyx from foo.tex, overwriting if
457 necessary.  When it finds a \f(CW\ebegin{myenv} ... \eend{myenv}\fR block, it will
458 translate the stuff within the block, but copy the \f(CW\ebegin\fR and \f(CW\eend\fR
459 commands in TeX mode.  Finally, it's going to keep the temporary files around
460 and output lots of debugging information into the file foo.debug.
461 .PP
462 tex2lyx \fB\-n\fR \fB\-c\fR \*(L"literate-article\*(R" foo.tex
463 .PP
464 The above will change a noweb document into a LyX literate-article
465 document. A user would do this if the noweb document had documentclass
466 article.
467 .SH "NOTES"
468 .Sh "Bug Reports"
469 If \fBtex2lyx\fR is crashing or otherwise acting strangely---in ways
470 other than those described in the section on \fI\s-1BUGS\s0\fR or on 
471 \fI\s-1http://bugzilla.lyx.org\s0\fR---then please run
472 \fBtex2lyx \-d\fR.  That will allow you to figure out where in the tex2lyxing process
473 it crashed. That, in turn, will allow you to write a better bug report, which
474 will allow the developers to fix it more quickly and easily.
475 .PP
476 Bugs should be reported to the LyX bug tracker at http://bugzilla.lyx.org. Additionally,
477 you can post a message to the LyX developers\*(R' mailing list. Its address is currently
478 lyx-devel@lists.lyx.org. If your message bounces, you can check the LyX home page, 
479 http://www.lyx.org. If you are running \fBtex2lyx\fR on a huge file, please do not send all of the output in 
480 your bug report. Just include the last ten or twenty lines of output, along with 
481 the piece of the LaTeX file it crashed on.  Or, even better, attach a small but 
482 complete file which causes the same problem as your original file.
483 .Sh "Layout Files"
484 \fBtex2lyx\fR reads a LyX layout file to know how to handle LaTeX environments and
485 commands which get translated to LyX layouts. This file will include all
486 \*(L"normal\*(R" non-math environments (i.e., including quote and itemize, but not
487 tabular, minipage, and some other fancy environments), and commands like
488 \f(CW\esection\fR and \f(CW\etitle\fR. If you want to tex2lyx a class that doesn't have an
489 existing layout file, then you'll have to create a layout file. But you have
490 to do this anyway, in order to LyX the file, since LyX depends on layout files
491 to know how to display and process its files. Check the LyX documentation for
492 help with this task (which can be hard or easy, depending on the class you
493 want to create a layout file for.) If your class is quite similar to a class
494 that has a layout file, then consider using the \fB\-c\fR option.
495 .Sh "Syntax Files"
496 \fBtex2lyx\fR always reads at least one syntax file, called the default syntax file.
497 \fBtex2lyx\fR will read your personal syntax file if it exists; otherwise it will
498 read the system-wide file. \fBtex2lyx\fR will read additional syntax files if you
499 specify them with the \fB\-s\fR option. (These extra files should have the same
500 format as the default file, but will tend to be shorter, since they only have
501 to specify extra commands not found in the default file.) A syntax file tells
502 \fBtex2lyx\fR a few things.
503 .PP
504 First, it describes the syntax of each command, that is, how many required
505 arguments and how many optional arguments the command takes. Knowing this
506 makes it easier for \fBtex2lyx\fR to copy (in TeX mode) commands that it doesn't
507 know how to translate. The syntax file simply has a command, followed by
508 braces or brackets describing its arguments in the correct order. For example,
509 a syntax file entry \f(CW\ebibitem[]{}\fR means that the \f(CW\ebibitem\fR command takes
510 an optional argument followed by a required one, while the entry \f(CW\ebf\fR
511 means that the \f(CW\ebf\fR command takes no arguments at all.  When \fBtex2lyx\fR
512 encounters a token that it doesn't know how to translate into LyX, it will
513 copy the token---along with the correct number of arguments---exactly.  If the
514 token is not in the syntax file, then \fBtex2lyx\fR just copies as many arguments
515 as it finds.  This means that it may copy too much. But since the user can
516 specify additional syntax files, that shouldn't happen often.
517 .PP
518 Some commands that cannot be translated to LyX, like \f(CW\embox\fR, have as one of
519 their arguments regular LaTeX text. If the string \*(L"translate\*(R" is put into an
520 argument of an (untranslatable) command in the syntax file, then \fBtex2lyx\fR will
521 translate that argument instead of copying it verbatim. So, for example, the
522 default syntax file has \f(CW\eraisebox{}[][]{translate}\fR. This means that the
523 \f(CW\eraisebox\fR command and the first argument (and optional arguments if they
524 exist) are copied in TeX mode, but the last argument (which may contain math,
525 complicated LaTeX, other untranslatable commands, etc.) will be translated
526 into LyX. You can't use \*(L"translate\*(R" on optional arguments.
527 .PP
528 User-defined syntax files are allowed to define new commands and
529 their syntax, or override the number of arguments for a command given in the
530 default syntax file. (E.g., if you're using a style that gives an extra
531 argument to some command...) However, this will only be useful for commands
532 copied in TeX mode. Commands which are actually translated by \fBtex2lyx\fR (like
533 \f(CW\eitem\fR) have their argument syntax hard-coded. The hard-coded commands are
534 identified in the default syntax file.
535 .PP
536 Second, the syntax file describes any \*(L"regular environments\*(R".  Usually, an
537 entire unknown environment will be copied in TeX mode. If you define a regular
538 environment \*(L"foo\*(R", though, then only the \f(CW\ebegin{foo}\fR and \f(CW\eend{foo}\fR
539 commands will be copied in TeX mode; the text within the environment will be
540 treated (i.e., translated) by \fBtex2lyx\fR as regular LaTeX, rather than being
541 copied into TeX mode. Don't try to declare \*(L"tabbing\*(R" and \*(L"picture\*(R" as regular
542 environments, as the text within those environments will confuse \fBtex2lyx\fR; use
543 this capability for new environments you create that have plain text or math
544 or simple commands in them. You also can't declare unknown math environments
545 (like equation*) as regular environments, either, since the LyX math editor
546 won't understand them. The names of regular environments appear,
547 whitespace-separated, between \f(CW\ebegin{tex2lyxre}\fR and \f(CW\eend{tex2lyxre}\fR
548 statements in the syntax file. (If you have a regular environment which you
549 won't use very often, you can use the \fB\-r\fR option rather than writing a
550 syntax file.)
551 .SH "WARNINGS"
552 Always keep a copy of your original LaTeX files either under a different
553 name or in a different directory. There are a couple ways in which using LyX
554 could lead to overwriting the original LaTeX file.
555 .PP
556 If you import foo.tex to create foo.lyx, then edit foo.lyx and want to
557 re-export it, note that it will overwrite the original foo.tex. (LyX will ask
558 you if you want to overwrite it.)
559 .PP
560 If you have the \euse_tempdir variable set to false in your lyxrc (or did not
561 have defined a temporary directory path in LyX's preferences, respectively),
562 LyX will create its temporary files in your current directory, which means your
563 LaTeX original may be overwritten (without a warning from LyX) when you view
564 or export the LyX document.
565 .SH "FILES"
566 .Ip "\fI\s-1MY_LYXDIR\s0\fR/layouts/*.layout" 4
567 User's personal layout files for document classes
568 .Ip "\fI\s-1MY_LYXDIR\s0\fR/syntax.default" 4
569 User's personal syntax file
570 .Ip "\fI\s-1LIBDIR\s0\fR/layouts/*.layout" 4
571 System-wide layout files for document classes
572 .Ip "\fI\s-1LIBDIR\s0\fR/lib/syntax.default" 4
573 System-wide LaTeX syntax file
574 .PP
575 \fI\s-1LIBDIR\s0\fR is the system-wide LyX directory, usually something like
576 /usr/local/share/lyx/. \fI\s-1MY_LYXDIR\s0\fR is your personal LyX directory, something
577 like .lyx/ in your home directory.
578 .SH "SEE ALSO"
579 \fIlyx\fR\|(1), \fIlatex\fR\|(1)
580 .SH "AUTHORS"
581 tex2lyx is Copyright (c) 2003ff. by the LyX Team (lyx-devel@lists.lyx.org)
582 .PP
583 .rn }` ''
584 .IX Title "TEX2LYX 1"
585 .IX Name "B<tex2lyx> - translate well-behaved LaTeX into LyX"
586
587 .IX Header "NAME"
588
589 .IX Header "SYNOPSIS"
590
591 .IX Header "OPTIONS"
592
593 .IX Item "\fB\-c\fR"
594
595 .IX Item "\fB\-d\fR"
596
597 .IX Item "\fB\-f\fR"
598
599 .IX Item "\fB\-help\fR"
600
601 .IX Item "\fB\-n\fR"
602
603 .IX Item "\fB\-o\fR"
604
605 .IX Item "\fB\-p\fR"
606
607 .IX Item "\fB\-r\fR"
608
609 .IX Item "\fB\-s\fR"
610
611 .IX Header "DESCRIPTION"
612
613 .IX Subsection "Introduction"
614
615 .IX Item "\(bu"
616
617 .IX Item "\(bu"
618
619 .IX Item "\(bu"
620
621 .IX Subsection "Usage"
622
623 .IX Item "\(bu"
624
625 .IX Item "\(bu"
626
627 .IX Item "\(bu"
628
629 .IX Item "\(bu"
630
631 .IX Subsection "What tex2lyx Can Handle"
632
633 .IX Item "\(bu"
634
635 .IX Item "\(bu"
636
637 .IX Item "\(bu"
638
639 .IX Item "\(bu"
640
641 .IX Item "\(bu"
642
643 .IX Item "\(bu"
644
645 .IX Item "\(bu"
646
647 .IX Item "\(bu"
648
649 .IX Item "\(bu "
650
651 .IX Item "\(bu"
652
653 .IX Item "\(bu"
654
655 .IX Item "\(bu"
656
657 .IX Item "\(bu"
658
659 .IX Item "\(bu"
660
661 .IX Item "\(bu"
662
663 .IX Item "\(bu"
664
665 .IX Subsection "What tex2lyx Can't Handle --- But it's \s-1OK\s0"
666
667 .IX Item "\(bu"
668
669 .IX Item "\(bu"
670
671 .IX Item "\(bu"
672
673 .IX Item "\(bu"
674
675 .IX Item "\(bu"
676
677 .IX Item "\(bu"
678
679 .IX Subsection "What tex2lyx Handles Badly --- aka \s-1BUGS\s0"
680
681 .IX Item "\(bu"
682
683 .IX Item "\(bu"
684
685 .IX Item "\(bu"
686
687 .IX Subsection "What LyX Can't Handle"
688
689 .IX Item "\(bu"
690
691 .IX Item "\(bu"
692
693 .IX Item "\(bu"
694
695 .IX Item "\(bu"
696
697 .IX Item "\(bu"
698
699 .IX Subsection "The Future of tex2lyx"
700
701 .IX Header "EXAMPLES"
702
703 .IX Header "NOTES"
704
705 .IX Subsection "Bug Reports"
706
707 .IX Subsection "Implementation Details:"
708
709 .IX Item "Pass 0"
710
711 .IX Item "Pass 1a"
712
713 .IX Item "Pass 1b"
714
715 .IX Item "Pass 2"
716
717 .IX Item "\(bu"
718
719 .IX Item "\(bu"
720
721 .IX Item "\(bu"
722
723 .IX Item "Pass 3"
724
725 .IX Item "Pass 4"
726
727 .IX Subsection "Layout Files"
728
729 .IX Subsection "Syntax Files"
730
731 .IX Subsection "Miscellaneous"
732
733 .IX Header "DIAGNOSTICS"
734
735 .IX Header "WARNINGS"
736
737 .IX Header "FILES"
738
739 .IX Item "\fI\s-1MY_LYXDIR\s0\fR/layouts/*.layout"
740
741 .IX Item "\fI\s-1MY_LYXDIR\s0\fR/syntax.default"
742
743 .IX Item "\fI\s-1LIBDIR\s0\fR/layouts/*.layout"
744
745 .IX Item "\fI\s-1LIBDIR\s0\fR/lib/syntax.default"
746
747 .IX Header "SEE ALSO"
748
749 .IX Header "AUTHORS"
750
751 .IX Item "\(bu"
752
753 .IX Item "\(bu"
754
755 .IX Item "\(bu"
756
757 .IX Item "\(bu"
758
759 .IX Item "\(bu"
760
761 .IX Item "\(bu"
762
763 .IX Item "\(bu"
764
765 .IX Item "\(bu"
766