Supporting new document classes

1999-11-17 Thread Allan Rae

was Re: How can I use a Thesis style?

On Thu, 18 Nov 1999, Ben Stanley wrote:

Hi Ben,

> My university has a specified thesis style, and they have created a
> LaTeX style file for it, called uowthesis.sty. I was wondering if there
> is any way that I can use this style file in LyX?

You need to create a uowthesis.layout file.  This should be a relatively
easy task given that:

> The uowthesis.sty style is based on the report style.

Provided that it's actually a style file for use with LaTeX2e and the
report class (report.cls).  If it's a LaTeX-2.09 style file then you're in
for a bit more work -- see further below.

LaTeX2e Instructions

What you can try is:
cp report.layout ~/.lyx/layouts/uowthesis.layout

Then edit uowthesis.layout and change the line:
\DeclareLaTeXClass{report}
to read
\DeclareLaTeXClass[report,uowthesis.sty]{report (uowthesis)}

Then add:
Preamble
\usepackage{uowthesis}
EndPreamble

near the top of the file.
Start LyX and select Options->reconfigure.  Restart LyX and try creating a
new document you should see "report (uowthesis)" as a document class
option.  It's likely that some of the sectioning commands and such will
look different to how report works so you can fiddle around with the
settings for the different sections if you wish.  See further below for
more discussion on this.

LaTeX-2.09 Instructions
===
If the uowthesis.sty file is specifically for the now defunct LaTeX-2.09
you can tell this by one of two things:
1.  The example file the uni provides will start with
\documentstyle{uowthesis}
2.  Running latex on an example file will produce a big banner
warning that it is entering compatability mode.

LyX only supports LaTeX2e documents.  But don't give up hope yet. Where
there's a will there's a way.  The existing support for ReVTeX wraps the
2.09 codes for use in 2e formatted documents.  We can reuse the ReVTeX
wrapper for your uowthesis.sty (if it turns out to be 2.09 code).  I'm
already doing this in preparing support for IEICE Transactions.

Okay,  here's what you do:
cp lyx/lib/tex/revtex.cls ~/tex/uowthesis.cls

or to where ever you keep your local tex files.  Now edit uowthesis.cls
and do a search-and-replace on "revtex" and "uowthesis".  It's likely that
some of the \DeclareOption statements in the file are not relevent for
your style file but we won't worry about that now.

The next step is to repeat the process of creating the uowthesis.layout
file given above only this time you use:
\DeclareLaTeXClass{uowthesis}

and shouldn't need any Preamble definitions.  Run LyX and reconfigure,
restart lyx and with luck you'll have a reasonably useable system that
only needs fine-tuning of the display.  This involves tweeking the values
used by LyX for spacing, font styles and so on that are defined in the
.layout files.

You'll also need to check that you have all the environments available
from the uowthesis.sty available in your uowthesis.layout file.  If any
are missing you'll need to add entries.  Just copy another style that
looks similar and tweek that.  The easiest way to do this is with:
Style MissingStyle
CopyStyle SimilarStyle
# whatever is different you now redefine
End

See the documentation in Customization for details about what each element
in a .layout file does.

That should be enough to get you on the road.

Allan. (ARRae)

P.S.  I guess this should be added to Customization.  We've had a few
requests for something like this over the last few weeks.



Re: Supporting new document classes

1999-12-02 Thread Jean-Marc Lasgouttes

> "Mike" ==   <[EMAIL PROTECTED]> writes:

Mike> On 2 Dec 1999, Lars Gullik Bjønnes wrote:
>> Allan Rae <[EMAIL PROTECTED]> writes: | LaTeX2e
>> Instructions |  | What you can try is: | cp
>> report.layout ~/.lyx/layouts/uowthesis.layout [...] | That should
>> be enough to get you on the road.
>> 
>> Ok, this seems like a nice subchapter in some document.
>> Customization?

Mike> Allan - if you don't add this to the docs, I should have some
Mike> time next week to do it (finally). I've been meaning to do an
Mike> expanded "how to do your own layout" chapter for quite a while
Mike> ...

Great! Note that I already added a small blurb in Customization.lyx.
Feel free to do whatever you want with it.

JMarc



Re: Supporting new document classes

1999-12-02 Thread mressler

On 2 Dec 1999, Lars Gullik Bjønnes wrote:
> Allan Rae <[EMAIL PROTECTED]> writes:
> | LaTeX2e Instructions
> | 
> | What you can try is:
> | cp report.layout ~/.lyx/layouts/uowthesis.layout
> [...]
> | That should be enough to get you on the road.
> 
> Ok, this seems like a nice subchapter in some document. Customization?

Allan - if you don't add this to the docs, I should have some time next
week to do it (finally). I've been meaning to do an expanded "how to do
your own layout" chapter for quite a while ...

Mike
[EMAIL PROTECTED]



Re: Supporting new document classes

1999-12-02 Thread Lars Gullik Bjønnes

Allan Rae <[EMAIL PROTECTED]> writes:

| LaTeX2e Instructions
| 
| What you can try is:
|   cp report.layout ~/.lyx/layouts/uowthesis.layout
| 
| Then edit uowthesis.layout and change the line:
|   \DeclareLaTeXClass{report}
| to read
|   \DeclareLaTeXClass[report,uowthesis.sty]{report (uowthesis)}
| 
| Then add:
|   Preamble
|   \usepackage{uowthesis}
|   EndPreamble
| 
| near the top of the file.
| Start LyX and select Options->reconfigure.  Restart LyX and try creating a
| new document you should see "report (uowthesis)" as a document class
| option.  It's likely that some of the sectioning commands and such will
| look different to how report works so you can fiddle around with the
| settings for the different sections if you wish.  See further below for
| more discussion on this.
| 
| LaTeX-2.09 Instructions
| ===
| If the uowthesis.sty file is specifically for the now defunct LaTeX-2.09
| you can tell this by one of two things:
|   1.  The example file the uni provides will start with
|   \documentstyle{uowthesis}
|   2.  Running latex on an example file will produce a big banner
|   warning that it is entering compatability mode.
| 
| LyX only supports LaTeX2e documents.  But don't give up hope yet. Where
| there's a will there's a way.  The existing support for ReVTeX wraps the
| 2.09 codes for use in 2e formatted documents.  We can reuse the ReVTeX
| wrapper for your uowthesis.sty (if it turns out to be 2.09 code).  I'm
| already doing this in preparing support for IEICE Transactions.
| 
| Okay,  here's what you do:
|   cp lyx/lib/tex/revtex.cls ~/tex/uowthesis.cls
| 
| or to where ever you keep your local tex files.  Now edit uowthesis.cls
| and do a search-and-replace on "revtex" and "uowthesis".  It's likely that
| some of the \DeclareOption statements in the file are not relevent for
| your style file but we won't worry about that now.
| 
| The next step is to repeat the process of creating the uowthesis.layout
| file given above only this time you use:
|   \DeclareLaTeXClass{uowthesis}
| 
| and shouldn't need any Preamble definitions.  Run LyX and reconfigure,
| restart lyx and with luck you'll have a reasonably useable system that
| only needs fine-tuning of the display.  This involves tweeking the values
| used by LyX for spacing, font styles and so on that are defined in the
| .layout files.
| 
| You'll also need to check that you have all the environments available
| from the uowthesis.sty available in your uowthesis.layout file.  If any
| are missing you'll need to add entries.  Just copy another style that
| looks similar and tweek that.  The easiest way to do this is with:
|   Style MissingStyle
|   CopyStyle SimilarStyle
|   # whatever is different you now redefine
|   End
| 
| See the documentation in Customization for details about what each element
| in a .layout file does.
| 
| That should be enough to get you on the road.

Ok, this seems like a nice subchapter in some document. Customization?

Lgb



Re: Supporting new document classes

1999-12-02 Thread Allan Rae

On 2 Dec 1999, Jean-Marc Lasgouttes wrote:

> > "Mike" ==   <[EMAIL PROTECTED]> writes:
> 
> Mike> On 2 Dec 1999, Lars Gullik Bjønnes wrote:
> >> Allan Rae <[EMAIL PROTECTED]> writes: | LaTeX2e
> >> Instructions |  | What you can try is: | cp
> >> report.layout ~/.lyx/layouts/uowthesis.layout [...] | That should
> >> be enough to get you on the road.
> >> 
> >> Ok, this seems like a nice subchapter in some document.
> >> Customization?
> 
> Mike> Allan - if you don't add this to the docs, I should have some
> Mike> time next week to do it (finally). I've been meaning to do an
> Mike> expanded "how to do your own layout" chapter for quite a while
> Mike> ...
>
> Great! Note that I already added a small blurb in Customization.lyx.
> Feel free to do whatever you want with it.
> 
> JMarc

I saw you added that the other day, JMarc, but haven't as yet managed to
open the document to read it.  I'll integrate this over the weekend.  
Mike, you can repair my handywork then -- how does that sound?

Allan. (ARRae)



Re: Supporting new document classes

1999-12-03 Thread mressler


On Fri, 3 Dec 1999, Allan Rae wrote:
> > Mike> Allan - if you don't add this to the docs, I should have some
> > Mike> time next week to do it (finally). I've been meaning to do an
> > Mike> expanded "how to do your own layout" chapter for quite a while
> > Mike> ...
> 
> I saw you added that the other day, JMarc, but haven't as yet managed to
> open the document to read it.  I'll integrate this over the weekend.  
> Mike, you can repair my handywork then -- how does that sound?

Sounds like a plan to me. That will give me time to clean up a few other
things first ...

Mike
[EMAIL PROTECTED]



Re: Supporting new document classes

1999-12-07 Thread Staffan Ringbom

Background.

Several publishers have either officially or inofficially distributed
*.cls and *.sty files for their journals.  (Academic Press, Kluwer,
Elsevier, Springer)
The problem is that those files need some tayloring before they are usable
within LyX,
i.e. one needs to create the corresponding *.layout files. I think we have
a shared interest
in expanding the possible layouts.

- It would be preferable if we could coordinate our efforts on this issue.
- It would be nice if the publishers would accept this.

I see a clear value in an interesting collection of layout files, that have
wide circulation.
Those could be dowloaded either with the  LyX -ditribution or as  separate
add-ons.
The best thing would be if the publishers would provide the *layout files
directly.
Perhaps we could send the suggestions (our home made layout-files ) to the
publishers as well.
Some publishers give Scientific Word users special service. Why wouldn't
they be willing to give the same kind of  service to us
if we ask them politely?

As I know nothing about the legal obstacles in this procedure, it would be
nice to have some advice, in order to avoid unnecessary
negative PR. Any good suggestions how to proceed??

If you think the idea is good - could you make a push?

best,

Staffan Ringbom


[EMAIL PROTECTED] wrote:

> On 2 Dec 1999, Lars Gullik Bjønnes wrote:
> > Allan Rae <[EMAIL PROTECTED]> writes:
> > | LaTeX2e Instructions
> > | 
> > | What you can try is:
> > | cp report.layout ~/.lyx/layouts/uowthesis.layout
> > [...]
> > | That should be enough to get you on the road.
> >
> > Ok, this seems like a nice subchapter in some document. Customization?
>
> Allan - if you don't add this to the docs, I should have some time next
> week to do it (finally). I've been meaning to do an expanded "how to do
> your own layout" chapter for quite a while ...
>
> Mike
> [EMAIL PROTECTED]



Re: Supporting new document classes

1999-12-07 Thread mressler

On Wed, 8 Dec 1999, Staffan Ringbom wrote:
> Several publishers have either officially or inofficially distributed
> *.cls and *.sty files for their journals.  (Academic Press, Kluwer,
> Elsevier, Springer) The problem is that those files need some
> tayloring before they are usable within LyX, i.e. one needs to create
> the corresponding *.layout files. I think we have a shared interest in
> expanding the possible layouts.

Absolutely. But LyX is not yet on any publisher's radar screen, so until
they get a substantial number of papers submitted using LyX, they won't
pay attention. Unfortunately, that means we need to write the layout
files. 

> - It would be preferable if we could coordinate our efforts on this issue.

I'm not sure how to coordinate this. People who use a class are going to
have to write the layout - that's why I wrote the AASTeX layout, but I
wouldn't be much use for writing JGR or something like that.

> - It would be nice if the publishers would accept this.

Write the layout and start submitting papers :-)

> I see a clear value in an interesting collection of layout files, that
> have wide circulation. Those could be dowloaded either with the LyX
> -distribution or as separate add-ons.

This is what has been done so far, thus the large number of layouts in the
.../share/lyx/layouts directory.

> The best thing would be if the publishers would provide the *layout
> files directly. Perhaps we could send the suggestions (our home made
> layout-files ) to the publishers as well. Some publishers give
> Scientific Word users special service. Why wouldn't they be willing to
> give the same kind of service to us if we ask them politely?

As I said earlier, the only way this can happen is if they get a sizable
number of submissions from LyX or at least a lot of people clamoring for
LyX support. 

> As I know nothing about the legal obstacles in this procedure, it would be
> nice to have some advice, in order to avoid unnecessary
> negative PR. Any good suggestions how to proceed??

I think the only practical way to proceed is to have users create basic
layout files which support the bulk of a class file without too much ERT
(this is my problem with AASTeX, and why I haven't starting pestering the
American Astronomical Society about it yet - the citation mechanism
requires just a bit too much ERT to make it attractive). Once the basic
layouts exist, get a bunch of papers submitted (and accepted!), then
perhaps ask the publisher to better support a popular paper writing system
(LyX). But until they get those submissions, I don't think it's fair for
us to ask for support.

I don't mean to be such a wet blanket - I think your concern is right on
the mark, and is definitely the direction we want to be heading. But LyX
needs to get to the point where (with all due respect to our fearless
developers!) LyX is seen as a stable, popular, user-oriented environment
rather than an open-source, "see if it can be done" tinkering project. And
the only thing that is going to change that in the publishers' eyes is to
get the papers in.

In the mean time, I and others will do our best describing just how to
make those layouts ...

Mike