Jeremy C. Reed wrote:
I am trying to figure out how to change the printed output of "Chapter" to "Session" in a copy of the book document class.
\renewcommand{\chaptername}{session} This doesn't work for me in the preamble, because babel redefines the name to "Kapittel" ("chapter" in Norwegian).
But it works if I put it in ERT at the top of the document. Note that it only works for latex-based output (i.e. postscript, pdf, html, dvi, ...) you won't see "session" inside lyx unless you also makes a new layout.
I am using LyX 1.3.4 and teTeX-2.0.2.
I tried copying share/lyx/layouts/book.layout to my ~/.lyx/layouts/courseware.layout and then modifying to have:
\DeclareLaTeXClass{courseware}
and made a new Style Session.
Don't make a new layout just for this. Do it if you have lots of other changes though.
Don't make a new style if you merely want to rename chapter. Just rename chapter in that case. Make a new style only if "session" is something different from "chapter", perhaps if you want to have both chapters _and_ sessions.
but LyX said the class was "Unavailable" (but it did work, but didn't have any way to export to postscript).
I also tried making a new ~/.lyx/layouts/courseware.layout with:
#% Do not delete the line below; configure depends on this # \DeclareLaTeXClass[book]{courseware} Input stdclass.inc
But I couldn't figure out how to add a "Session" style or to change the Chapter.
Also, I read that the .layout files only effect the look in the LyX
interface. So I guess I need to change some book.cls file to make a new
file.
The layout file may contain latex preamble commands - try to redefine \chaptername there. This avoids having to write a whole new class.
Any ideas would be appreciated.
Basically what I want is a document layout for a book that doesn't say
"Chapter" on each of my new chapters, but says "Session" instead. This is
used for courseware that I have been using for a couple years.
In that case, just rename "chapter" to "session".
Helge Hafting