Hello Bennett, Bennett Helm wrote: > Here are some layout files for the memoir documentclass. I've split
Many thanks for doing this. I have improved my layout too and it has been added to CVS (both the developer version and LyX 1.3.3) this week. I'm trying to merge your changes with mine, but there are some slight differences in approach we have to discuss first. > them into two layout files -- one for books and one for articles (with > a third file for all the common code). The article layout file does a > couple weird things to make it more compatible with the standard > article documentclasses. The first is to redefine the sectioning > commands (so that, for example, \section gets interpreted as > \chapter). The reason for this is so that it is possible to switch > between the article document class and the memoir documentclass (with > the "article" class option) without having to change manually anything > in the document. The second is to redefine the \chapter command so as > to remove the erroneous "Chapter x" that precedes section titles in > headers when babel is loaded. I am not shure if we should rename the environments that way. After all, chapter is still chapter, it only behaves "sort of" like section in article does. Also, the article option does not change to oneside by itself. So # Global parameters Sides 1 is not correct (also Columns 2; memoir has single column mode by default). IMHO we should only provide one layout file and explain (in Extended.lyx) that memoir can emulate something that is closer to article than the default (btw., if you redefine the envoronments like you die, i.e. section (lyx) -> chapter (memoir), then switching classes within LyX will be much more difficult). > I've tried to include as many commands and environments as I could from > the memoir class, though I wasn't able to figure out how to do many of > them since they take more arguments or options than I could accommodate > within the LyX layout file. In some cases, as with the \epigraph > command, I've made the quotation be the body of the Epigraph paragraph, > with the author to be inserted as a "Short Title" (under the "Insert" > menu), since the "Short Title" actually gets passed as an optional > argument to the command. There is a trick to let Lyx pass two optional arguments (or two parameters, for that matter), which I have mentioned in the memoir doc section (which I have added to Extended): Inside an OptArg Inset (i.e. Short Title), Just insert ][ in ERT. This will close the first argument an open a second one (in memoir, this can be used to pass the two arguments two chapter \chapter[toc][headings]{title} With epigraph, you can similarly just add a pair of curly brackets in ERT (as "smart motto }{ source"). Than you don't have to redefine the environment (it's still a hack after all, but maybe the LyX framework will change eventually).. > In other cases, as with the \hangpara command, I've done the same trick > (where the "Short Title" specifies the number of lines to be "hung" by > the paragraph), though I've had to stipulate that the width of the > "hanging" be 2em. This use of LyX's "Short Title" is certainly > counterintuitive, but it gets the job done. It don't think it's a good idea to hardcode some value (why 2em?). I really think hangpara is one of the environments which cannot be supported by LyX in a sensible way currently and the user is stuck with ERT (of course you could use the trick mentioned above, but I don't think taht is more elegant than ERT). There are similar cases in KOMA two (the "addmargin" environment). I have added legend to the layout. I am not shure about sidebar, as Peter Wilson classifies it as experimental and considers to remove it again if it proves too buggy. I think we should wait until this feature has been declared "stable". I am reluctant on framed and shaded either. They are both more container insets than environments (they can include other environments as quote and verse themselves), so a collapsable inset would be more appropriate. Furthermore, Martin Vermeer is currently working on a native frames'n'boxes support for LyX. Maybe this thing should be considered there. Furthermore, for shaed you are loading the color package, but you have to make shure that this is not loaded before. This could be done by something like Preamble [EMAIL PROTECTED] \usepackage{color}}{} \definecolor{shadecolor}{gray}{0.8} EndPreamble But again, why hardcoding a color here? > Perhaps there ought to be a way in the definition of layout files to > make handling extra arguments/options easier or to make it possible to > specify more than 2 arguments within LyX. (Or perhaps I'm just not > seeing how this could be done.) I don't know how two arguments could be supported in a sane way (but I didn't think too hard about it), two opt arguments are certainly possible, if someone adds the code. Until then, we have two use some hackery. > Of course, comments or suggestions for improvement would be welcome. Please take these points only as suggestions. My experience on Memoir is limited and I am just trying to understand what the class actually aims. I have attached the most recent version of my layout (plus your legend environment). I'm looking forward for comments, I have also attached the section from Extended.lyx where I try to explain the usage in short. I think this all can be improved a lot, and I am grateful for any help. Regards, Jürgen. > Bennett Helm
#% Do not delete the line below; configure depends on this # \DeclareLaTeXClass{memoir} # Memoir textclass definition file # Author: Jürgen Spitzmüller <[EMAIL PROTECTED]> # Improvements by: Bennett Helm <[EMAIL PROTECTED]> # feel free to contribute missing features! Input stdclass.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 Legend LatexType Command LatexName legend NeedProtect 1 NextNoIndent 1 ParSkip 0.4 Align Center AlignPossible Center End Style Bibliography TopSep 4 LabelString Bibliography 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
#LyX 1.3 created this file. For more info see http://www.lyx.org/ \lyxformat 221 \textclass article \language english \inputencoding auto \fontscheme default \graphics default \paperfontsize default \spacing single \papersize Default \paperpackage a4 \use_geometry 0 \use_amsmath 0 \use_natbib 0 \use_numerical_citations 0 \paperorientation portrait \secnumdepth 3 \tocdepth 3 \paragraph_separation indent \defskip medskip \quotes_language german \quotes_times 2 \papercolumns 1 \papersides 1 \paperpagestyle default \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. \the_end