I have set up a first version of a layout file for Peter Wilson's memoir 
class. The basic commands are supported. Most of the real sophisticated stuff 
is not natively supportable by LyX due to framework limitations -- this is 
the same as for the KOMA classes. Others might be added later (I think I have 
caught most, though).
Anyway, I think it is in a state where it can be added to /layouts. 

Attached you can find a patch with the template and the entry to 
LaTeXConfig.lyx.in for 1.4 and additions to Extended.lyx.

Enhancements and corrections, especially from people who know memoir better 
than me, are very welcome.

Shall I apply this to 1.4? Jean-Marc, what about 1.3.3?

Regards,
J�rgen.
Index: Extended.lyx
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyxdoc/Extended.lyx,v
retrieving revision 1.60
diff -u -r1.60 Extended.lyx
--- Extended.lyx	8 Jul 2003 15:32:20 -0000	1.60
+++ Extended.lyx	20 Sep 2003 17:50:46 -0000
@@ -506,6 +506,11 @@
 \layout Section
 
 Inserting LaTeX Code into LyX Documents 
+\begin_inset LatexCommand \label{sec:Inserting-LaTeX-Code}
+
+\end_inset 
+
+
 \layout Standard
 
 
@@ -13090,6 +13095,428 @@
  The rest of the usage for this layout is substantially the same as for
  the normal article class.
  For details of what Elsevier do and don't allow, refer to their documentation.
+\layout Section
+
+Memoir
+\layout Standard
+
+By 
+\noun on 
+J�rgen Spitzm�ller
+\layout Subsection
+
+Overview
+\layout Standard
+
+Memoir is a very powerful and constantly evolving class.
+ It has been designed with regard to fictional and non-fictional literature.
+ Its aim is to let the user have maximum control over the typesetting of
+ his document.
+ Memoir is based on the standard book class, but it can also emulate the
+ article class (see below).
+\layout Standard
+
+Peter Wilson, the developer of Memoir, is known as the author of lots of
+ useful packages in the LaTeX world.
+ Most of them have been merged with Memoir.
+ Therefore, it is much easier to layout the table of contents, appendices,
+ chapter designs and such.
+ LyX, though, does not support all of these goodies natively.
+ Some of them might be added to forthcoming releases
+\begin_inset Foot
+collapsed true
+
+\layout Standard
+
+You are invited to send suggestions to 
+\begin_inset LatexCommand [EMAIL PROTECTED]
+
+\end_inset 
+
+.
+\end_inset 
+
+, lots will probably never, due to the limitations of LyX's framework.
+ Of course you can still use all features with the help of some native LaTeX
+ commands (ERT
+\begin_inset Foot
+collapsed true
+
+\layout Standard
+
+Cf.
+\begin_inset ERT
+status Collapsed
+
+\layout Standard
+
+\backslash 
+ 
+\end_inset 
+
+section\SpecialChar ~
+
+\begin_inset LatexCommand \ref{sec:Inserting-LaTeX-Code}
+
+\end_inset 
+
+ for details.
+\end_inset 
+
+).
+ In this section, we can only list those features which are natively supported
+ by LyX.
+ For detailed descriptions (and for the rest of features) we are recommending
+ to have a look at the detailed manual of the Memoir class
+\begin_inset Foot
+collapsed true
+
+\layout Standard
+
+Cf.
+\begin_inset ERT
+status Collapsed
+
+\layout Standard
+
+\backslash 
+ 
+\end_inset 
+
+
+\begin_inset LatexCommand \url{CTAN:/macros/latex/memoir/memman.pdf}
+
+\end_inset 
+
+.
+\end_inset 
+
+, which is not only a user guide for the class, but also both a comprehensive
+ description on good typesetting and a superb example for good typesetting
+ itself.
+\layout Subsection
+
+Basic features and restrictions
+\layout Standard
+
+Memoir supports basically all features of the standard book classes.
+ There are, however, some differences, as follows:
+\layout Description
+
+Font\SpecialChar ~
+sizes: Memoir has a broader range of font sizes: 9, 10, 11, 12, 14,
+ 17
+\layout Description
+
+Page\SpecialChar ~
+style: The fancy page style is not supported, due to a command clash
+ between Memoir and the fancyhdr package (they are both defining a command
+ with the same name, which confuses LaTeX).
+ Instead, Memoir comes with a bunch of own page styles (see 
+\family sans 
+Layout\SpecialChar \menuseparator
+Document\SpecialChar \menuseparator
+Page\SpecialChar ~
+Style
+\family default 
+).
+ If you want to use these for the chapter pages, you have to use the command
+ 
+\family typewriter 
+
+\backslash 
+chapterstyle
+\family default 
+ in the main text or in preamble (e.
+\begin_inset ERT
+status Collapsed
+
+\layout Standard
+
+\backslash 
+,
+\end_inset 
+
+g.
+\begin_inset ERT
+status Collapsed
+
+\layout Standard
+
+\backslash 
+ 
+\end_inset 
+
+
+\family typewriter 
+
+\backslash 
+chapterstyle{companion}
+\family default 
+).
+\layout Description
+
+Sectioning: Sectionings (chapter, section, subsection etc.) are coming with
+ an optional argument in the standard classes.
+ With this, you can specify an alternative version of the title for the
+ table of contents and the headers (for instance, if the title is too long).
+ In LyX, you can do this via 
+\family sans 
+Insert\SpecialChar \menuseparator
+Short\SpecialChar ~
+Title
+\family default 
+ at the beginning of a chapter/section.
+ Memoir features a second optional argument and thus separates the table
+ of contents from the header.
+ You can define three variants of a title with this: one for the main text,
+ one for the table of contents, and one for the headers.
+ Unfortunately, LyX does not support two optional arguments yet.
+ But you can fool it.
+ Just insert a pair of brackets in ERT-Mode (
+\family sans 
+C-l
+\family default 
+) between the first and the second argument.
+ That is, type 
+\emph on 
+<short title for the toc>
+\emph default 
+ 
+\family typewriter 
+][
+\family default 
+ 
+\emph on 
+<short title for the headers> 
+\emph default 
+in the Short Title inset (where 
+\family typewriter 
+][
+\family default 
+ is in TeX-Mode).
+\layout Description
+
+TOC/LOT/LOF: In the standard classes (and in many other classes), the table
+ of contents, the list of figures and the list of table start a new page
+ automatically.
+ Memoir does not follow this route.
+ You have to insert a page break yourself, if you want to have one.
+\layout Description
+
+Titlepage: For some unknown reason, Memoir uses pagination on the title
+ page (in the standard classes, title pages are 
+\begin_inset Quotes eld
+\end_inset 
+
+empty
+\begin_inset Quotes erd
+\end_inset 
+
+, i.
+\begin_inset ERT
+status Collapsed
+
+\layout Standard
+
+\backslash 
+,
+\end_inset 
+
+e.
+\begin_inset ERT
+status Collapsed
+
+\layout Standard
+
+\backslash 
+ 
+\end_inset 
+
+without pagina).
+ If you want an empty title page, type 
+\family typewriter 
+
+\backslash 
+aliaspagestyle{title}{empty} 
+\family default 
+in the preamble.
+\layout Description
+
+Article: With the class option 
+\emph on 
+article 
+\emph default 
+(to be inserted in 
+\family sans 
+Layout\SpecialChar \menuseparator
+Document\SpecialChar \menuseparator
+Extra\SpecialChar ~
+Options
+\family default 
+), you can emulate article style.
+ That is, counters (footnotes, figures, tables etc.) will not be reset on
+ new chapters, chapters don't start a new page (but are---in contrary to
+ 
+\begin_inset Quotes eld
+\end_inset 
+
+real
+\begin_inset Quotes erd
+\end_inset 
+
+ article classes---still allowed), parts, though, use their own page, as
+ in book.
+\layout Description
+
+Oldfontcommands: By default, Memoir does not allow the use of the deprecated
+ font commands, which have been used in the old LaTeX version 2.09 (e.
+\begin_inset ERT
+status Collapsed
+
+\layout Standard
+
+\backslash 
+,
+\end_inset 
+
+g.
+\begin_inset ERT
+status Collapsed
+
+\layout Standard
+
+\backslash 
+ 
+\end_inset 
+
+
+\family typewriter 
+
+\backslash 
+rm
+\family default 
+, 
+\family typewriter 
+
+\backslash 
+it
+\family default 
+).
+ It produces an error and stops LaTeX whenever such a command appears.
+ The class option 
+\emph on 
+oldfontcommands
+\emph default 
+ reallows the commands and spits out warnings instead (which does at least
+ not stop LaTeX).
+ Since a lot of packages and particularly BibTeX style files are still using
+ those commands, we have decided to use this option by default.
+\layout Subsection
+
+Extra features
+\layout Standard
+
+We will only describe the features supported by LyX (which is not much currently
+).
+ Please consult the Memoir manual
+\begin_inset Foot
+collapsed true
+
+\layout Standard
+
+Cf.
+\begin_inset ERT
+status Collapsed
+
+\layout Standard
+
+\backslash 
+ 
+\end_inset 
+
+
+\begin_inset LatexCommand \url{CTAN:/macros/latex/memoir/memman.pdf}
+
+\end_inset 
+
+.
+\end_inset 
+
+ for details.
+\layout Description
+
+Abstract: You may wonder why an abstract is an extra feature.
+ Well, it is in book class.
+ Usually books don't have abstracts.
+ Memoir, however, has.
+ You can use it whereever and how often you like.
+\layout Description
+
+Chapterprecis: You may know this from belletristic: The contents of a chapter
+ is shortly described below the title and also in the table of contents
+ (e.
+\begin_inset ERT
+status Collapsed
+
+\layout Standard
+
+\backslash 
+,
+\end_inset 
+
+g.
+\begin_inset ERT
+status Collapsed
+
+\layout Standard
+
+\backslash 
+ 
+\end_inset 
+
+
+\emph on 
+Our hero arrives in Troia; he loses some friends; he finds others
+\emph default 
+).
+ Chapterprecis does exactly this.
+ It is therefore only sensible below a chapter.
+\layout Description
+
+Epigraph: An epigraph is a smart slogan or motto at the beginning of a chapter.
+ The epigraph environment provides an elegant way of typesetting such a
+ motto.
+ The motto itself (text) and its author (source) are divided by a short
+ line.
+ Unfortunately, we have to fool LyX a bit here again, since the environment
+ needs two arguments (text and source).
+ In this case, we have to use curly brackets (in TeX mode) between the two
+ arguments: 
+\emph on 
+<smart slogan>
+\emph default 
+ 
+\family typewriter 
+}{
+\family default 
+ 
+\emph on 
+<author of the slogan>.
+\layout Description
+
+Poemtitle: Memoir has lots of possibilities to typeset poetry (up to very
+ complex figurative poems).
+ Lyx can only support a few of them.
+ One is poemtitle, which is a centered title for poems, which will also
+ be added to the table of contents (verse is the standard environment for
+ poems.
+ Memoir has some enhanced versions of verse, but you need to use ERT, because
+ they have to be nested inside regular verse environments, which is not
+ possible with LyX).
+\layout Description
+
+Poemtitle*: Same as poemtitle, but it adds no entry to the table of contents.
 \layout Chapter
 
 Importing and Exporting Alternate File Formats
Index: lib/doc/LaTeXConfig.lyx.in
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/lib/doc/LaTeXConfig.lyx.in,v
retrieving revision 1.32
diff -u -r1.32 LaTeXConfig.lyx.in
--- lib/doc/LaTeXConfig.lyx.in	17 Sep 2003 13:45:11 -0000	1.32
+++ lib/doc/LaTeXConfig.lyx.in	20 Sep 2003 18:31:14 -0000
@@ -1331,7 +1331,7 @@
 
 \begin_layout Subsection
 
-Koma-Script
+KOMA-Script
 \begin_inset LatexCommand \label{sub:Koma-Script}
 
 \end_inset 
@@ -1341,7 +1341,11 @@
 
 \begin_layout Description
 
-Found: scrartcl: @chk_scrartcl@, 
+Found: 
+\family sans 
+scrartcl
+\family default 
+: @chk_scrartcl@, 
 \family sans 
 scrreprt
 \family default 
@@ -1381,16 +1385,20 @@
 
 \begin_layout Subsection
 
-Koma-Script letter
+KOMA-Script letter
 \end_layout
 
 \begin_layout Standard
 
-Found: scrlettr: @chk_scrlettr@, 
+Found: 
+\family sans 
+scrlettr
+\family default 
+: @chk_scrlettr@, 
 \family sans 
-scr
+scrlttr2
 \family default 
-lttr2: @chk_scrlttr2@
+: @chk_scrlttr2@
 \end_layout
 
 \begin_layout Description
@@ -1537,6 +1545,31 @@
 \end_layout
 
 \end_deeper 
+\begin_layout Subsection
+
+memoir
+\end_layout
+
+\begin_layout Description
+
+Found: @chk_memoir@
+\end_layout
+
+\begin_layout Description
+
+CTAN: 
+\family typewriter 
+macros/latex/contrib/supported/memoir/
+\end_layout
+
+\begin_layout Description
+
+Notes: Memoir is a flexible class for typesetting general fiction, non-fiction
+ and mathematical works as books, reports, articles or manuscripts.
+ Documents can use 9, 10, 11, 12, 14 or 17pt as the normal font size.
+ Many methods are provided to let you create your own particular design.
+\end_layout
+
 \begin_layout Subsection
 
 mwcls (mwart, mwbk, mwrep)
Index: lib/layouts/memoir.layout
===================================================================
RCS file: lib/layouts/memoir.layout
diff -N lib/layouts/memoir.layout
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ lib/layouts/memoir.layout	20 Sep 2003 18:31:16 -0000
@@ -0,0 +1,84 @@
+#% Do not delete the line below; configure depends on this
+#  \DeclareLaTeXClass{memoir}
+# Memoir textclass definition file (poor man's version).
+# Author: J�rgen Spitzm�ller <[EMAIL PROTECTED]>
+# feel free to contribute missing features!
+
+Input stdclass.inc
+Input numreport.inc
+
+Sides		2
+PageStyle	Headings
+
+ClassOptions
+  FontSize		9|10|11|12|14|17
+  PageStyle	empty|plain|headings|myheadings|ruled|Ruled|companion
+  Other oldfontcommands
+End
+
+Style Bibliography
+  TopSep		4
+  LabelString		Bibliography
+  # label font definition
+  LabelFont
+    Series		Bold
+    Size		Huge
+  EndFont
+End
+
+Style Chapterprecis
+  Margin		Static
+  LatexType		Command
+  LatexName		chapterprecis
+  NeedProtect		1
+  NextNoIndent		1
+  LeftMargin		MM
+  LabelSep		xxx
+  ParSkip		0.4
+  TopSep		0.4
+  BottomSep		0
+  ParSep		0.4
+  Align			Block
+  AlignPossible		Block
+
+  Font
+    Shape 		Italic
+    Size		Normal
+  EndFont
+End
+
+Style Epigraph
+  Margin		Right_Address_Box
+  LatexType		Command
+  LatexName		epigraph
+  ParSkip		0.4
+  BottomSep		1.5
+  ParSep		1.5
+  Align			Left
+  AlignPossible		Left
+End
+
+Style Poemtitle
+  LatexType             Command
+  LatexName             poemtitle
+  NeedProtect           1
+  NextNoIndent          1
+  LabelSep              xxx
+  ParSkip               0.4
+  TopSep                0.4
+  ParSep                0.4
+  Align                    center
+  AlignPossible		center
+  OptionalArgs         1
+
+  Font
+     Series              Bold
+  EndFont
+End
+
+Style Poemtitle*
+  CopyStyle             Poemtitle
+  LatexName             poemtitle*
+  OptionalArgs         0
+End
+

Reply via email to