On 2011-12-07, Eric Weir wrote:

> On Dec 6, 2011, at 2:57 PM, Guenter Milde wrote:

>> On 2011-12-06, Richard Heck wrote:

>>> Classes can be difficult or trivial, and if all you need is what you've
>>> said, then it may be pretty trivial. Let's say you're otherwise happy
>>> with the article class. Then the simplest thing to do is copy it over to
>>> ericscls.cls and make the handful of changes you need to have it the way
>>> you want it. Done. 

>> Actually, for small changes you do not even need a different LaTeX class but
>> just a LyX layout (if you can tex2lyx from the command line with
>> "-c myclass" and the -c switch operates as I suppose).

> Thanks, Guenter. That reference to the command line is Greek to me. I
> used the command line a fair bit the year I gave Linux a try, but don't
> use it much now that I'm on a Mac. I imagine what you're suggesting is
> pretty simple, but I'm not clear what I should do or what would be
> accomplished.

I suppose there is an x-terminal-emulator (or "command line app")
also on Mac OS X.

When starting programs from the command line (or an terminal emulation), you
can pass them options. The tex2lyx converter can be used as an independent
program and supports a some configuration options if used so.
Try the command

   tex2lyx --help

for an overview (or just forget about the command line and read on).


For import of existing LaTeX documents, a template document does not
work. Hence, you need some more work to get the result configured in a way
you like. How much depends on the context:

* Maybe there is a LaTeX document class that works out of the box.
  
  You just need to find it, start the LaTeX document with
  \documentclass{<the-nice-class-i-found> and import into lyx.
  
* Maybe a LaTeX document class works with some minor configuration that can
  be done in the document preamble.
  
  You need to find it and read the documentation
  start the LaTeX document with
  \documentclass{<the-nice-class-i-found> and now there is 
  a choice:
    
  a) import and do the configuration to each
     imported document under Document>Settings.
     It might help to put preamble code in a file (mypreamble.tex, say) and
     input this in the preamble (\input{mypreamble}.
     
     + you don't need to learn LyX layout file syntax, just LaTeX.
     
  b) write a LyX module (document class extension) with your
     configuration and load it under Document settings (again for each
     imported document)
     
     + you have more config choices than with just a preamble.tex file
     + you can combine one module with several base classes
     + you can split your configuration into several modules and combine
       them at will.
     - you need to learn both, LaTeX and LyX layout/module syntax
       (see Help>LaTeX Configuration)
       
  c) write a LyX layout (i.e. a LyX document class) based on an existing
     LaTeX class.
     
     - you still need to change the document class for each imported
       document, as the import will set it to the base classes LyX-layout.
       
  d) write both, a latex document class and a lyx layout.
  
     - need to learn how to write a latex class and lyx layout
     + correct document class given to imported documents automatically.

Günter

Reply via email to