In many cases, I have found I need access to the TeX version of my LyX
documents for inclusion in e-mail (using latex2html) and other purposes,
so I have modified my version of LyX 1.04 to write a *.tex file every
time it writes the *.lyx file.  (Patch attached.)

I know I can export it using the menu, but it is a pain to remember to
do that every time I modify the file.  With the *.tex output, I can
auto-generate any format I need -- HTML, pdf, ASCII text, etc.

This is probably not something that should be done by default, but I am
posting this because it may be a useful patch for some other people.

I know there is some program that talks to LyX via pipes, and there is a
lyxexport script in that package, but it didn't work for me and seems
kind of a kludge.  Maybe there should be a way from the command line to
dump a LyX file out in TeX format?

---------------------------------------------------------------------------

*** ./lyx-1.0.4/src/lyx_cb.C.orig       Fri Dec  3 18:59:41 1999
--- ./lyx-1.0.4/src/lyx_cb.C    Sat Dec  4 00:24:46 1999
***************
*** 194,199 ****
--- 194,200 ----
  void MenuWriteAs(Buffer *buffer);
  void MenuReload(Buffer *buf);
  void MenuLayoutSave();
+ void MenuMakeLaTeX(Buffer *buffer);
  
  unsigned char GetCurrentTextClass()
        // Who are we asking?
***************
*** 351,356 ****
--- 352,358 ----
                }
        } else {
                lastfiles->newFile(buf->getFileName());
+               MenuMakeLaTeX(buf);
        }
  }
  
***************
*** 848,853 ****
--- 850,856 ----
                                                ".tex", false));
  
                FilePtr myfile(s, FilePtr::read);
+ #if 0
                if (myfile() &&
                    !AskQuestion(_("File already exists:"), 
                                MakeDisplayPath(s,50),
***************
*** 855,860 ****
--- 858,864 ----
                        minibuffer->Set(_("Canceled"));
                        return;
                }
+ #endif
  
                if (buffer->isDocBook())
                        minibuffer->Set(_("DocBook does not have a latex backend"));

-- 
  Bruce Momjian                        |  http://www.op.net/~candle
  [EMAIL PROTECTED]                |  (610) 853-3000
  +  If your life is a hard drive,     |  830 Blythe Avenue
  +  Christ can be your backup.        |  Drexel Hill, Pennsylvania 19026

Reply via email to