]> git.lyx.org Git - lyx.git/blob - lib/layouts/recipebook.layout
Allow literate documents other than noweb to work out of the box. Currently
[lyx.git] / lib / layouts / recipebook.layout
1 #% Do not delete the line below; configure depends on this
2 #  \DeclareLaTeXClass[scrbook]{book (recipes)}
3 # Recipe textclass definition file.
4 # Author: Sandor Szoke (alex@lyx.hu)
5 #
6 # The \part, \chapter, \section and \subsection commands
7 # work as usual; \subsubsection commands are used for
8 # ``recipes'' as units, and are not numbered but (by
9 # default) entered in the .toc file.
10 #
11 # The recipe (a.k.a. subsubsection header) is typeset in
12 # a style defined with the command \rechead; the default
13 # is Large, horizontally centered, bold sans-serif: and
14 # the user can change that setting with a suitable
15 # \renewcommand{\rechead} .
16 #
17 # If e.g. \section and \subsection commands are not used
18 # in the text, the large indentation of the \subsubsection
19 # items in the Table of Contents may be ugly; for that case,
20 # we redefine \l@subsubsection .
21 #
22 # A specific command \recipe{...} is defined as an alias
23 # for a \subsubsection{...} followed by two rules across
24 # the whole page and by a vertical space.
25 #
26 # Another command, \ingred{...}, is defined to typeset a
27 # list of ingredients.
28
29 Format 11
30 Input scrclass.inc
31 Input numreport.inc
32
33 Sides                   1
34 Sides                   2
35 PageStyle               Headings
36
37 # There is no abstract environment in scrbook.cls
38 NoStyle Abstract
39
40 # Global parameters.
41 SecNumDepth             2
42 TocDepth                3
43
44 Style Chapter
45   LabelString           "\thechapter"
46 End
47
48 Style Bibliography
49   TopSep                4
50   LabelString           "Bibliography"
51   LabelFont
52     Series              Bold
53     Size                Largest
54   EndFont
55 End
56
57 Preamble
58
59 \setcounter{secnumdepth}{2}     % subsubsections not numbered
60 \setcounter{tocdepth}{3}        % subsubsections in the .toc file
61
62 \newcommand{\rechead}
63     {\centering\normalfont\Large\sffamily\bfseries}
64
65 \renewcommand{\subsubsection}
66     {\@startsection{subsubsection}{3}{\z@}%
67     {-5ex\@plus -1ex \@minus -.2ex}%
68     {1.5ex \@plus .2ex}%
69     {\rechead}}
70
71 \newcommand{\recipe}[1]{\subsubsection{#1}%
72     \hrule height0.75pt width\hsize\vspace*{1\p@}%
73     \hrule height0.25pt width\hsize%
74     \nobreak
75     \vskip\parskip}
76
77 \newcommand{\inghead}[1][]{\large\textbf{Ingredients#1}:}
78 \newcommand{\ingred}[2][]
79     {{\list{}{\rightmargin 1em\leftmargin 1em}%
80     \item[]\textit{\inghead[#1]} #2\endlist}%
81     \hrule height0.25pt width\hsize}
82 EndPreamble
83
84 Style Recipe
85   LatexType             Command
86   LatexName             recipe
87   Margin                Static
88   LeftMargin            Ingredients_for_some:xx
89   LabelSep              xx
90   LabelType             Static
91   LabelString           "Recipe:"
92   Align                 Center
93   LabelFont
94     Family              Sans
95     Size                Large
96     Series              Bold
97     Shape               Italic
98     Color               red
99   EndFont
100 End
101
102 # Subsubsection style definition
103 Style Subsubsection
104   LatexType             Command
105   LatexName             subsubsection
106   ParSkip               0.4
107   TopSep                0.9
108   BottomSep             0.5
109   ParSep                0.5
110   Align                 Block
111   AlignPossible         Block
112   Font
113     Size                Small
114   EndFont
115 End
116
117 # Inghead style definition
118 Style Ingredients
119   LatexType             Command
120   LatexName             ingred
121   OptionalArgs          1
122   Margin                Static
123   LeftMargin            Ingredients_for_some:xx
124   LabelSep              xx
125   Align                 Left
126   AlignPossible         Left, Block
127   LabelType             Static
128   LabelString           "Ingredients:"
129   LabelFont
130     Series              Bold
131     Shape               Italic
132     Color               red
133   EndFont
134   Preamble
135    \renewcommand*\l@subsubsection{\@dottedtocline{3}{3em}{0em}}
136    \setlength\parindent{0pt}
137    \setlength\parskip{2ex plus 0.5ex}
138   EndPreamble
139 End