2009-03-19 22:31:22 +00:00
|
|
|
.\" Man page for tex2lyx.
|
|
|
|
.\" Use the following command to view man page:
|
|
|
|
.\"
|
|
|
|
.\" tbl tex2lyx.1 | nroff -man | less
|
|
|
|
.\"
|
|
|
|
.TH TEX2LYX 1 "@LYX_DATE@" "Version @VERSION@" "tex2lyx @VERSION@"
|
|
|
|
.SH NAME
|
|
|
|
tex2lyx@version_suffix@ \- translate well-behaved LaTeX into LyX
|
|
|
|
.\"
|
|
|
|
.\" setup
|
|
|
|
.de Cr
|
|
|
|
.ie n (c)
|
|
|
|
.el \(co
|
1999-09-27 18:44:28 +00:00
|
|
|
..
|
2009-03-19 22:31:22 +00:00
|
|
|
.SH SYNOPSIS
|
|
|
|
The simplest way to use \fBtex2lyx\fR is via the File->Import->LaTeX
|
|
|
|
(plain) menu item in LyX. That runs \fBtex2lyx\fR on the given file
|
|
|
|
and loads the resulting file into LyX. You should try that first, and
|
|
|
|
call it from the command line only if you need to use more complicated
|
|
|
|
options.
|
1999-09-27 18:44:28 +00:00
|
|
|
.PP
|
2009-03-19 22:31:22 +00:00
|
|
|
\fBtex2lyx\fR [ \fB\-userdir\fR \fIuserdir\fR ] [ \fB\-systemdir\fR \fIsystemdir\fR ]
|
2012-10-22 19:31:26 +00:00
|
|
|
[ \fB\-f\fR ] [ \fB\-n\fR ] [ \fB\-c\fR \fItextclass\fR ]
|
2013-11-11 20:52:14 +00:00
|
|
|
[ \fB\-e\fR \fIencoding\fR ]
|
|
|
|
[ \fB\-fixedenc\fR \fIencoding\fR ]
|
2012-10-23 18:45:21 +00:00
|
|
|
[\ \fB\-m\fR \fImodule1\fR[,\fImodule2\fR...]]
|
2012-10-22 19:31:26 +00:00
|
|
|
[\ \fB\-s\fR\ \fIsfile1\fR[,\fIsfile2\fR...]] [ \fB\-skipchildren\fR ] [
|
2012-10-03 11:23:27 +00:00
|
|
|
\fB\-roundtrip\fR ] [ \fB\-copyfiles\fR ] \fIinputfile\fR [ \fIoutputfile\fR ]
|
2010-12-12 19:39:21 +00:00
|
|
|
.\" .PP
|
|
|
|
.\" \fBtex2lyx\fR [ \fB\-userdir\fR \fIuserdir\fR ] [ \fB\-systemdir\fR \fIsystemdir\fR ]
|
|
|
|
.\" [\ \fB\-r\fR\ \fIrenv1\fR[,\fIrenv2\fR...]] [\ \fB\-s\fR\ \fIsfile1\fR[,\fIsfile2\fR...]]
|
|
|
|
.\" \fIinputfiles\fR \fB\-p\fR \fB\-c\fR \fItextclass\fR
|
1999-09-27 18:44:28 +00:00
|
|
|
.SH "OPTIONS"
|
2009-03-19 22:31:22 +00:00
|
|
|
.TP
|
|
|
|
.BI \-c
|
2005-07-16 15:18:14 +00:00
|
|
|
Class. By default, when \fBtex2lyx\fR sees a \f(CW\edocumentclass{foo}\fR command, it
|
2010-12-12 19:39:21 +00:00
|
|
|
creates a file of textclass \*[lq]foo\*[rq] and reads the LyX layout file for that class
|
1999-09-27 18:44:28 +00:00
|
|
|
(something like /usr/local/share/lyx/layouts/foo.layout \s-1OR\s0
|
|
|
|
\fB\s-1HOME\s0\fR/.lyx/layouts/foo.layout). Use \fB\-c\fR to declare a different textclass
|
|
|
|
(and read a different layout file).
|
2012-01-08 17:38:48 +00:00
|
|
|
.IP ""
|
|
|
|
This option is needed if the input file is a LaTeX fragment, with no preamble
|
|
|
|
matter or \f(CW\ebegin{document}\fR command. LyX files created by
|
|
|
|
\fBtex2lyx\fR from partial files can be included in an existing LyX file using
|
|
|
|
the \*[lq]Include LyX File\*[rq] command from LyX's Insert menu.
|
2009-03-19 22:31:22 +00:00
|
|
|
.TP
|
2012-10-23 18:45:21 +00:00
|
|
|
.BI \-m
|
|
|
|
Module. Load the given modules. This is useful if \fBtex2lyx\fR does not
|
|
|
|
automatically detect a given module, but you know the modules that provide
|
|
|
|
some commands or environments that are used in the imported file. The modules
|
|
|
|
are loaded in the given order. If a module \fIfoo\fR depends on a module
|
|
|
|
\fIbar\fR, \fIbar\fR must be given before \fIfoo\fR.
|
|
|
|
.TP
|
2009-03-19 22:31:22 +00:00
|
|
|
.BI \-f
|
2008-04-20 15:22:17 +00:00
|
|
|
Force. \fBtex2lyx\fR will not run if the .lyx file it would generate already exists.
|
1999-09-27 18:44:28 +00:00
|
|
|
Use the \fB\-f\fR option (carefully) to clobber any existing files.
|
2009-03-19 22:31:22 +00:00
|
|
|
.TP
|
2013-11-11 20:52:14 +00:00
|
|
|
.BI \-e
|
|
|
|
Specify the default encoding using the LaTeX name as defined in the encodings
|
|
|
|
file. \fBtex2lyx\fR will use this encoding, but switch if it finds any encoding
|
|
|
|
changing commands in the input.
|
|
|
|
.TP
|
|
|
|
.BI \-fixedenc
|
|
|
|
Specify the encoding using the LaTeX name as defined in the encodings file.
|
|
|
|
\fBtex2lyx\fR will ignore any encoding changing commands in the input.
|
|
|
|
.TP
|
2009-03-19 22:31:22 +00:00
|
|
|
.BI \-n
|
1999-09-27 18:44:28 +00:00
|
|
|
Noweb. Translate a noweb (aka literate programming) file. This should be
|
2010-12-12 19:39:21 +00:00
|
|
|
(almost?) equivalent to running \*[lq]noweb2lyx foo.tex foo.lyx\*[rq]. This option
|
1999-09-27 18:44:28 +00:00
|
|
|
requires the \fB\-c\fR option.
|
2012-10-18 20:01:32 +00:00
|
|
|
.TP
|
|
|
|
.BI \-skipchildren
|
|
|
|
Do not translate child documents included via \f(CW\einclude\fR and \f(CW\einput\fR.
|
|
|
|
This option is useful if the child documents are generated files and/or contain many
|
|
|
|
commands that \fBtex2lyx\fR does not understand yet.
|
2009-03-19 22:31:22 +00:00
|
|
|
.TP
|
|
|
|
.BI \-s
|
1999-09-27 18:44:28 +00:00
|
|
|
Syntax files. Input (one or more quoted, comma-separated) syntax files to read
|
|
|
|
in addition to the default. (see the section on \fISyntax Files\fR for details).
|
2009-03-19 22:31:22 +00:00
|
|
|
.TP
|
|
|
|
.BI \-sysdir
|
2008-04-20 15:22:17 +00:00
|
|
|
Specify a system directory. Normally, you shouldn't need this. Your LyX system directory is
|
|
|
|
chosen. Cf. the section \f(CWFILES\fR for details.
|
2009-03-19 22:31:22 +00:00
|
|
|
.TP
|
|
|
|
.BI \-userdir
|
2008-04-20 15:22:17 +00:00
|
|
|
Specify a user directory. Normally, you shouldn't need this. Your LyX user directory is
|
|
|
|
chosen. Cf. the section \f(CWFILES\fR for details.
|
2009-04-19 22:13:43 +00:00
|
|
|
.TP
|
2010-12-31 11:57:25 +00:00
|
|
|
.BI \-roundtrip
|
2012-10-03 11:23:27 +00:00
|
|
|
Call LyX to re-export the created output file to LaTeX. If the output file name
|
|
|
|
is not given it is determined automatically to avoid over-writing the input file
|
|
|
|
by accident: If the input file is named \fIfoo.tex\fR the output file will be
|
2010-12-31 11:57:25 +00:00
|
|
|
named \fIfoo.lyx.lyx\fR, and the re-exported file will be named
|
|
|
|
\fIfoo.lyx.tex\fR.
|
|
|
|
.TP
|
2012-10-03 11:23:27 +00:00
|
|
|
.BI \-copyfiles
|
2012-10-06 11:55:25 +00:00
|
|
|
Copy all included files \fBtex2lyx\fR is
|
2012-10-03 11:23:27 +00:00
|
|
|
aware of to the output directory if the output file is located in a different
|
|
|
|
directory than the input file. This is useful if you want to ensure that no
|
|
|
|
included file is overwritten (either in roundtrip mode or by a later export
|
|
|
|
from LyX). Please note that the resulting document may be uncompilable. This
|
|
|
|
happens if it needs files that \fBtex2lyx\fR does not know about and therefore
|
|
|
|
does not copy to the output directory.
|
|
|
|
.TP
|
2009-04-19 22:13:43 +00:00
|
|
|
.BI \-help
|
|
|
|
Help. Print out usage information and quit.
|
2011-10-06 16:21:58 +00:00
|
|
|
.TP
|
|
|
|
.BI \-version
|
|
|
|
Print out the version number and build information and quit.
|
1999-09-27 18:44:28 +00:00
|
|
|
.SH "DESCRIPTION"
|
2009-03-19 22:31:22 +00:00
|
|
|
.SS "Introduction"
|
2010-12-31 11:57:25 +00:00
|
|
|
\fBtex2lyx\fR will create a LyX file with the specified name (or
|
|
|
|
\fIdir/foo.lyx\fR if no name was given) from the LaTeX file
|
2008-04-20 15:22:17 +00:00
|
|
|
\fIdir/foo.tex\fR.
|
1999-09-27 18:44:28 +00:00
|
|
|
.PP
|
|
|
|
Suffixes .tex, .ltx and .latex are supported. If \fIinputfile\fR
|
2005-07-16 15:18:14 +00:00
|
|
|
does not exist and does not have one of these suffixes, \fBtex2lyx\fR will try to
|
1999-09-27 18:44:28 +00:00
|
|
|
translate \fIinputfile.tex\fR. (This is similar to the behavior of LaTeX.)
|
|
|
|
.PP
|
2005-07-16 15:18:14 +00:00
|
|
|
The purpose of \fBtex2lyx\fR is to translate \fIwell-behaved\fR LaTeX2e into LyX. If
|
1999-09-27 18:44:28 +00:00
|
|
|
your LaTeX file doesn't compile---or if you do weird things, like redefining
|
2008-04-20 15:22:17 +00:00
|
|
|
standard LaTeX commands---it may choke. LaTeX209 will often be translated
|
1999-09-27 18:44:28 +00:00
|
|
|
correctly, but it's not guaranteed.
|
|
|
|
.PP
|
2008-07-28 07:52:27 +00:00
|
|
|
\fBtex2lyx\fR lacks a few features. However, its main goals are:
|
2009-03-19 22:31:22 +00:00
|
|
|
.IP "\(bu" 4
|
1999-09-27 18:44:28 +00:00
|
|
|
Get through a well-behaved LaTeX2e file without crashing
|
2009-03-19 22:31:22 +00:00
|
|
|
.IP "\(bu" 4
|
1999-09-27 18:44:28 +00:00
|
|
|
Translate a lot of that file.
|
2009-03-19 22:31:22 +00:00
|
|
|
.IP "\(bu" 4
|
1999-09-27 18:44:28 +00:00
|
|
|
Localize the parts that can't be translated and copy them in TeX mode
|
|
|
|
.PP
|
|
|
|
It achieves these main goals pretty well on most files.
|
2009-03-19 22:31:22 +00:00
|
|
|
.SS "Usage"
|
1999-09-27 18:44:28 +00:00
|
|
|
Here's a more lengthy description of what you should do to translate a LaTeX
|
|
|
|
document into LyX.
|
2009-03-19 22:31:22 +00:00
|
|
|
.IP "\(bu" 4
|
2005-07-16 15:18:14 +00:00
|
|
|
Run \fBtex2lyx\fR.
|
2009-03-19 22:31:22 +00:00
|
|
|
.IP ""
|
2005-07-16 15:18:14 +00:00
|
|
|
\fBtex2lyx\fR will inform you of its progress and give any warnings to stderr, so if
|
2010-12-12 19:39:21 +00:00
|
|
|
you don't want any output at all, try (in csh) `tex2lyx foo.tex >& /dev/null'.
|
2004-10-28 14:35:53 +00:00
|
|
|
You should \s-1NOT\s0 redirect standard output to \fIfoo.lyx\fR.
|
2009-03-19 22:31:22 +00:00
|
|
|
.IP "\(bu" 4
|
2012-01-08 17:38:48 +00:00
|
|
|
Run LyX (version 2.1 or later) on the resulting .lyx file.
|
2009-03-19 22:31:22 +00:00
|
|
|
.IP ""
|
1999-09-27 18:44:28 +00:00
|
|
|
In theory, most of the file will have been translated, and anything that's
|
2008-07-28 07:52:27 +00:00
|
|
|
untranslatable will be transferred to TeX code (ERT in LyX-speak). In theory, LyX will be
|
1999-09-27 18:44:28 +00:00
|
|
|
able to read in the file, and to create printed documents from it, because all
|
2008-04-20 15:22:17 +00:00
|
|
|
that untranslated ERT stuff will be passed directly back to LaTeX, which LyX
|
1999-09-27 18:44:28 +00:00
|
|
|
uses as a backend. Unfortunately, reality doesn't always reflect theory. If
|
2008-07-28 07:52:27 +00:00
|
|
|
\fBtex2lyx\fR crashes, or LyX cannot read the generated LyX file, see the \f(CWBUGS\fR section below.
|
2009-03-19 22:31:22 +00:00
|
|
|
.IP "\(bu" 4
|
2008-07-28 07:52:27 +00:00
|
|
|
Transform things have been inserted as TeX code manually to LyX features, if possible.
|
2009-03-19 22:31:22 +00:00
|
|
|
.IP ""
|
1999-09-27 18:44:28 +00:00
|
|
|
As mentioned above, you should be able to print out the LyX file even without
|
2008-07-28 07:52:27 +00:00
|
|
|
doing this. However, changing a command in TeX code to the corresponding LyX
|
1999-09-27 18:44:28 +00:00
|
|
|
object will allow you to take advantage of LyX's \s-1WYSIWYM\s0 editing.
|
2009-03-19 22:31:22 +00:00
|
|
|
.IP ""
|
2005-07-16 15:18:14 +00:00
|
|
|
\fBtex2lyx\fR is not guaranteed to create a LyX file which generates exactly the same
|
2008-07-28 07:52:27 +00:00
|
|
|
output as the LaTeX file, although its goal is to achieve this. \fBtex2lyx\fR will generally err
|
|
|
|
on the side of translating less to ensure that the resulting output files are accurate,
|
|
|
|
even though this leads to more TeX code and less \s-1WYSIWYM\s0.
|
2009-03-19 22:31:22 +00:00
|
|
|
.IP "\(bu" 4
|
1999-09-27 18:44:28 +00:00
|
|
|
\s-1PROOFREAD\s0 \s-1THE\s0 \s-1DOCUMENT\s0!!
|
2009-03-19 22:31:22 +00:00
|
|
|
.IP ""
|
1999-09-27 18:44:28 +00:00
|
|
|
I'm sure you were planning on doing this anyway, but it's particularly
|
2008-07-28 07:52:27 +00:00
|
|
|
important after translating a LaTeX document. \fBtex2lyx\fR is better
|
2010-12-12 19:39:21 +00:00
|
|
|
at \*[lq]macro-translating\*[rq] (translating the whole document) than
|
|
|
|
\*[lq]micro-translating\*[rq] (translating every little detail). For example, you may see
|
1999-09-27 18:44:28 +00:00
|
|
|
extra spaces or deleted spaces. Space handling has improved, but it's
|
|
|
|
not perfect.
|
2009-03-19 22:31:22 +00:00
|
|
|
.SS "What tex2lyx Can Handle"
|
2005-07-16 15:18:14 +00:00
|
|
|
\fBtex2lyx\fR understands many LaTeX commands. It will translate:
|
2009-03-19 22:31:22 +00:00
|
|
|
.IP "\(bu" 4
|
2010-12-12 19:39:21 +00:00
|
|
|
regular text, including mini-commands like ~, `', \f(CW\e@\fR, \f(CW\eTeX\fR, as well as
|
1999-09-27 18:44:28 +00:00
|
|
|
accented characters like \f(CW\e'{a}\fR, and the special cases ?` and !`
|
2009-03-19 22:31:22 +00:00
|
|
|
.IP "\(bu" 4
|
1999-09-27 18:44:28 +00:00
|
|
|
title commands like \f(CW\eauthor\fR, \f(CW\edate\fR, \f(CW\etitle\fR, \f(CW\ethanks\fR and the
|
|
|
|
abstract environment
|
2009-03-19 22:31:22 +00:00
|
|
|
.IP "\(bu" 4
|
1999-09-27 18:44:28 +00:00
|
|
|
heading commands like \f(CW\esection\fR including starred commands (\f(CW\esection*\fR)
|
2009-03-19 22:31:22 +00:00
|
|
|
.IP "\(bu" 4
|
1999-09-27 18:44:28 +00:00
|
|
|
Environments: quote, quotation, and verse; center, flushright, and flushleft
|
2009-03-19 22:31:22 +00:00
|
|
|
.IP "\(bu" 4
|
1999-09-27 18:44:28 +00:00
|
|
|
itemize, enumerate, and description environments, and their \f(CW\eitem\fR commands.
|
|
|
|
Also, well-behaved nested lists
|
2009-03-19 22:31:22 +00:00
|
|
|
.IP "\(bu" 4
|
1999-09-27 18:44:28 +00:00
|
|
|
cross-referencing commands: \f(CW\eref\fR, \f(CW\epageref\fR, \f(CW\elabel\fR, and \f(CW\ecite\fR
|
2009-03-19 22:31:22 +00:00
|
|
|
.IP "\(bu" 4
|
1999-09-27 18:44:28 +00:00
|
|
|
\f(CW\efootnote\fR and \f(CW\emargin\fR
|
2009-03-19 22:31:22 +00:00
|
|
|
.IP "\(bu" 4
|
1999-09-27 18:44:28 +00:00
|
|
|
font-changing commands including \f(CW\eem\fR, \f(CW\eemph\fR, \f(CW\etextit\fR, and
|
|
|
|
corresponding commands to change family, size, series, and shape
|
2009-03-19 22:31:22 +00:00
|
|
|
.IP "\(bu " 4
|
1999-09-27 18:44:28 +00:00
|
|
|
\f(CW\einput{foo}\fR (or \f(CW\einput{foo.blah}\fR) and \f(CW\einclude{foo}\fR. Plain TeX
|
2010-12-12 19:39:21 +00:00
|
|
|
\f(CW\einput\fR command \*[lq]\f(CW\einput foo.tex\fR\*[rq] is also supported.
|
2009-03-19 22:31:22 +00:00
|
|
|
.IP "\(bu" 4
|
1999-09-27 18:44:28 +00:00
|
|
|
tabular environment, and commands that go inside it like \f(CW\ehline\fR, \f(CW\ecline\fR,
|
|
|
|
and \f(CW\emulticolumn\fR (but see below)
|
2009-03-19 22:31:22 +00:00
|
|
|
.IP "\(bu" 4
|
1999-09-27 18:44:28 +00:00
|
|
|
float environments table and table*, as well as \f(CW\ecaption\fR commands within
|
|
|
|
them
|
2009-03-19 22:31:22 +00:00
|
|
|
.IP "\(bu" 4
|
1999-09-27 18:44:28 +00:00
|
|
|
float environments figure and figure*, as well as graphics inclusion commands
|
|
|
|
\eepsf, \eepsffile, \eepsfbox, \eepsfxsize, \eepsfig, \epsfig, and \eincludegraphics.
|
|
|
|
Both the graphics and graphicx forms of \eincludegraphics are supported.
|
2009-03-19 22:31:22 +00:00
|
|
|
.IP "\(bu" 4
|
1999-09-27 18:44:28 +00:00
|
|
|
thebibliography environment and \f(CW\ebibitem\fR command, as well as BibTeX's
|
|
|
|
\f(CW\ebibliography\fR and \f(CW\ebibliographystyle\fR commands
|
2009-03-19 22:31:22 +00:00
|
|
|
.IP "\(bu" 4
|
1999-09-27 18:44:28 +00:00
|
|
|
miscellaneous commands: \f(CW\ehfill\fR, \f(CW\e\fR\f(CW\e\fR, \f(CW\enoindent\fR, \f(CW\eldots\fR...
|
2009-03-19 22:31:22 +00:00
|
|
|
.IP "\(bu" 4
|
2004-10-28 14:35:53 +00:00
|
|
|
documentclass-specific environments (and some commands) which can be
|
1999-09-27 18:44:28 +00:00
|
|
|
translated to LyX layouts
|
2009-03-19 22:31:22 +00:00
|
|
|
.IP "\(bu" 4
|
1999-09-27 18:44:28 +00:00
|
|
|
arguments to certain untranslatable commands (e.g. \f(CW\embox\fR)
|
|
|
|
.PP
|
|
|
|
Some of this support may not be 100% yet. See below for details
|
|
|
|
.PP
|
2005-07-16 15:18:14 +00:00
|
|
|
\fBtex2lyx\fR copies math (almost) verbatim from your LaTeX file. Luckily, LyX reads
|
1999-09-27 18:44:28 +00:00
|
|
|
in LaTeX math, so (almost) any math which is supported by LyX should work just
|
2008-07-28 07:52:27 +00:00
|
|
|
fine.
|
1999-09-27 18:44:28 +00:00
|
|
|
.PP
|
2008-07-28 07:52:27 +00:00
|
|
|
\fBtex2lyx\fR will copy any preamble commands (i.e., anything before
|
|
|
|
\f(CW\ebegin{document}\fR) verbatim. Fancy stuff you've got in your preamble
|
|
|
|
should thus be conserved in printed documents, although it will not of
|
|
|
|
course show up in the LyX window. Check Document->Settings->LaTeX Preamble to see the result.
|
2009-03-19 22:31:22 +00:00
|
|
|
.SS "What tex2lyx Can't Handle --- But it's \s-1OK\s0"
|
|
|
|
.IP "\(bu" 4
|
2008-07-28 07:52:27 +00:00
|
|
|
some spacing commands (\f(CW\ehspace\fR, \f(CW\epagebreak\fR and \f(CW\elinebreak\fR)
|
2009-03-19 22:31:22 +00:00
|
|
|
.IP "\(bu" 4
|
1999-09-27 18:44:28 +00:00
|
|
|
\f(CW\ecentering\fR, \f(CW\eraggedleft\fR, \f(CW\eraggedright\fR
|
2009-03-19 22:31:22 +00:00
|
|
|
.IP "\(bu" 4
|
2005-07-16 15:18:14 +00:00
|
|
|
\f(CW\everb\fR and verbatim environment. \fBtex2lyx\fR is careful to copy \fIexactly\fR in
|
1999-09-27 18:44:28 +00:00
|
|
|
this case, including comments and whitespace.
|
2009-03-19 22:31:22 +00:00
|
|
|
.IP "\(bu" 4
|
2008-07-28 07:52:27 +00:00
|
|
|
unknown (e.g., user-defined) environments and commands
|
1999-09-27 18:44:28 +00:00
|
|
|
.PP
|
2005-07-16 15:18:14 +00:00
|
|
|
\fBtex2lyx\fR copies unknown commands, along with their arguments, verbatim into the
|
1999-09-27 18:44:28 +00:00
|
|
|
LyX file. Also, if it sees a \f(CW\ebegin{foo}\fR where it doesn't recognize the
|
2010-12-12 19:39:21 +00:00
|
|
|
\*[lq]foo\*[rq] environment, it will copy verbatim until it sees \f(CW\eend{foo}\fR (unless
|
2008-07-28 07:52:27 +00:00
|
|
|
you use the \fB\-r\fR option). Most of these unknown commands
|
2005-07-16 15:18:14 +00:00
|
|
|
won't cause \fBtex2lyx\fR to break; they'll merely require you to do some editing
|
1999-09-27 18:44:28 +00:00
|
|
|
once you've loaded the file up in LyX. That should be less painful than
|
|
|
|
editing either the .tex or the .lyx file using a text editor.
|
2009-03-19 22:31:22 +00:00
|
|
|
.SS "What tex2lyx Handles Badly --- aka \s-1BUGS\s0"
|
2005-07-16 15:18:14 +00:00
|
|
|
Since \fBtex2lyx\fR is relatively new, it's got a number of problems. As it
|
1999-09-27 18:44:28 +00:00
|
|
|
matures, these bugs will be squished.
|
2009-03-19 22:31:22 +00:00
|
|
|
.IP "\(bu" 4
|
2010-12-12 19:39:21 +00:00
|
|
|
\*[lq]Exact\*[rq] copying of unknown environments and commands isn't quite exact.
|
2017-07-03 18:46:27 +00:00
|
|
|
This will yield ugly LyX, but in almost all cases the output will be the same.
|
|
|
|
However, most parts of the file will be copied perfectly, including whitespace
|
2008-07-28 07:52:27 +00:00
|
|
|
and comments. This includes: the LaTeX preamble, verbatim environments as well as
|
|
|
|
\f(CW\everb\fR commands, and skip blocks.
|
2009-03-19 22:31:22 +00:00
|
|
|
.IP "\(bu" 4
|
2008-07-28 07:52:27 +00:00
|
|
|
\fBtex2lyx\fR translates only a subset of the document class options to native features.
|
2010-12-12 19:39:21 +00:00
|
|
|
Other options are placed in the \*[lq]options\*[rq] field in the Document->Settings popup.
|
2009-03-19 22:31:22 +00:00
|
|
|
.IP ""
|
2008-07-28 07:52:27 +00:00
|
|
|
More importantly, \fBtex2lyx\fR doesn't translate \f(CW\enewcommands\fR, unknown
|
|
|
|
\f(CW\eusepackage\fR commands and other unknown code in the preamble. It
|
|
|
|
simply copies that into the LaTeX preamble. If you use special commands, e.g. to
|
|
|
|
specify the text layout in a way that that is not understood by LyX, tex2lyx won't
|
2017-07-03 18:46:27 +00:00
|
|
|
recognize it. Note that these settings will be overwritten if you modify the text
|
|
|
|
layout in LyX's document settings. Better remove these special options from the LaTeX
|
|
|
|
preamble (Document->Settings->LaTeX Preamble) and use the corresponding LyX document
|
2008-07-28 07:52:27 +00:00
|
|
|
settings, if possible.
|
2009-03-19 22:31:22 +00:00
|
|
|
.IP "\(bu" 4
|
2008-07-28 07:52:27 +00:00
|
|
|
The foil document class has a couple of bugs. \fBtex2lyx\fR may do weird things with optional
|
1999-09-27 18:44:28 +00:00
|
|
|
arguments to \f(CW\efoilhead\fR commands. Also, it may handle \f(CW\ebegin{dinglist}\fR
|
|
|
|
incorrectly (although the stuff in the environment should translate normally).
|
|
|
|
.PP
|
2010-12-31 11:57:25 +00:00
|
|
|
All known bugs of \fBtex2lyx\fR can be found on \fI\s-1http://www.lyx.org/trac/wiki/BugTrackerHome\s0\fR.
|
1999-09-27 18:44:28 +00:00
|
|
|
.PP
|
2008-07-28 07:52:27 +00:00
|
|
|
\fBtex2lyx\fR is rather robust. As mentioned above, it may not translate
|
|
|
|
your file perfectly, but the result should be usable and it shouldn't crash. If you encounter
|
2017-07-03 18:46:27 +00:00
|
|
|
problems---and the problem is not one of those mentioned above or on
|
|
|
|
\fI\s-1http://www.lyx.org/trac/wiki/BugTrackerHome\s0\fR---please report the issue as described in the section
|
2008-07-28 07:52:27 +00:00
|
|
|
on \fIBug Reports\fR.
|
2009-03-19 22:31:22 +00:00
|
|
|
.SS "What LyX Can't Handle"
|
2008-04-20 15:22:17 +00:00
|
|
|
LyX itself is missing a couple of features, such that even if \fBtex2lyx\fR translates
|
1999-09-27 18:44:28 +00:00
|
|
|
things perfectly, LyX may still have trouble reading it. If you really need
|
|
|
|
these features, you can export your final document as LaTeX, and put them
|
|
|
|
back in. See \fI\s-1BUGS\s0\fR for more details on these bugs.
|
2009-03-19 22:31:22 +00:00
|
|
|
.IP "\(bu" 4
|
2008-04-20 15:22:17 +00:00
|
|
|
For a number of commands (such as \f(CW\e\e\fR), LyX does not support the optional argument.
|
2005-07-16 15:18:14 +00:00
|
|
|
\fBtex2lyx\fR will automatically discard the optional arguments with a warning to
|
1999-09-27 18:44:28 +00:00
|
|
|
stdout. LyX also ignores the width argument for the thebibliography
|
|
|
|
environment.
|
2009-03-19 22:31:22 +00:00
|
|
|
.IP "\(bu" 4
|
2010-12-12 19:39:21 +00:00
|
|
|
LyX support for tables isn't perfect. For complicated tables, use a \*[lq]skip\*[rq]
|
1999-09-27 18:44:28 +00:00
|
|
|
block, so that they will be copied in TeX mode.
|
2009-03-19 22:31:22 +00:00
|
|
|
.IP "\(bu" 4
|
2017-07-03 18:46:27 +00:00
|
|
|
LyX allows figures to have sizes in the units known to TeX, such as in, cm, etc. It also
|
|
|
|
translates percentages of \etextwidth, \etextheight, \ecolumnwidth, but no other lengths
|
|
|
|
(e.g. if you wanted to scale a figure to size \etopmargin for some reason). \fBtex2lyx\fR
|
|
|
|
will copy figures with untranslatable sizes in TeX mode. Again, you might be able to fix
|
2008-07-28 07:52:27 +00:00
|
|
|
that within LyX.
|
1999-09-27 18:44:28 +00:00
|
|
|
.SH "EXAMPLES"
|
2010-12-12 19:39:21 +00:00
|
|
|
tex2lyx \fB\-f\fR \fB\-r\fR \*[lq]myenv\*[rq] foo.tex
|
1999-09-27 18:44:28 +00:00
|
|
|
.PP
|
2008-04-20 15:22:17 +00:00
|
|
|
The above will create a file foo.lyx from foo.tex, overwriting if
|
1999-09-27 18:44:28 +00:00
|
|
|
necessary. When it finds a \f(CW\ebegin{myenv} ... \eend{myenv}\fR block, it will
|
|
|
|
translate the stuff within the block, but copy the \f(CW\ebegin\fR and \f(CW\eend\fR
|
2009-03-19 22:31:22 +00:00
|
|
|
commands in TeX mode.
|
1999-09-27 18:44:28 +00:00
|
|
|
.PP
|
2010-12-12 19:39:21 +00:00
|
|
|
tex2lyx \fB\-n\fR \fB\-c\fR \*[lq]literate-article\*[rq] foo.tex
|
1999-09-27 18:44:28 +00:00
|
|
|
.PP
|
|
|
|
The above will change a noweb document into a LyX literate-article
|
|
|
|
document. A user would do this if the noweb document had documentclass
|
|
|
|
article.
|
|
|
|
.SH "NOTES"
|
2009-03-19 22:31:22 +00:00
|
|
|
.SS "Bug Reports"
|
2010-12-31 11:57:25 +00:00
|
|
|
Bugs should be reported to the LyX bug tracker at http://www.lyx.org/trac/wiki/BugTrackerHome. Additionally,
|
2010-12-12 19:39:21 +00:00
|
|
|
you can post a message to the LyX developers' mailing list. Its address is currently
|
2017-07-03 18:46:27 +00:00
|
|
|
lyx-devel@lists.lyx.org. If your message bounces, you can check the LyX home page,
|
|
|
|
http://www.lyx.org/. If you are running \fBtex2lyx\fR on a huge file, please do not send all of the output in
|
|
|
|
your bug report. Just include the last ten or twenty lines of output, along with
|
|
|
|
the piece of the LaTeX file it crashed on. Or, even better, attach a small but
|
2008-04-20 15:22:17 +00:00
|
|
|
complete file which causes the same problem as your original file.
|
2009-03-19 22:31:22 +00:00
|
|
|
.SS "Layout Files"
|
2005-07-16 15:18:14 +00:00
|
|
|
\fBtex2lyx\fR reads a LyX layout file to know how to handle LaTeX environments and
|
1999-09-27 18:44:28 +00:00
|
|
|
commands which get translated to LyX layouts. This file will include all
|
2010-12-12 19:39:21 +00:00
|
|
|
\*[lq]normal\*[rq] non-math environments (i.e., including quote and itemize, but not
|
1999-09-27 18:44:28 +00:00
|
|
|
tabular, minipage, and some other fancy environments), and commands like
|
2005-07-16 15:18:14 +00:00
|
|
|
\f(CW\esection\fR and \f(CW\etitle\fR. If you want to tex2lyx a class that doesn't have an
|
1999-09-27 18:44:28 +00:00
|
|
|
existing layout file, then you'll have to create a layout file. But you have
|
|
|
|
to do this anyway, in order to LyX the file, since LyX depends on layout files
|
|
|
|
to know how to display and process its files. Check the LyX documentation for
|
|
|
|
help with this task (which can be hard or easy, depending on the class you
|
|
|
|
want to create a layout file for.) If your class is quite similar to a class
|
|
|
|
that has a layout file, then consider using the \fB\-c\fR option.
|
2009-03-19 22:31:22 +00:00
|
|
|
.SS "Syntax Files"
|
2005-07-16 15:18:14 +00:00
|
|
|
\fBtex2lyx\fR always reads at least one syntax file, called the default syntax file.
|
|
|
|
\fBtex2lyx\fR will read your personal syntax file if it exists; otherwise it will
|
|
|
|
read the system-wide file. \fBtex2lyx\fR will read additional syntax files if you
|
1999-09-27 18:44:28 +00:00
|
|
|
specify them with the \fB\-s\fR option. (These extra files should have the same
|
|
|
|
format as the default file, but will tend to be shorter, since they only have
|
|
|
|
to specify extra commands not found in the default file.) A syntax file tells
|
2005-07-16 15:18:14 +00:00
|
|
|
\fBtex2lyx\fR a few things.
|
1999-09-27 18:44:28 +00:00
|
|
|
.PP
|
|
|
|
First, it describes the syntax of each command, that is, how many required
|
|
|
|
arguments and how many optional arguments the command takes. Knowing this
|
2005-07-16 15:18:14 +00:00
|
|
|
makes it easier for \fBtex2lyx\fR to copy (in TeX mode) commands that it doesn't
|
1999-09-27 18:44:28 +00:00
|
|
|
know how to translate. The syntax file simply has a command, followed by
|
|
|
|
braces or brackets describing its arguments in the correct order. For example,
|
|
|
|
a syntax file entry \f(CW\ebibitem[]{}\fR means that the \f(CW\ebibitem\fR command takes
|
|
|
|
an optional argument followed by a required one, while the entry \f(CW\ebf\fR
|
2005-07-16 15:18:14 +00:00
|
|
|
means that the \f(CW\ebf\fR command takes no arguments at all. When \fBtex2lyx\fR
|
1999-09-27 18:44:28 +00:00
|
|
|
encounters a token that it doesn't know how to translate into LyX, it will
|
|
|
|
copy the token---along with the correct number of arguments---exactly. If the
|
2005-07-16 15:18:14 +00:00
|
|
|
token is not in the syntax file, then \fBtex2lyx\fR just copies as many arguments
|
1999-09-27 18:44:28 +00:00
|
|
|
as it finds. This means that it may copy too much. But since the user can
|
|
|
|
specify additional syntax files, that shouldn't happen often.
|
|
|
|
.PP
|
|
|
|
Some commands that cannot be translated to LyX, like \f(CW\embox\fR, have as one of
|
2010-12-12 19:39:21 +00:00
|
|
|
their arguments regular LaTeX text. If the string \*[lq]translate\*[rq] is put into an
|
2005-07-16 15:18:14 +00:00
|
|
|
argument of an (untranslatable) command in the syntax file, then \fBtex2lyx\fR will
|
1999-09-27 18:44:28 +00:00
|
|
|
translate that argument instead of copying it verbatim. So, for example, the
|
|
|
|
default syntax file has \f(CW\eraisebox{}[][]{translate}\fR. This means that the
|
|
|
|
\f(CW\eraisebox\fR command and the first argument (and optional arguments if they
|
|
|
|
exist) are copied in TeX mode, but the last argument (which may contain math,
|
|
|
|
complicated LaTeX, other untranslatable commands, etc.) will be translated
|
2010-12-12 19:39:21 +00:00
|
|
|
into LyX. You can't use \*[lq]translate\*[rq] on optional arguments.
|
1999-09-27 18:44:28 +00:00
|
|
|
.PP
|
|
|
|
User-defined syntax files are allowed to define new commands and
|
|
|
|
their syntax, or override the number of arguments for a command given in the
|
|
|
|
default syntax file. (E.g., if you're using a style that gives an extra
|
|
|
|
argument to some command...) However, this will only be useful for commands
|
2005-07-16 15:18:14 +00:00
|
|
|
copied in TeX mode. Commands which are actually translated by \fBtex2lyx\fR (like
|
1999-09-27 18:44:28 +00:00
|
|
|
\f(CW\eitem\fR) have their argument syntax hard-coded. The hard-coded commands are
|
|
|
|
identified in the default syntax file.
|
|
|
|
.PP
|
2010-12-12 19:39:21 +00:00
|
|
|
Second, the syntax file describes any \*[lq]regular environments\*[rq]. Usually, an
|
1999-09-27 18:44:28 +00:00
|
|
|
entire unknown environment will be copied in TeX mode. If you define a regular
|
2010-12-12 19:39:21 +00:00
|
|
|
environment \*[lq]foo\*[rq], though, then only the \f(CW\ebegin{foo}\fR and \f(CW\eend{foo}\fR
|
1999-09-27 18:44:28 +00:00
|
|
|
commands will be copied in TeX mode; the text within the environment will be
|
2005-07-16 15:18:14 +00:00
|
|
|
treated (i.e., translated) by \fBtex2lyx\fR as regular LaTeX, rather than being
|
2010-12-12 19:39:21 +00:00
|
|
|
copied into TeX mode. Don't try to declare \*[lq]tabbing\*[rq] and \*[lq]picture\*[rq] as regular
|
2005-07-16 15:18:14 +00:00
|
|
|
environments, as the text within those environments will confuse \fBtex2lyx\fR; use
|
1999-09-27 18:44:28 +00:00
|
|
|
this capability for new environments you create that have plain text or math
|
|
|
|
or simple commands in them. You also can't declare unknown math environments
|
|
|
|
(like equation*) as regular environments, either, since the LyX math editor
|
|
|
|
won't understand them. The names of regular environments appear,
|
2005-07-16 15:18:14 +00:00
|
|
|
whitespace-separated, between \f(CW\ebegin{tex2lyxre}\fR and \f(CW\eend{tex2lyxre}\fR
|
1999-09-27 18:44:28 +00:00
|
|
|
statements in the syntax file. (If you have a regular environment which you
|
|
|
|
won't use very often, you can use the \fB\-r\fR option rather than writing a
|
|
|
|
syntax file.)
|
|
|
|
.SH "WARNINGS"
|
|
|
|
Always keep a copy of your original LaTeX files either under a different
|
|
|
|
name or in a different directory. There are a couple ways in which using LyX
|
|
|
|
could lead to overwriting the original LaTeX file.
|
|
|
|
.PP
|
|
|
|
If you import foo.tex to create foo.lyx, then edit foo.lyx and want to
|
|
|
|
re-export it, note that it will overwrite the original foo.tex. (LyX will ask
|
|
|
|
you if you want to overwrite it.)
|
2009-03-19 22:31:22 +00:00
|
|
|
.SH ENVIRONMENT
|
|
|
|
.TP 6
|
|
|
|
.B @LYX_DIR_VER@
|
|
|
|
can be used to specify which system directory to use.
|
1999-09-27 18:44:28 +00:00
|
|
|
.PP
|
2009-03-19 22:31:22 +00:00
|
|
|
The system directory is determined by searching for the file
|
|
|
|
"chkconfig.ltx". Directories are searched in this order:
|
|
|
|
.br
|
|
|
|
1) \-sysdir command line parameter
|
|
|
|
.br
|
|
|
|
2) @LYX_DIR_VER@ environment variable
|
|
|
|
.br
|
|
|
|
3) Maybe <path of binary>/TOP_SRCDIR/lib
|
|
|
|
.br
|
|
|
|
4) <path of binary>/../share/<name of binary>/
|
|
|
|
.br
|
|
|
|
5) hardcoded lyx_dir (at build time: @real_pkgdatadir@)
|
|
|
|
.TP
|
|
|
|
.B @LYX_USERDIR_VER@
|
|
|
|
can be used to specify which user directory to use.
|
|
|
|
.PP
|
|
|
|
The user directory is, in order of precedence:
|
|
|
|
.br
|
|
|
|
1) \-userdir command line parameter
|
|
|
|
.br
|
|
|
|
2) @LYX_USERDIR_VER@ environment variable
|
|
|
|
.br
|
|
|
|
3) $HOME/.<name of binary> if no explicit setting is made
|
1999-09-27 18:44:28 +00:00
|
|
|
.SH "FILES"
|
2009-03-19 22:31:22 +00:00
|
|
|
.PP
|
|
|
|
If \fI\s-1LIBDIR\s0\fR is the system-wide LyX directory and
|
2017-07-03 18:46:27 +00:00
|
|
|
\fI\s-1MY_LYXDIR\s0\fR
|
2009-03-19 22:31:22 +00:00
|
|
|
is your personal LyX directory, then the following files are read by tex2lyx:
|
|
|
|
.IP "\fI\s-1MY_LYXDIR\s0\fR/layouts/*.layout" 4
|
1999-09-27 18:44:28 +00:00
|
|
|
User's personal layout files for document classes
|
2009-03-19 22:31:22 +00:00
|
|
|
.IP "\fI\s-1MY_LYXDIR\s0\fR/syntax.default" 4
|
1999-09-27 18:44:28 +00:00
|
|
|
User's personal syntax file
|
2013-11-11 20:52:14 +00:00
|
|
|
.IP "\fI\s-1MY_LYXDIR\s0\fR/encodings" 4
|
|
|
|
User's personal encoding definition file
|
2009-03-19 22:31:22 +00:00
|
|
|
.IP "\fI\s-1LIBDIR\s0\fR/layouts/*.layout" 4
|
1999-09-27 18:44:28 +00:00
|
|
|
System-wide layout files for document classes
|
2009-03-19 22:31:22 +00:00
|
|
|
.IP "\fI\s-1LIBDIR\s0\fR/lib/syntax.default" 4
|
1999-09-27 18:44:28 +00:00
|
|
|
System-wide LaTeX syntax file
|
2013-11-11 20:52:14 +00:00
|
|
|
.IP "\fI\s-1LIBDIR\s0\fR/lib/encodings" 4
|
|
|
|
System-wide encoding definition file
|
1999-09-27 18:44:28 +00:00
|
|
|
.SH "SEE ALSO"
|
2009-03-19 22:31:22 +00:00
|
|
|
\fIlyx@version_suffix@\fR\|(1), \fIlatex\fR\|(1)
|
1999-09-27 18:44:28 +00:00
|
|
|
.SH "AUTHORS"
|
2008-04-20 15:22:17 +00:00
|
|
|
tex2lyx is Copyright (c) 2003ff. by the LyX Team (lyx-devel@lists.lyx.org)
|