]> git.lyx.org Git - features.git/commitdiff
recipebook: a new layout to typeset recipes based on the koma-script book class,...
authorUwe Stöhr <uwestoehr@web.de>
Sat, 6 Dec 2008 16:13:17 +0000 (16:13 +0000)
committerUwe Stöhr <uwestoehr@web.de>
Sat, 6 Dec 2008 16:13:17 +0000 (16:13 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@27782 a592a061-630c-0410-9148-cb99ea01b6c8

development/scons/scons_manifest.py
lib/Makefile.am
lib/examples/recipebook.lyx [new file with mode: 0644]
lib/layouts/recipebook.layout [new file with mode: 0644]

index 277f77456267ed4723d886155eddce2503cb9e8f..69eac14180f305e9fd0d2ecc267fa790f485ea62 100644 (file)
@@ -2359,6 +2359,7 @@ lib_examples_files = Split('''
     multicol.lyx
     noweb2lyx.lyx
     powerdot-example.lyx
+    recipebook.lyx
     script_form.lyx
     seminar.lyx
     serial_letter1.lyx
@@ -2604,6 +2605,7 @@ lib_layouts_files = Split('''
     mwrep.layout
     paper.layout
     powerdot.layout
+    recipebook.layout
     report.layout
     revtex.layout
     revtex4.layout
index 12db219cc3efeddfb7ce95835a0f3154614606ed..1f698a426778636349a2abc1c143c25a8fef3d9c 100644 (file)
@@ -226,6 +226,7 @@ dist_examples_DATA = \
        examples/multicol.lyx \
        examples/noweb2lyx.lyx \
        examples/powerdot-example.lyx \
+       examples/recipebook.lyx \
        examples/script_form.lyx \
        examples/seminar.lyx \
        examples/serial_letter1.lyx \
@@ -1037,6 +1038,7 @@ dist_layouts_DATA =\
        layouts/numrevtex.inc \
        layouts/paper.layout \
        layouts/powerdot.layout \
+       layouts/recipebook.layout \
        layouts/report.layout \
        layouts/revtex.layout \
        layouts/revtex4.layout \
diff --git a/lib/examples/recipebook.lyx b/lib/examples/recipebook.lyx
new file mode 100644 (file)
index 0000000..b65e087
--- /dev/null
@@ -0,0 +1,350 @@
+#LyX 1.6.1svn created this file. For more info see http://www.lyx.org/
+\lyxformat 345
+\begin_document
+\begin_header
+\textclass recipebook
+\begin_preamble
+
+\end_preamble
+\use_default_options false
+\language english
+\inputencoding auto
+\font_roman times
+\font_sans helvet
+\font_typewriter courier
+\font_default_family default
+\font_sc false
+\font_osf false
+\font_sf_scale 100
+\font_tt_scale 100
+
+\graphics default
+\paperfontsize default
+\spacing single
+\use_hyperref false
+\papersize default
+\use_geometry false
+\use_amsmath 1
+\use_esint 0
+\cite_engine basic
+\use_bibtopic false
+\paperorientation portrait
+\secnumdepth 2
+\tocdepth 3
+\paragraph_separation indent
+\defskip medskip
+\quotes_language swedish
+\papercolumns 1
+\papersides 1
+\paperpagestyle default
+\tracking_changes false
+\output_changes false
+\author "" 
+\author "" 
+\end_header
+
+\begin_body
+
+\begin_layout Title
+Recipe book example
+\end_layout
+
+\begin_layout Author
+By Sándor Szőke (alex@lyx.hu)
+\end_layout
+
+\begin_layout Standard
+\begin_inset CommandInset toc
+LatexCommand tableofcontents
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Chapter
+Soups
+\end_layout
+
+\begin_layout Recipe
+\begin_inset Quotes sld
+\end_inset
+
+Birdmilk
+\begin_inset Quotes srd
+\end_inset
+
+
+\end_layout
+
+\begin_layout Ingredients
+\begin_inset OptArg
+status open
+
+\begin_layout Plain Layout
+\begin_inset space ~
+\end_inset
+
+(for 4 persons)
+\end_layout
+
+\end_inset
+
+2
+\begin_inset space \thinspace{}
+\end_inset
+
+litres milk, 7
+\begin_inset space \thinspace{}
+\end_inset
+
+pcs.
+ egg, 3
+\begin_inset space \thinspace{}
+\end_inset
+
+packet vanilia (3×10
+\begin_inset space \thinspace{}
+\end_inset
+
+g), 6
+\begin_inset space \thinspace{}
+\end_inset
+
+tbl spoon sugar
+\end_layout
+
+\begin_layout Standard
+Put 2
+\begin_inset space \thinspace{}
+\end_inset
+
+tbl.
+ spoon sugar into 2
+\begin_inset space \thinspace{}
+\end_inset
+
+litres milk (spare 1.5
+\begin_inset space \thinspace{}
+\end_inset
+
+dl for later) and 1
+\begin_inset space \thinspace{}
+\end_inset
+
+packet vanilia.
+\end_layout
+
+\begin_layout Standard
+Put 2
+\begin_inset space \thinspace{}
+\end_inset
+
+tbl.
+ spoon sugar into the 7
+\begin_inset space \thinspace{}
+\end_inset
+
+eggyolk and 1
+\begin_inset space \thinspace{}
+\end_inset
+
+packet vanilia.
+ Stir well.
+ Add 1.5
+\begin_inset space \thinspace{}
+\end_inset
+
+dl milk to it and stir it again well.
+\end_layout
+
+\begin_layout Standard
+Whisk the 7
+\begin_inset space \thinspace{}
+\end_inset
+
+eggwhite, when you almost ready add 2
+\begin_inset space \thinspace{}
+\end_inset
+
+tbl.
+ spoon sugar and 1
+\begin_inset space \thinspace{}
+\end_inset
+
+packet vanilia to it.
+ The egg foam must be brewed in the milk (in the approx 2
+\begin_inset space \thinspace{}
+\end_inset
+
+l).
+\end_layout
+
+\begin_layout Standard
+Put the the eggyolk into the milk, stir a little.
+ Now take a tbl.
+ spoon and put equivalent sized pieces of the foam into the milk.
+ Almost ready, all the thing must be brewed alltogether.
+ When you are stiring do it carefully, do not brake the foam.
+\end_layout
+
+\begin_layout Standard
+You can eat it when it is hot, but I prefer to cool it down.
+ I like when it is cold.
+\end_layout
+
+\begin_layout Chapter
+Drinks
+\end_layout
+
+\begin_layout Recipe
+Wineliqueur (1st variant)
+\end_layout
+
+\begin_layout Ingredients
+1
+\begin_inset space \thinspace{}
+\end_inset
+
+litre wine, 25
+\begin_inset space \thinspace{}
+\end_inset
+
+dkg sugar, 3
+\begin_inset space ~
+\end_inset
+
+packets vanilla (3×10
+\begin_inset space \thinspace{}
+\end_inset
+
+g), 3-4
+\begin_inset space \thinspace{}
+\end_inset
+
+dl rum and rum flavour
+\end_layout
+
+\begin_layout Standard
+Stir all of the components and store for at least one week on a cold place.
+\end_layout
+
+\begin_layout Standard
+Taste it and enjoy.
+ :)
+\end_layout
+
+\begin_layout Recipe
+Wineliqueur (2nd variant)
+\end_layout
+
+\begin_layout Ingredients
+1
+\begin_inset space \thinspace{}
+\end_inset
+
+litre wine, 40
+\begin_inset space \thinspace{}
+\end_inset
+
+dkg sugar, 1
+\begin_inset space \thinspace{}
+\end_inset
+
+pc.
+ vanilla stick, 3-4
+\begin_inset space \thinspace{}
+\end_inset
+
+dl rum and rum flavour
+\end_layout
+
+\begin_layout Standard
+Stir all of the components and store for at least one week on a cold place.
+\end_layout
+
+\begin_layout Standard
+Taste it and enjoy.
+ :)
+\end_layout
+
+\begin_layout Recipe
+Wineliqueur (3rd variant)
+\end_layout
+
+\begin_layout Ingredients
+2
+\begin_inset space ~
+\end_inset
+
+litres wine, 50
+\begin_inset space \thinspace{}
+\end_inset
+
+dkg sugar, 5
+\begin_inset space \thinspace{}
+\end_inset
+
+dl water, 5
+\begin_inset space \thinspace{}
+\end_inset
+
+dl sour cherry fluid (!), 1
+\begin_inset space \thinspace{}
+\end_inset
+
+dl Cuba rum, 2
+\begin_inset space \thinspace{}
+\end_inset
+
+packets vanilla (2×10
+\begin_inset space \thinspace{}
+\end_inset
+
+g)
+\end_layout
+
+\begin_layout Standard
+Stir all of the components and store for at least one week on a cold place.
+\end_layout
+
+\begin_layout Standard
+Taste it and enjoy.
+ :)
+\end_layout
+
+\begin_layout Recipe
+Home made Baily's
+\end_layout
+
+\begin_layout Ingredients
+2
+\begin_inset space \thinspace{}
+\end_inset
+
+dl Whisky or Rum, 3
+\begin_inset space \thinspace{}
+\end_inset
+
+dl skimmings, 2
+\begin_inset space \thinspace{}
+\end_inset
+
+pcs egg yolk, 40
+\begin_inset space \thinspace{}
+\end_inset
+
+dkg powdered sugar (can be replaced with honey)
+\end_layout
+
+\begin_layout Standard
+Stir all of the components and store for at least one week on a cold place.
+\end_layout
+
+\begin_layout Standard
+Taste it and enjoy.
+ :)
+\end_layout
+
+\end_body
+\end_document
diff --git a/lib/layouts/recipebook.layout b/lib/layouts/recipebook.layout
new file mode 100644 (file)
index 0000000..df26bb4
--- /dev/null
@@ -0,0 +1,139 @@
+#% Do not delete the line below; configure depends on this
+#  \DeclareLaTeXClass[scrbook]{book (recipes)}
+# Recipe textclass definition file.
+# Author: Sandor Szoke (alex@lyx.hu)
+#
+# The \part, \chapter, \section and \subsection commands
+# work as usual; \subsubsection commands are used for
+# ``recipes'' as units, and are not numbered but (by
+# default) entered in the .toc file.
+#
+# The recipe (a.k.a. subsubsection header) is typeset in
+# a style defined with the command \rechead; the default
+# is Large, horizontally centered, bold sans-serif: and
+# the user can change that setting with a suitable
+# \renewcommand{\rechead} .
+#
+# If e.g. \section and \subsection commands are not used
+# in the text, the large indentation of the \subsubsection
+# items in the Table of Contents may be ugly; for that case,
+# we redefine \l@subsubsection .
+#
+# A specific command \recipe{...} is defined as an alias
+# for a \subsubsection{...} followed by two rules across
+# the whole page and by a vertical space.
+#
+# Another command, \ingred{...}, is defined to typeset a
+# list of ingredients.
+
+Format 11
+Input scrclass.inc
+Input numreport.inc
+
+Sides                  1
+Sides                  2
+PageStyle              Headings
+
+# There is no abstract environment in scrbook.cls
+NoStyle Abstract
+
+# Global parameters.
+SecNumDepth            2
+TocDepth               3
+
+Style Chapter
+  LabelString          "\thechapter"
+End
+
+Style Bibliography
+  TopSep               4
+  LabelString          "Bibliography"
+  LabelFont
+    Series             Bold
+    Size               Largest
+  EndFont
+End
+
+Preamble
+
+\setcounter{secnumdepth}{2}    % subsubsections not numbered
+\setcounter{tocdepth}{3}       % subsubsections in the .toc file
+
+\newcommand{\rechead}
+    {\centering\normalfont\Large\sffamily\bfseries}
+
+\renewcommand{\subsubsection}
+    {\@startsection{subsubsection}{3}{\z@}%
+    {-5ex\@plus -1ex \@minus -.2ex}%
+    {1.5ex \@plus .2ex}%
+    {\rechead}}
+
+\newcommand{\recipe}[1]{\subsubsection{#1}%
+    \hrule height0.75pt width\hsize\vspace*{1\p@}%
+    \hrule height0.25pt width\hsize%
+    \nobreak
+    \vskip\parskip}
+
+\newcommand{\inghead}[1][]{\large\textbf{Ingredients#1}:}
+\newcommand{\ingred}[2][]
+    {{\list{}{\rightmargin 1em\leftmargin 1em}%
+    \item[]\textit{\inghead[#1]} #2\endlist}%
+    \hrule height0.25pt width\hsize}
+EndPreamble
+
+Style Recipe
+  LatexType            Command
+  LatexName            recipe
+  Margin               Static
+  LeftMargin           Ingredients_for_some:xx
+  LabelSep             xx
+  LabelType            Static
+  LabelString          "Recipe:"
+  Align                        Center
+  LabelFont
+    Family             Sans
+    Size               Large
+    Series             Bold
+    Shape              Italic
+    Color              red
+  EndFont
+End
+
+# Subsubsection style definition
+Style Subsubsection
+  LatexType            Command
+  LatexName            subsubsection
+  ParSkip              0.4
+  TopSep               0.9
+  BottomSep            0.5
+  ParSep               0.5
+  Align                        Block
+  AlignPossible                Block
+  Font
+    Size               Small
+  EndFont
+End
+
+# Inghead style definition
+Style Ingredients
+  LatexType            Command
+  LatexName            ingred
+  OptionalArgs         1
+  Margin               Static
+  LeftMargin           Ingredients_for_some:xx
+  LabelSep             xx
+  Align                        Left
+  AlignPossible                Left, Block
+  LabelType            Static
+  LabelString          "Ingredients:"
+  LabelFont
+    Series             Bold
+    Shape              Italic
+    Color              red
+  EndFont
+  Preamble
+   \renewcommand*\l@subsubsection{\@dottedtocline{3}{3em}{0em}}
+   \setlength\parindent{0pt}
+   \setlength\parskip{2ex plus 0.5ex}
+  EndPreamble
+End