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.