summaryrefslogtreecommitdiff
path: root/simpleslides-s-Automaton.tex
diff options
context:
space:
mode:
Diffstat (limited to 'simpleslides-s-Automaton.tex')
-rw-r--r--simpleslides-s-Automaton.tex141
1 files changed, 43 insertions, 98 deletions
diff --git a/simpleslides-s-Automaton.tex b/simpleslides-s-Automaton.tex
index 4ec1d19..1b4b277 100644
--- a/simpleslides-s-Automaton.tex
+++ b/simpleslides-s-Automaton.tex
@@ -9,6 +9,7 @@
%C
%C Copyright 2007 Aditya Mahajan and Thomas A. Schmitz
%C This file may be distributed under the GNU General Public License v. 2.0.
+%C Modified 2010 by Philipp Gesang
%D Providing presentation Backgrounds according to Conway's Game of Life.
%D Initially based on the BigNumber theme by A. Mahajan and Th. Schmitz. (Many,
@@ -18,6 +19,8 @@
\startmodule[simpleslides-s-Automaton]
+\setupmodule[file=,rule=] % using defaults from lua config
+
\ctxlua{environment.loadluafile( "mplife" )}
\ctxlua{mplife.slides = true}
@@ -25,18 +28,20 @@
%D First, we change the page layout to have more space all around
-\setuplayout [width=fit,
- margin=2cm,
- height=fit,
- leftmargindistance=.8cm,
- rightmargindistance=0cm,
- header=18mm,
- footer=0cm,
- topspace=.8cm,
- backspace=1.9cm,
- location=singlesided]
-
-\setuplayout [simpleslides:layout:horizontal][header=18mm]
+\setuplayout [ width=fit,
+ margin=2cm,
+ height=fit,
+ leftmargindistance=.2cm,
+ rightmargindistance=.2cm,
+ header=18mm,
+ headerdistance=.3cm,
+ footer=0cm,
+ footerdistance=0mm,
+ topspace=.5cm,
+ backspace=1.9cm,
+ location=singlesided]
+
+\setuplayout [simpleslides:layout:horizontal][header=14mm]
\setuplayout [simpleslides:layout:vertical] [header=0mm]
\setuplayout [simpleslides:layout:title]
@@ -48,8 +53,10 @@
%D get a consistent look and feel.
\defineframed[simpleslides:framed:small]
- [frame=off,offset=0pt,
- width=1.7cm,align=middle]
+ [ frame=off,
+ offset=0pt,
+ width=1.7cm,
+ align=middle]
\setupcombinations[distance=2.5em]
@@ -63,118 +70,56 @@
%D This module has two color schemes, a blue one and a red one.
\startsetups simpleslides:setups:blue
-\definecolor [simpleslides:contrastcolor] [r=0.8,g=0.8,b=0.9]
-\definecolor [simpleslides:backgroundcolor] [s=.88]
+\definecolor [simpleslides:contrastcolor] [r=0.7,g=0.7,b=0.9]
+%\definecolor [simpleslides:backgroundcolor] [s=1]
+\definecolor [simpleslides:backgroundoutside] [r=0.9,g=0.9,b=0.95]
+\definecolor [simpleslides:backgroundscreen] [s=.975]
\definecolor [simpleslides:textcolor] [s=0]
\stopsetups
\startsetups simpleslides:setups:red
\definecolor [simpleslides:contrastcolor] [r=0.4]
-\definecolor [simpleslides:backgroundcolor] [s=.35]
+%\definecolor [simpleslides:backgroundcolor] [s=.95]
+\definecolor [simpleslides:backgroundoutside] [r=0.5,g=0.2,b=0.2]
+\definecolor [simpleslides:backgroundscreen] [s=.4]
\definecolor [simpleslides:textcolor] [s=1]
\stopsetups
%D Now we choose the scheme that the user asked for
-\doifsetupselse{simpleslides:setups:\moduleparameter{simpleslides}{color}}
+\doifsetupselse
+ {simpleslides:setups:\moduleparameter{simpleslides}{color}}
{\setups{simpleslides:setups:\moduleparameter{simpleslides}{color}}}
{\setups{simpleslides:setups:blue}}
\setupcolors[textcolor={simpleslides:textcolor}]
+%D Set the initial Game of Life snapshot (from file) and the rule, if given.
-%D The characteristic feature of this module is that the page number is drawn in
-%D big letters on the slide. First we define the font used to draw the number.
-%D The is a bit verbose since \MKII\ and \MKIV\ have different ways of loading
-%D fonts.
-
-\beginOLDTEX
-\loadmapfile[qhv-ec.map]
-\definefontsynonym [BigNumberFont] [ec-qhvb]
-\endOLDTEX
-
-\beginXETEX
-\loadmapfile[qhv-ec.map]
-\definefontsynonym [BigNumberFont] [ec-qhvb]
-\endXETEX
-
-\beginLUATEX
-\definefontsynonym [BigNumberFont] [name:texgyreherosbold]
-\endLUATEX
-
-\definefont [NumberFont] [BigNumberFont at 30pt]
-
-
-%D We use \METAPOST\ to draw backgrounds. First, we define a few helper macros
-%D to place text inside \METAPOST
-
-\definetextext[simpleslides:sometxt:left] {\TaspresentSometxtLeft}
-\definetextext[simpleslides:sometxt:right]{\TaspresentSometxtRight}
-
-\unexpanded\def\TaspresentSometxtLeft#1%
- {\getvalue{simpleslides:framed:small}
- {\color[simpleslides:contrastcolor]
- {\NumberFont #1}}}
-
-\unexpanded\def\TaspresentSometxtRight#1%
- {\getvalue{simpleslides:framed:small}
- {\color[simpleslides:backgroundcolor]
- {\NumberFont #1}}}
-
-%D Now we define a \METAPOST| graphic that draws the number. The exact
-%D dimensions have been found by trial and error.
-
-%\startuseMPgraphic{simpleslides:MP:ornament}
-%StartPage ;
-%save Left, Right ;
-%picture Left, Right ;
-
-%Left := \sometxt [simpleslides:sometxt:left]{\folio} ysized 6cm;
-%Right := \sometxt[simpleslides:sometxt:right]{\folio} ysized 6cm;
-
-%save LeftBox, RightBox ;
-%path LeftBox, RightBox ;
-
-%save split ; numeric split ;
-%split := if PageNumber < 10 : 1/2 else : 2/3 fi ;
-
-%LeftBox := llcorner Left -- split[llcorner Left, lrcorner Left]
- %-- split[ulcorner Left, urcorner Left] -- ulcorner Left --cycle ;
-
-%RightBox := lrcorner Right -- split[lrcorner Right, llcorner Right]
- %-- split[urcorner Right, ulcorner Right] -- urcorner Right --cycle ;
-
-%if PageNumber >= 10 :
-%RightBox := RightBox shifted split[lrcorner Right, llcorner Right] ;
-%fi;
-
-%clip Left to LeftBox ;
-%clip Right to RightBox ;
-
-%save corner; pair corner ;
-%corner := lrcorner Field[Text][Text] shifted (.2cm,-1cm) ; % same as x2
-
-%labeloffset := 0bp;
+%\doifsomething{\currentmoduleparameter{key}}{\setupsomething[key=\currentmoduleparameter{key}]}
-%label.ulft(Left, corner) ;
-%label.urt (Right, corner) ;
+\doifsomething{\moduleparameter{simpleslides}{file}}{\ctxlua
+ {mplife.setup.current.file = "\luaescapestring{\moduleparameter{simpleslides}{file}}"
+ mplife.setup.current.init = gol.parse_file(mplife.setup.current.file)
+ mplife.setup.current.last = mplife.setup.current.init }}
-%StopPage ;
-%\stopuseMPgraphic
+\doifsomething{\moduleparameter{simpleslides}{rule}}{\ctxlua
+ {mplife.setup.current.rule = gol.parse_rule("\luaescapestring{\moduleparameter{simpleslides}{rule}}") }}
%D We also use \METAPOST\ to draw the horizontal and vertical page backgrounds.
+%D Backgrounds will be of solid color, the ornament gets the transparency.
\startuniqueMPgraphic{simpleslides:MP:horizontal}
StartPage ;
-fill Page withcolor transparent (1, .3, \MPcolor{simpleslides:contrastcolor}) ;
+fill Page withcolor \MPcolor{simpleslides:backgroundoutside} ;
fill Field[Text][Text] enlarged 0.2cm
- withcolor transparent (1, .3, \MPcolor{simpleslides:backgroundcolor}) ;
+ withcolor \MPcolor{simpleslides:backgroundscreen} ;
StopPage ;
\stopuniqueMPgraphic
\startuniqueMPgraphic{simpleslides:MP:vertical}
StartPage ;
-fill Page withcolor transparent (1, .3, \MPcolor{simpleslides:contrastcolor}) ;
+fill Page withcolor \MPcolor{simpleslides:backgroundoutside} ;
z1 = urcorner Field[Text][Text] shifted (.2cm,0) ;
z2 = lrcorner Field[Text][Text] shifted (.2cm,-.2cm) ;
@@ -185,7 +130,7 @@ save Main ;
path Main ;
Main := z1 -- z2 -- z4 -- z3 --cycle ;
-fill Main withcolor \MPcolor{simpleslides:backgroundcolor} ;
+fill Main withcolor \MPcolor{simpleslides:backgroundscreen} ;
StopPage ;
\stopuniqueMPgraphic