Hi,
I am trying to provide a .lyx option for the thesis class I maintain
and have had great difficulty running tex2lyx. Below I provide some
suggestions and outline my experience... Please let me know if you
would like me to file bug reports/enhancement suggestions. (btw, If
tex2lyx was python I would submit a patch but I am not going to dive
into C++ code).
Suggestions:
1) Provide an obvious way to see the error message from the GUI.
2) Provide command options for tex2lyx to use files in the current
directory.
3) When tex2lyx can't find a file, have it say where it was looking
(then I would have known where to put the layout files).
4) Have tex2lyx display the version number (so that when I past the
output you know what version I am working with in case I forgot to
tell you.
5) Have LyX use ~/.lyx if it exists, even on Mac OS X (Like many
users, I try to keep the same configuration files for Linux and
Mac. It is a pain having to put these into different directories
on each platform).
Version 1.6.7 running on Mac OS X 10.5.
----
Here is my experience:
I have the relevant class (ubcthesis.cls) and tex files
(ubcsample.tex) along with a layout files (ubcthesis.layout) in a
directory:
$ ls
genthesis.cls ubcsample.tex ubcthesis.cls
ubcsample.lyx ubcsamplelyx.lyx ubcthesis.layout
and try running tex2lyx:
$ tex2lyx ubcsample.tex -f
Error: Could not find layout file for textclass "ubcthesis".
$ tex2lyx --help
Usage: tex2lyx [options] infile.tex [outfile.lyx]
Options:
-c textclass Declare the textclass.
-e encoding Set the default encoding (latex name).
-f Force overwrite of .lyx files.
-help Print this message and quit.
-n translate a noweb (aka literate programming) file.
-s syntaxfile read additional syntax file.
-sysdir dir Set system directory to DIR.
-userdir DIR Set user directory to DIR.
$ tex2lyx -userdir . ubcsample.tex -f
Ignoring options 'sort&compress' of package natbib.
Error: Could not find layout file for textclass "ubcthesis".
$ tex2lyx -sysdir ... # Fails too.
My friend pointed me to some documentation that said layout files must
be in ~/.lyx/layouts. Does not help.
I can open the ubcsamplelyx.lyx file (given to me by a more LyX
competent friend which uses the ubcthesis.layout) using the lyx GUI so
obviously some part of the program can find the layout file. However,
using the GUI to try to import the tex file gives:
An error occurred whilst running '.../tex2lyx'
-f
No idea what the error is and can't find an option for seeing it.
(Assume it is the same error as above.)
Finally find out that on Mac OS X
~/.lyx == ~/Library/Application\Support/Lyx-1.6/
Hope this helps,
Michael.
P.S. If any LyX experts would like to provide a better LyX setup
(.layout file etc.) I would welcome suggestions:
http://bitbucket.org/mforbes/ubcthesis/
P.P.S. It would also be very helpful to have a way of disabling babel
usage from the .lyx or .layout files because several users have had
problems with a buggy version (not a LyX problem) and it seems that
the only way to do this is with a custom preference setting.