On Thu, Sep 07, 2000 at 12:26:45PM +0100, Jose Abilio Oliveira Matos wrote:
> On Wed, Sep 06, 2000 at 12:45:29AM +0300, Dekel Tsur wrote:
> > On Tue, Sep 05, 2000 at 04:27:54PM +0100, Jose Abilio Oliveira Matos wrote:
> > >   Also is it possible to have different viewers for docbook and linuxdoc.
> > > Example: most of the times the lyx file, when converted from docbook (or
> > > linuxdoc) to html generates a directory.
> > > 
> > I was aware of the problem, and I will fix it soon (I'm thinking of adding a
> > converter flag which tells that the output of the converter is put in a
> > directory).
> 
>   That will be very usefull, for latex to html also.

Here is a patch that solves this problem (and others).
A \\converter line in lyxrc has 4 parameters from, to ,flags
where flags is a list of comma separated flags.
Known flags are
- originaldir : The converter must be invoked in the directory of the lyx
  file and not in the temporary directory. This is needed for tex->html
  converters in order to be able to read the eps files.
- needaux : The converted uses the .aux file, so we need to call latex
  before running the converter.
- resultdir=dir : The converter put all the files in dir.
  Using "resultdir" is same as "resultdir=$$Basename".
  Note: When exporting, the whole directory will be moved from the temporary
  directory to the target directory.
- resultfile=file : Name of main file in the result directory, for example 
 "index.html" or "$$BaseName.html"
  If "resultfile" is omitted, the name of this file is assumed to be
  "index.format"

Examples:
(1) \converter tex html "latex2html -no_subdir -split 0 $$FName" 
                        "originaldir,needaux"
(2) \converter tex html "latex2html -split 0 $$FName"
                        "originaldir,needaux,resultdir"
(3) \converter tex html "latex2html -dir $$BaseName_html $$FName"
                        "originaldir,needaux,resultdir=$$BaseName_html"

Suppose we convert the file foo.tex to html
In (1), we will call "netscape TMPDIR/foo.html" to view the file,
and when exporting we will move "TMPDIR/foo.html" to "ORIGDIR/foo.html"
In (2) we will call "netscape TMPDIR/foo/index.html" to view the file,
and when exporting we will move "TMPDIR/foo" to "ORIGDIR/foo"
In (2) we will call "netscape TMPDIR/foo_html/index.html" to view the file,
and when exporting we will move "TMPDIR/foo_html" to "ORIGDIR/foo_html"

PS: There is a problem with the export code when TMPDIR and ORIGDIR are not on
same file system. How can this be tested?

patch.gz

Reply via email to