]> git.lyx.org Git - lyx.git/blobdiff - src/tex2lyx/tex2lyx.1in
Reduce caption hardcoding
[lyx.git] / src / tex2lyx / tex2lyx.1in
index 87683247f0aac308691e1844be9de4067cf2892d..3f219622a4602647970234d73f6d803d18d5b2e8 100644 (file)
@@ -20,52 +20,59 @@ call it from the command line only if you need to use more complicated
 options.
 .PP
 \fBtex2lyx\fR [ \fB\-userdir\fR \fIuserdir\fR ] [ \fB\-systemdir\fR \fIsystemdir\fR ]
-[\fB\-n\fR] [\ \fB\-r\fR\ \fIrenv1\fR[,\fIrenv2\fR...]] [\ \fB\-s\fR\ \fIsfile1\fR[,\fIsfile2\fR...]]
-\fIinputfile\fR  [ \fB\-c\fR \fItextclass\fR ] 
-.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
-.PP
-\fBtex2lyx\fR \fB\-help\fR
+[ \fB\-f\fR ] [ \fB\-n\fR ] [ \fB\-c\fR \fItextclass\fR ]
+[ \fB\-e\fR \fIencoding\fR ]
+[ \fB\-fixedenc\fR \fIencoding\fR ]
+[\ \fB\-m\fR \fImodule1\fR[,\fImodule2\fR...]]
+[\ \fB\-s\fR\ \fIsfile1\fR[,\fIsfile2\fR...]] [ \fB\-skipchildren\fR ] [
+\fB\-roundtrip\fR ] [ \fB\-copyfiles\fR ] \fIinputfile\fR [ \fIoutputfile\fR ]
+.\" .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
 .SH "OPTIONS"
 .TP
 .BI \-c
 Class. By default, when \fBtex2lyx\fR sees a \f(CW\edocumentclass{foo}\fR command, it
-creates a file of textclass \*(L"foo\*(R" and reads the LyX layout file for that class
+creates a file of textclass \*[lq]foo\*[rq] and reads the LyX layout file for that class
 (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).
+.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.
+.TP
+.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
 .BI \-f
 Force. \fBtex2lyx\fR will not run if the .lyx file it would generate already exists.
 Use the \fB\-f\fR option (carefully) to clobber any existing files.
 .TP
-.BI \-help
-Help. Print out usage information and quit.
+.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
 .BI \-n
 Noweb. Translate a noweb (aka literate programming) file. This should be
-(almost?) equivalent to running \*(L"noweb2lyx foo.tex foo.lyx\*(R". This option
+(almost?) equivalent to running \*[lq]noweb2lyx foo.tex foo.lyx\*[rq]. This option
 requires the \fB\-c\fR option.
 .TP
-.BI \-p
-Partial file. The input files are LaTeX fragments, with no preamble matter or
-\f(CW\ebegin{document}\fR commands. This option requires the \fB\-c\fR option, since there
-are no \f(CW\edocumentclass\fR commands in the files \fBtex2lyx\fR is translating. When
-using this option, you can translate more than one file, as long as all files
-are the same class. The LyX file created by \fBtex2lyx\fR can be included in an
-existing LyX file using the \*(L"Include LyX File\*(R" command from
-LyX's Insert menu. (\fBNOTE\fR: this feature of the older \fBreLyX\fR script has
-not yet been implemented in \fBtex2lyx\fR).
-.TP
-.BI \-r
-Regular environments (see the section on \fISyntax Files\fR).  If you give more than one
-environment, separate them with commas (not spaces). You'll probably need to
-quote the environment list, especially if it has asterisk environments (foo*)
-in it. If you use this command often, considering creating a personal syntax
-file. (\fBNOTE\fR: this feature of the older \fBreLyX\fR script has
-not yet been implemented in \fBtex2lyx\fR).
+.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.
 .TP
 .BI \-s
 Syntax files. Input (one or more quoted, comma-separated) syntax files to read
@@ -78,9 +85,32 @@ chosen. Cf. the section \f(CWFILES\fR for details.
 .BI \-userdir
 Specify a user directory. Normally, you shouldn't need this. Your LyX user directory is
 chosen. Cf. the section \f(CWFILES\fR for details.
+.TP
+.BI \-roundtrip
+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
+named \fIfoo.lyx.lyx\fR, and the re-exported file will be named
+\fIfoo.lyx.tex\fR.
+.TP
+.BI \-copyfiles
+Copy all included files \fBtex2lyx\fR is
+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
+.BI \-help
+Help. Print out usage information and quit.
+.TP
+.BI \-version
+Print out the version number and build information and quit.
 .SH "DESCRIPTION"
 .SS "Introduction"
-\fBtex2lyx\fR will create a LyX file \fIdir/foo.lyx\fR from the LaTeX file
+\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
 \fIdir/foo.tex\fR.
 .PP
 Suffixes .tex, .ltx and .latex are supported. If \fIinputfile\fR
@@ -108,10 +138,10 @@ document into LyX.
 Run \fBtex2lyx\fR.
 .IP ""
 \fBtex2lyx\fR will inform you of its progress and give any warnings to stderr, so if
-you don't want any output at all, try (in csh) \*(L'tex2lyx foo.tex >& /dev/null\*(R'.
+you don't want any output at all, try (in csh) `tex2lyx foo.tex >& /dev/null'.
 You should \s-1NOT\s0 redirect standard output to \fIfoo.lyx\fR.
 .IP "\(bu" 4
-Run LyX (version 1.4 or later) on the resulting .lyx file.
+Run LyX (version 2.1 or later) on the resulting .lyx file.
 .IP ""
 In theory, most of the file will have been translated, and anything that's
 untranslatable will be transferred to TeX code (ERT in LyX-speak). In theory, LyX will be
@@ -135,14 +165,14 @@ even though this leads to more TeX code and less \s-1WYSIWYM\s0.
 .IP ""
 I'm sure you were planning on doing this anyway, but it's particularly
 important after translating a LaTeX document. \fBtex2lyx\fR is better
-at \*(L"macro-translating\*(R" (translating the whole document) than
-\*(L"micro-translating\*(R" (translating every little detail). For example, you may see
+at \*[lq]macro-translating\*[rq] (translating the whole document) than
+\*[lq]micro-translating\*[rq] (translating every little detail). For example, you may see
 extra spaces or deleted spaces. Space handling has improved, but it's
 not perfect.
 .SS "What tex2lyx Can Handle"
 \fBtex2lyx\fR understands many LaTeX commands. It will translate:
 .IP "\(bu" 4
-regular text, including mini-commands like ~, \*(L'\*(R', \f(CW\e@\fR, \f(CW\eTeX\fR, as well as
+regular text, including mini-commands like ~, `', \f(CW\e@\fR, \f(CW\eTeX\fR, as well as
 accented characters like \f(CW\e'{a}\fR, and the special cases ?` and !`
 .IP "\(bu" 4
 title commands like \f(CW\eauthor\fR, \f(CW\edate\fR, \f(CW\etitle\fR, \f(CW\ethanks\fR and the
@@ -163,7 +193,7 @@ font-changing commands including \f(CW\eem\fR, \f(CW\eemph\fR, \f(CW\etextit\fR,
 corresponding commands to change family, size, series, and shape
 .IP "\(bu " 4
 \f(CW\einput{foo}\fR (or \f(CW\einput{foo.blah}\fR) and \f(CW\einclude{foo}\fR. Plain TeX
-\f(CW\einput\fR command \*(L"\f(CW\einput foo.tex\fR\*(R" is also supported.
+\f(CW\einput\fR command \*[lq]\f(CW\einput foo.tex\fR\*[rq] is also supported.
 .IP "\(bu" 4
 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)
@@ -197,8 +227,6 @@ 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.
 .SS "What tex2lyx Can't Handle --- But it's \s-1OK\s0"
 .IP "\(bu" 4
-tabular* tables
-.IP "\(bu" 4
 some spacing commands (\f(CW\ehspace\fR, \f(CW\epagebreak\fR and \f(CW\elinebreak\fR)
 .IP "\(bu" 4
 \f(CW\ecentering\fR, \f(CW\eraggedleft\fR, \f(CW\eraggedright\fR
@@ -210,7 +238,7 @@ unknown (e.g., user-defined) environments and commands
 .PP
 \fBtex2lyx\fR copies unknown commands, along with their arguments, verbatim into the
 LyX file. Also, if it sees a \f(CW\ebegin{foo}\fR where it doesn't recognize the
-\*(L"foo\*(R" environment, it will copy verbatim until it sees \f(CW\eend{foo}\fR (unless
+\*[lq]foo\*[rq] environment, it will copy verbatim until it sees \f(CW\eend{foo}\fR (unless
 you use the \fB\-r\fR option). Most of these unknown commands
 won't cause \fBtex2lyx\fR to break; they'll merely require you to do some editing
 once you've loaded the file up in LyX.  That should be less painful than
@@ -219,14 +247,14 @@ editing either the .tex or the .lyx file using a text editor.
 Since \fBtex2lyx\fR is relatively new, it's got a number of problems.  As it
 matures, these bugs will be squished.
 .IP "\(bu" 4
-\*(L"Exact\*(R" copying of unknown environments and commands isn't quite exact.
+\*[lq]Exact\*[rq] copying of unknown environments and commands isn't quite exact.
 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 
 and comments. This includes: the LaTeX preamble, verbatim environments as well as
 \f(CW\everb\fR commands, and skip blocks.
 .IP "\(bu" 4
 \fBtex2lyx\fR translates only a subset of the document class options to native features.
-Other options are placed in the \*(L"options\*(R" field in the Document->Settings popup.
+Other options are placed in the \*[lq]options\*[rq] field in the Document->Settings popup.
 .IP ""
 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
@@ -241,12 +269,12 @@ The foil document class has a couple of bugs. \fBtex2lyx\fR may do weird things
 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
-All known bugs of \fBtex2lyx\fR can be found on \fI\s-1http://bugzilla.lyx.org\s0\fR.
+All known bugs of \fBtex2lyx\fR can be found on \fI\s-1http://www.lyx.org/trac/wiki/BugTrackerHome\s0\fR.
 .PP
 \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
 problems---and the problem is not one of those mentioned above or on 
-\fI\s-1http://bugzilla.lyx.org\s0\fR---please report the issue as described in the section 
+\fI\s-1http://www.lyx.org/trac/wiki/BugTrackerHome\s0\fR---please report the issue as described in the section 
 on \fIBug Reports\fR.
 .SS "What LyX Can't Handle"
 LyX itself is missing a couple of features, such that even if \fBtex2lyx\fR translates
@@ -259,7 +287,7 @@ For a number of commands (such as \f(CW\e\e\fR), LyX does not support the option
 stdout.  LyX also ignores the width argument for the thebibliography
 environment.
 .IP "\(bu" 4
-LyX support for tables isn't perfect. For complicated tables, use a \*(L"skip\*(R"
+LyX support for tables isn't perfect. For complicated tables, use a \*[lq]skip\*[rq]
 block, so that they will be copied in TeX mode.
 .IP "\(bu" 4
 LyX allows figures to have sizes in the units known to TeX, such as in, cm, etc. It also 
@@ -268,22 +296,22 @@ translates percentages of \etextwidth, \etextheight, \ecolumnwidth, but no other
 will copy figures with untranslatable sizes in TeX mode. Again, you might be able to fix 
 that within LyX.
 .SH "EXAMPLES"
-tex2lyx \fB\-f\fR \fB\-r\fR \*(L"myenv\*(R" foo.tex
+tex2lyx \fB\-f\fR \fB\-r\fR \*[lq]myenv\*[rq] foo.tex
 .PP
 The above will create a file foo.lyx from foo.tex, overwriting if
 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
 commands in TeX mode.
 .PP
-tex2lyx \fB\-n\fR \fB\-c\fR \*(L"literate-article\*(R" foo.tex
+tex2lyx \fB\-n\fR \fB\-c\fR \*[lq]literate-article\*[rq] foo.tex
 .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"
 .SS "Bug Reports"
-Bugs should be reported to the LyX bug tracker at http://bugzilla.lyx.org. Additionally,
-you can post a message to the LyX developers\*(R' mailing list. Its address is currently
+Bugs should be reported to the LyX bug tracker at http://www.lyx.org/trac/wiki/BugTrackerHome. Additionally,
+you can post a message to the LyX developers' mailing list. Its address is currently
 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 
@@ -292,7 +320,7 @@ complete file which causes the same problem as your original file.
 .SS "Layout Files"
 \fBtex2lyx\fR reads a LyX layout file to know how to handle LaTeX environments and
 commands which get translated to LyX layouts. This file will include all
-\*(L"normal\*(R" non-math environments (i.e., including quote and itemize, but not
+\*[lq]normal\*[rq] non-math environments (i.e., including quote and itemize, but not
 tabular, minipage, and some other fancy environments), and commands like
 \f(CW\esection\fR and \f(CW\etitle\fR. If you want to tex2lyx a class that doesn't have an
 existing layout file, then you'll have to create a layout file. But you have
@@ -325,14 +353,14 @@ 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
-their arguments regular LaTeX text. If the string \*(L"translate\*(R" is put into an
+their arguments regular LaTeX text. If the string \*[lq]translate\*[rq] is put into an
 argument of an (untranslatable) command in the syntax file, then \fBtex2lyx\fR will
 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
-into LyX. You can't use \*(L"translate\*(R" on optional arguments.
+into LyX. You can't use \*[lq]translate\*[rq] on optional arguments.
 .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
@@ -342,12 +370,12 @@ copied in TeX mode. Commands which are actually translated by \fBtex2lyx\fR (lik
 \f(CW\eitem\fR) have their argument syntax hard-coded. The hard-coded commands are
 identified in the default syntax file.
 .PP
-Second, the syntax file describes any \*(L"regular environments\*(R".  Usually, an
+Second, the syntax file describes any \*[lq]regular environments\*[rq].  Usually, an
 entire unknown environment will be copied in TeX mode. If you define a regular
-environment \*(L"foo\*(R", though, then only the \f(CW\ebegin{foo}\fR and \f(CW\eend{foo}\fR
+environment \*[lq]foo\*[rq], though, then only the \f(CW\ebegin{foo}\fR and \f(CW\eend{foo}\fR
 commands will be copied in TeX mode; the text within the environment will be
 treated (i.e., translated) by \fBtex2lyx\fR as regular LaTeX, rather than being
-copied into TeX mode. Don't try to declare \*(L"tabbing\*(R" and \*(L"picture\*(R" as regular
+copied into TeX mode. Don't try to declare \*[lq]tabbing\*[rq] and \*[lq]picture\*[rq] as regular
 environments, as the text within those environments will confuse \fBtex2lyx\fR; use
 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
@@ -402,10 +430,14 @@ is your personal LyX directory, then the following files are read by tex2lyx:
 User's personal layout files for document classes
 .IP "\fI\s-1MY_LYXDIR\s0\fR/syntax.default" 4
 User's personal syntax file
+.IP "\fI\s-1MY_LYXDIR\s0\fR/encodings" 4
+User's personal encoding definition file
 .IP "\fI\s-1LIBDIR\s0\fR/layouts/*.layout" 4
 System-wide layout files for document classes
 .IP "\fI\s-1LIBDIR\s0\fR/lib/syntax.default" 4
 System-wide LaTeX syntax file
+.IP "\fI\s-1LIBDIR\s0\fR/lib/encodings" 4
+System-wide encoding definition file
 .SH "SEE ALSO"
 \fIlyx@version_suffix@\fR\|(1), \fIlatex\fR\|(1)
 .SH "AUTHORS"