diff options
Diffstat (limited to 'obsolete/macros/context/contrib')
59 files changed, 8536 insertions, 0 deletions
diff --git a/obsolete/macros/context/contrib/context-fixme/tex/context/third/fixme/t-fixme.mkii b/obsolete/macros/context/contrib/context-fixme/tex/context/third/fixme/t-fixme.mkii new file mode 100644 index 0000000000..4a3b898831 --- /dev/null +++ b/obsolete/macros/context/contrib/context-fixme/tex/context/third/fixme/t-fixme.mkii @@ -0,0 +1,216 @@ +%D \module +%D [ file=t-fixme, +%D version=2013.03.03, +%D title=\CONTEXT\ User Module, +%D subtitle=FiXme, +%D author=Wolfgang Schuster, +%D date=\currentdate, +%D copyright=Wolfgang Schuster, +%D email=schuster.wolfgang@gmail.com, +%D license=Public Domain] + +\writestatus{loading}{Context User Module / FiXme} + +\unprotect + +%D Logo + +\def\fixmelogo{{\ss FiXme}} \logo[FIXME]{\fixmelogo} + +\startinterface all + \setinterfaceconstant {version} {version} +\stopinterface + +\startinterface all + \setinterfacevariable {fixme} {fixme} + \setinterfacevariable {fixmes} {fixmes} + \setinterfacevariable {fatal} {fatal} + \setinterfacevariable {note} {note} + \setinterfacevariable {warning} {warning} + \setinterfacevariable {error} {error} + \setinterfacevariable {total} {total} + \setinterfacevariable {draft} {draft} + \setinterfacevariable {fxnote} {fxnote} + \setinterfacevariable {fxwarning} {fxwarning} + \setinterfacevariable {fxerror} {fxerror} +\stopinterface + +%D Messages + +\definemessageconstant {fixme} + +\startinterface all + \setinterfacemessage{fixme}{title}{FiXme} + \setinterfacemessage{fixme}{1} {Number of notes: --} + \setinterfacemessage{fixme}{2} {Number of warnings: --} + \setinterfacemessage{fixme}{3} {Number of errors: --} + \setinterfacemessage{fixme}{4} {Number of fatal errors: --} + \setinterfacemessage{fixme}{5} {Total: --} +\stopinterface + +%D \macros +%D {setupfixme} +%D +%D Namespace and setup command + +\def\????fx{@@@@fx} % FiXme + +\def\fixmeparameter#1{\csname\????fx\currentfixme#1\endcsname} + +\def\setupfixme + {\dodoubleempty\dosetupfixme} + +\def\dosetupfixme[#1][#2]% + {\ifsecondargument + \dodoubleargumentwithset\dodosetupfixme[#1][#2]% + \else + \dodosetupfixme[][#1]% + \fi} + +\def\dodosetupfixme[#1][#2]% + {\edef\currentfixme{#1}% + \getparameters[\????fx\currentfixme][#2]} + +%D Lists + +\definelist[\v!fixme][\c!width=\zeropoint] + +\setvalue{\e!place \e!listof\v!fixmes}{\placelist [\v!fixme]} +\setvalue{\e!complete\e!listof\v!fixmes}{\completelist[\v!fixme]} + +%D \macros +%D {fixme,fxnote,fxwarning,fxerror, +%D definefixme,definefixmelocation} +%D +%D Commands + +\makecounter{\????fx\v!note } % \pluscounter is not so +\makecounter{\????fx\v!warning} % clever as \increment +\makecounter{\????fx\v!error } % and I have to define +\makecounter{\????fx\v!fatal } % the counters before +\makecounter{\????fx\v!total } % I can use them + +\def\dofixme[#1][#2]#3% + {\removeunwantedspaces + \bgroup + \setupfixme[#1][\c!location={#2}] + \expanded{\writetolist[\v!fixme]{}{\labeltext{fixme\fixmeparameter\c!type}#3}}% + \pluscounter{\????fx\v!total }% + \pluscounter{\????fx\fixmeparameter\c!type}% + \doif{\fixmeparameter\c!version}\v!draft + {\processcommacommand[\fixmeparameter\c!location]{\expanded{\dofixmelocation{\fixmeparameter\c!type}}{#3}}}% + \egroup} + +\def\dofixmelocation#1#2#3{\executeifdefined{@@fixme@@#3}\gobbleoneargument{\labeltext{fixme#1}#2}} + +\def\definefixmelocation + {\dodoubleargument\dodefinefixmelocation} + +\def\dodefinefixmelocation[#1][#2]% + {\setvalue{@@fixme@@#1}{#2}} + +\definefixmelocation [\v!text ] [\ifhmode\normalspace\fi] +\definefixmelocation [\v!margin ] [\inright ] +\definefixmelocation [\v!footnote] [\footnote ] +\definefixmelocation [\v!left ] [\inleft ] +\definefixmelocation [\v!right ] [\inright ] +\definefixmelocation [\v!inner ] [\ininner ] +\definefixmelocation [\v!outer ] [\inouter ] + +\def\dostartfixme[#1][#2]% + {\bgroup + \setupfixme[#1][\c!list=,#2]% + \doifelse{\fixmeparameter\c!version}\v!draft + {\doifsomething{\fixmeparameter\c!list}{\expanded{\writetolist[\v!fixme]{}{\labeltext{fixme\fixmeparameter\c!type}\fixmeparameter\c!list}}}% + \pluscounter{\????fx\v!total }% + \pluscounter{\????fx\fixmeparameter\c!type}% + \fixmeparameter\c!before} + {\egroup\@EA\gobbleuntil\csname\e!stop#1\endcsname}} + +\def\dostopfixme + {\fixmeparameter\c!after + \egroup} + +\def\definefixme + {\dodoubleargument\dodefinefixme} + +\def\dodefinefixme[#1][#2]% + {\getparameters + [\????fx#1] + [\c!before=\@@@@fxbefore, + \c!after=\@@@@fxafter, + \c!location=\@@@@fxlocation, + \c!version=\@@@@fxversion, + \c!type=\v!fatal, + #2]% + \setvalue {#1}{\dodoubleempty\dofixme [#1]}% + \setvalue{\e!start#1}{\dodoubleempty\dostartfixme[#1]}% + \setvalue{\e!stop #1}{\dostopfixme}} + +\definefixme [\v!fixme ] [\c!type=\v!fatal ] +\definefixme [\v!fxnote ] [\c!type=\v!note ] +\definefixme [\v!fxwarning] [\c!type=\v!warning] +\definefixme [\v!fxerror ] [\c!type=\v!error ] + +\appendtoks + \showmessage\m!fixme{1}{\countervalue{\????fx\v!note }}% + \showmessage\m!fixme{2}{\countervalue{\????fx\v!warning}}% + \showmessage\m!fixme{3}{\countervalue{\????fx\v!error }}% + \showmessage\m!fixme{4}{\countervalue{\????fx\v!fatal }}% + \showmessage\m!fixme{5}{\countervalue{\????fx\v!total }}% +\to \everynotabene + +%D Labels + +\setupheadtext[\s!en][fixme=List of Corrections] +\setupheadtext[\s!de][fixme=Verzeichnis der Korrekturen] +\setupheadtext[\s!fr][fixme=Liste des Corrections] +\setupheadtext[\s!it][fixme=Corrigenda] +\setupheadtext[\s!es][fixme=Lista de Correcciones] +\setupheadtext[\s!da][fixme=Rettelser] +\setupheadtext[\s!hr][fixme=Popis korekcija] + +\setuplabeltext[\s!en][fixmenote=\fixmelogo~Note: ] +\setuplabeltext[\s!en][fixmewarning=\fixmelogo~Warning: ] +\setuplabeltext[\s!en][fixmeerror=\fixmelogo~Error: ] +\setuplabeltext[\s!en][fixmefatal=\fixmelogo: ] + +\setuplabeltext[\s!de][fixmenote=\fixmelogo~Anm.: ] +\setuplabeltext[\s!de][fixmewarning=\fixmelogo~Warnung: ] +\setuplabeltext[\s!de][fixmeerror=\fixmelogo~Fehler: ] +\setuplabeltext[\s!de][fixmefatal=\fixmelogo] + +\setuplabeltext[\s!fr][fixmenote=\fixmelogo~Note: ] +\setuplabeltext[\s!fr][fixmewarning=\fixmelogo~Attention: ] +\setuplabeltext[\s!fr][fixmeerror=\fixmelogo~Erreur: ] +\setuplabeltext[\s!fr][fixmefatal=\fixmelogo: ] + +\setuplabeltext[\s!it][fixmenote=\fixmelogo~Nota: ] +\setuplabeltext[\s!it][fixmewarning=\fixmelogo~Avviso: ] +\setuplabeltext[\s!it][fixmeerror=\fixmelogo~Errore: ] +\setuplabeltext[\s!it][fixmefatal=\fixmelogo: ] + +\setuplabeltext[\s!es][fixmenote=\fixmelogo~Nota: ] +\setuplabeltext[\s!es][fixmewarning=\fixmelogo~Aviso: ] +\setuplabeltext[\s!es][fixmeerror=\fixmelogo~Error: ] +\setuplabeltext[\s!es][fixmefatal=\fixmelogo: ] + +\setuplabeltext[\s!da][fixmenote=\fixmelogo~Note: ] +\setuplabeltext[\s!da][fixmewarning=\fixmelogo~Advarsel: ] +\setuplabeltext[\s!da][fixmeerror=\fixmelogo~Fejl: ] +\setuplabeltext[\s!da][fixmefatal=\fixmelogo: ] + +\setuplabeltext[\s!hr][fixmenote=\fixmelogo~Poruka: ] +\setuplabeltext[\s!hr][fixmewarning=\fixmelogo~Upozorenje: ] +\setuplabeltext[\s!hr][fixmeerror=\fixmelogo~Gre\scaron ska: ] +\setuplabeltext[\s!hr][fixmefatal=\fixmelogo: ] + +%D Defaults + +\setupfixme + [\c!before=\startquotation, + \c!after=\stopquotation, + \c!location=\v!margin, + \c!version=\v!draft] + +\protect \endinput diff --git a/obsolete/macros/context/contrib/context-fixme/tex/context/third/fixme/t-fixme.mkiv b/obsolete/macros/context/contrib/context-fixme/tex/context/third/fixme/t-fixme.mkiv new file mode 100644 index 0000000000..f770846ab6 --- /dev/null +++ b/obsolete/macros/context/contrib/context-fixme/tex/context/third/fixme/t-fixme.mkiv @@ -0,0 +1,263 @@ +%D \module +%D [ file=t-fixme, +%D version=2013.03.03, +%D title=\CONTEXT\ User Module, +%D subtitle=FiXme, +%D author=Wolfgang Schuster, +%D date=\currentdate, +%D copyright=Wolfgang Schuster, +%D email=schuster.wolfgang@gmail.com, +%D license=Public Domain] + +\writestatus{loading}{Context User Module / FiXme} + +\unprotect + +%D Logo + +\def\fixmelogo{{\ss FiXme}} \logo[FIXME]{\fixmelogo} + +\startinterface all + \setinterfaceconstant {version} {version} +\stopinterface + +\startinterface all + \setinterfacevariable {fixme} {fixme} + \setinterfacevariable {fixmes} {fixmes} + \setinterfacevariable {fatal} {fatal} + \setinterfacevariable {note} {note} + \setinterfacevariable {warning} {warning} + \setinterfacevariable {error} {error} + \setinterfacevariable {total} {total} + \setinterfacevariable {draft} {draft} + \setinterfacevariable {fxnote} {fxnote} + \setinterfacevariable {fxwarning} {fxwarning} + \setinterfacevariable {fxerror} {fxerror} +\stopinterface + +%D Messages + +\definemessageconstant {fixme} + +\startinterface all + \setinterfacemessage{fixme}{title}{FiXme} + \setinterfacemessage{fixme}{1} {Number of notes: --} + \setinterfacemessage{fixme}{2} {Number of warnings: --} + \setinterfacemessage{fixme}{3} {Number of errors: --} + \setinterfacemessage{fixme}{4} {Number of fatal errors: --} + \setinterfacemessage{fixme}{5} {Total: --} +\stopinterface + +%D \macros +%D {setupfixme} +%D +%D Namespace and setup command + +\installnamespace {fixme} +\installnamespace {fixmecounter} +\installnamespace {fixmelocation} +\installnamespace {fixmerenderings} + +\installcommandhandler \????fixme {fixme} \????fixme +\installcommandhandler \????fixmelocation {fixmelocation} \????fixmelocation + +%D \starttyping +%D \def\setupfixme +%D {\dosingleargument\dosetupfixme} +%D +%D \def\dosetupfixme[#1]% +%D {\doifassignmentelse{#1} +%D {\getparameters[\????fx][#1]} +%D {\setvalue{\????fx\c!version}{#1}}} +%D \stoptyping + +%D Lists + +\definelist[\v!fixme][\c!width=\zeropoint] + +\setvalue{\e!place \e!listof\v!fixmes}{\placelist [\v!fixme]} +\setvalue{\e!complete\e!listof\v!fixmes}{\completelist[\v!fixme][\v!fixmes]} + +%D \macros +%D {fixme,fxnote,fxwarning,fxerror, +%D definefixme,definefixmelocation} +%D +%D Commands + +\appendtoks + \setuevalue {\currentfixme}{\fixme_direct{\currentfixme}}% + \setuevalue{\e!start\currentfixme}{\fixme_start {\currentfixme}}% + \setuevalue{\e!stop \currentfixme}{\fixme_stop }% +\to \everydefinefixme + +\definecounter[\????fixmecounter\v!note ] +\definecounter[\????fixmecounter\v!warning] +\definecounter[\????fixmecounter\v!error ] +\definecounter[\????fixmecounter\v!fatal ] +\definecounter[\????fixmecounter\v!total ] + +\unexpanded\def\fixme_direct#1% + {\edef\currentfixme{#1}% + \dosingleempty\fixme_direct_indeed} + +\def\fixme_direct_indeed[#1]#2% + {\removeunwantedspaces + \begingroup + \setupcurrentfixme[\c!location={#1},\c!text={#2}]% + \edef\p_fixme_version {\fixmeparameter\c!version }% + \edef\p_fixme_type {\fixmeparameter\c!type }% + \edef\p_fixme_location{\fixmeparameter\c!location}% + \edef\p_fixme_text {\fixmeparameter\c!text }% + \ifx\p_fixme_location\empty + \let\p_fixme_location\v!margin + \fi + \ifx\p_fixme_version\v!draft + \normalexpanded{\writetolist[\v!fixme]{}{\fixmetext{\p_fixme_type}\p_fixme_text}}% + \incrementcounter[\????fixmecounter\v!total ]% + \incrementcounter[\????fixmecounter\p_fixme_type]% + \processcommacommand[\p_fixme_location]\fixme_location + \fi + \endgroup} + +\def\fixme_location#1% + {\edef\currentfixmelocation{#1}% + \ifcsname\currentfixmelocationhash\s!parent\endcsname \else + \let\currentfixmelocation\v!margin + \fi + \edef\p_fixme_renderingsetup{\fixmelocationparameter\c!renderingsetup}% + \texsetup\p_fixme_renderingsetup} + +\unexpanded\def\fixme_start#1% + {\begingroup + \edef\currentfixme{#1}% + \dosingleempty\fixme_start_indeed} + +\def\fixme_start_indeed[#1]% + {\iffirstargument + \setupcurrentfixme[#1]% + \fi + \grabbufferdatadirect\v!fixme{\e!start\currentfixme}{\e!stop\currentfixme}} + +\unexpanded\def\fixme_stop + {\edef\p_fixme_version{\fixmeparameter\c!version}% + \edef\p_fixme_list {\fixmeparameter\c!list }% + \edef\p_fixme_type {\fixmeparameter\c!type }% + \ifx\p_fixme_version\v!draft + \ifx\p_fixme_list\empty \else + \normalexpanded{\writetolist[\v!fixme]{}{\fixmetext\p_fixme_type\p_fixme_list}}% + \fi + \incrementcounter[\????fixmecounter\v!total ]% + \incrementcounter[\????fixmecounter\p_fixme_type]% + \fixmeparameter\c!before + \getbufferdata[\v!fixme]% + \fixmeparameter\c!after + \fi + \endgroup} + +\definefixmelocation [\v!text] [\c!renderingsetup=\????fixmerenderings:\v!text] + +\startsetups[\????fixmerenderings:\v!text] + \ifhmode\normalspace\fi + \fixmetext\p_fixme_type + \p_fixme_text +\stopsetups + +\definefixmelocation [\v!command] [\c!renderingsetup=\????fixmerenderings:\v!command] +\definefixmelocation [\v!margin] [\v!command] [\c!command=\inright] +\definefixmelocation [\v!footnote] [\v!command] [\c!command=\footnote] +\definefixmelocation [\v!left] [\v!command] [\c!command=\inleft] +\definefixmelocation [\v!right] [\v!command] [\c!command=\inright] +\definefixmelocation [\v!inner] [\v!command] [\c!command=\ininner] +\definefixmelocation [\v!outer] [\v!command] [\c!command=\inouter] + +\startsetups[\????fixmerenderings:\v!command] + \edef\p_fixme_command{\fixmelocationparameter\c!command}% + \normalexpanded{\p_fixme_command{\fixmetext{\p_fixme_type}\p_fixme_text}} +\stopsetups + +\definefixmelocation [\v!none] [\c!renderingsetup=\????fixmerenderings:\v!none] + +\startsetups[\????fixmerenderings:\v!none] + % EMPTY +\stopsetups + +%D \starttyping +%D \def\definefixme +%D {\dodoubleargument\dodefinefixme} +%D +%D \def\dodefinefixme[#1][#2]% +%D {\setvalue {#1}{\dodoubleempty\dofixme [#2]}% +%D \setvalue{\e!start#1}{\dodoubleempty\dostartfixme[#2]}% +%D \setvalue{\e!stop #1}{\dostopfixme}} +%D \stoptyping + +\appendtoks + \showmessage\m!fixme{1}{\rawcountervalue[\????fixmecounter\v!note ]}% + \showmessage\m!fixme{2}{\rawcountervalue[\????fixmecounter\v!warning]}% + \showmessage\m!fixme{3}{\rawcountervalue[\????fixmecounter\v!error ]}% + \showmessage\m!fixme{4}{\rawcountervalue[\????fixmecounter\v!fatal ]}% + \showmessage\m!fixme{5}{\rawcountervalue[\????fixmecounter\v!total ]}% +\to \everynotabene + +% Labels + +\definelabelclass[fixme] + +\setupheadtext [\s!en] [\v!fixme=List of Corrections] +\setupheadtext [\s!de] [\v!fixme=Verzeichnis der Korrekturen] +\setupheadtext [\s!fr] [\v!fixme=Liste des Corrections] +\setupheadtext [\s!it] [\v!fixme=Corrigenda] +\setupheadtext [\s!es] [\v!fixme=Lista de Correcciones] +\setupheadtext [\s!da] [\v!fixme=Rettelser] +\setupheadtext [\s!hr] [\v!fixme=Popis korekcija] + +\setupfixmetext [\s!en] [\v!note=\fixmelogo~Note: ] +\setupfixmetext [\s!en] [\v!warning=\fixmelogo~Warning: ] +\setupfixmetext [\s!en] [\v!error=\fixmelogo~Error: ] +\setupfixmetext [\s!en] [\v!fatal=\fixmelogo: ] + +\setupfixmetext [\s!de] [\v!note=\fixmelogo~Anm.: ] +\setupfixmetext [\s!de] [\v!warning=\fixmelogo~Warnung: ] +\setupfixmetext [\s!de] [\v!error=\fixmelogo~Fehler: ] +\setupfixmetext [\s!de] [\v!fatal=\fixmelogo] + +\setupfixmetext [\s!fr] [\v!note=\fixmelogo~Note: ] +\setupfixmetext [\s!fr] [\v!warning=\fixmelogo~Attention: ] +\setupfixmetext [\s!fr] [\v!error=\fixmelogo~Erreur: ] +\setupfixmetext [\s!fr] [\v!fatal=\fixmelogo: ] + +\setupfixmetext [\s!it] [\v!note=\fixmelogo~Nota: ] +\setupfixmetext [\s!it] [\v!warning=\fixmelogo~Avviso: ] +\setupfixmetext [\s!it] [\v!error=\fixmelogo~Errore: ] +\setupfixmetext [\s!it] [\v!fatal=\fixmelogo: ] + +\setupfixmetext [\s!es] [\v!note=\fixmelogo~Nota: ] +\setupfixmetext [\s!es] [\v!warning=\fixmelogo~Aviso: ] +\setupfixmetext [\s!es] [\v!error=\fixmelogo~Error: ] +\setupfixmetext [\s!es] [\v!fatal=\fixmelogo: ] + +\setupfixmetext [\s!da] [\v!note=\fixmelogo~Note: ] +\setupfixmetext [\s!da] [\v!warning=\fixmelogo~Advarsel: ] +\setupfixmetext [\s!da] [\v!error=\fixmelogo~Fejl: ] +\setupfixmetext [\s!da] [\v!fatal=\fixmelogo: ] + +\setupfixmetext [\s!hr] [\v!note=\fixmelogo~Poruka: ] +\setupfixmetext [\s!hr] [\v!warning=\fixmelogo~Upozorenje: ] +\setupfixmetext [\s!hr] [\v!error=\fixmelogo~Gre\scaron ska: ] +\setupfixmetext [\s!hr] [\v!fatal=\fixmelogo: ] + +% Default commands and settings + +\definefixme [\v!fixme ] [\c!type=\v!fatal ] +\definefixme [\v!fxnote ] [\c!type=\v!note ] +\definefixme [\v!fxwarning] [\c!type=\v!warning] +\definefixme [\v!fxerror ] [\c!type=\v!error ] + +\setupfixme + [ \c!before=\startquotation, + \c!after=\stopquotation, + \c!location=\v!margin, + \c!version=\v!draft, + \c!type=\v!fatal] + +\protect \endinput diff --git a/obsolete/macros/context/contrib/context-games/doc/context/third/games/README b/obsolete/macros/context/contrib/context-games/doc/context/third/games/README new file mode 100644 index 0000000000..b96a6e8966 --- /dev/null +++ b/obsolete/macros/context/contrib/context-games/doc/context/third/games/README @@ -0,0 +1,26 @@ +Games Module for ConTeXt + + +Introduction +------------ + +The games module provides the function to create static and interactive versions +of board games. The first release has support for Go and Hex, more games follow +in later releases. + +To use the module write \usemodule[games] in the preamble of your document. + +The module works only with MkIV (LuaTeX), it is not planned to add MkII support. + + +License +------- + +The module is copyrighted by Wolfgang Schuster and published under Public Domain. + + +Revision History +---------------- + +2009-01-08 +Initial release
\ No newline at end of file diff --git a/obsolete/macros/context/contrib/context-games/doc/context/third/games/games-doc.pdf b/obsolete/macros/context/contrib/context-games/doc/context/third/games/games-doc.pdf Binary files differnew file mode 100644 index 0000000000..000c874596 --- /dev/null +++ b/obsolete/macros/context/contrib/context-games/doc/context/third/games/games-doc.pdf diff --git a/obsolete/macros/context/contrib/context-games/tex/context/third/games/games-go.lua b/obsolete/macros/context/contrib/context-games/tex/context/third/games/games-go.lua new file mode 100644 index 0000000000..fdf2c09bc3 --- /dev/null +++ b/obsolete/macros/context/contrib/context-games/tex/context/third/games/games-go.lua @@ -0,0 +1,537 @@ +if not modules then modules = { } end modules ['games-go'] = { + version = 1.000, + comment = "Go", + author = "Wolfgang Schuster", + copyright = "Wolfgang Schuster", + email = "schuster.wolfgang@googlemail.com", + license = "Public Domain" +} + +do + +thirddata = thirddata or { } +thirddata.games = thirddata.games or { } +thirddata.games.go = thirddata.games.go or { } +thirddata.games.go.field = thirddata.games.go.field or { } +thirddata.games.go.setup = thirddata.games.go.setup or { } +thirddata.games.go.deadstone = thirddata.games.go.deadstone or { } + +local nx = function() return thirddata.games.go.setup.nx end +local ny = function() return thirddata.games.go.setup.ny end +local dx = function() return thirddata.games.go.setup.dx end +local dy = function() return thirddata.games.go.setup.dy end +local offset = function() return thirddata.games.go.setup.offset end +local size = function() return thirddata.games.go.setup.stonesize end +local board = function() return thirddata.games.go.setup.board end +local distance = function() return thirddata.games.go.setup.labeldistance end +local symbolset = function() return thirddata.games.go.setup.symbolset end +local alternative = function() return thirddata.games.go.setup.alternative end +local bp = function(value) return number.tobasepoints(value) end +local sp = function(value) return value * 65536/(7227/7200) end +local line = function(k,v,s) return bp(thirddata.games.go.lines [k][v]*s) end +local arrow = function(k,v,s) return bp(thirddata.games.go.arrows[k][v]*s) end + +-- Drawing functions + +thirddata.games.go.lastcolor = 0 +thirddata.games.go.currentmove = 0 + +function thirddata.games.go.move(color) + thirddata.games.go.lastcolor = color + thirddata.games.go.currentmove = thirddata.games.go.currentmove + 1 +end + +thirddata.games.go.linecount = 0 +thirddata.games.go.lines = { } + +function thirddata.games.go.line(x1,y1,x2,y2) + thirddata.games.go.linecount = thirddata.games.go.linecount + 1 + thirddata.games.go.lines[thirddata.games.go.linecount] = { x1, y1, x2, y2 } +end + +thirddata.games.go.arrowcount = 0 +thirddata.games.go.arrows = { } + +function thirddata.games.go.arrow(x1,y1,x2,y2) + thirddata.games.go.arrowcount = thirddata.games.go.arrowcount + 1 + thirddata.games.go.arrows[thirddata.games.go.arrowcount] = { x1, y1, x2, y2 } +end + +function thirddata.games.go.board_color() + if thirddata.games.go.setup['backgroundcolor'] ~= nil then + tex.sprint("board := currentpicture ;") + tex.sprint("currentpicture := nullpicture ;") + tex.sprint("fill unitsquare xyscaled (" .. bp((nx()-1)*dx()+2*offset()) .. "," .. bp((ny()-1)*dy()+2*offset()) .. ")") + tex.sprint("shifted (" .. bp(-offset()) .. "," .. bp(-offset()) .. ")") + tex.sprint("withcolor \\MPcolor{" .. thirddata.games.go.setup['backgroundcolor'] .. "} ;") + tex.sprint("addto currentpicture also board ;") + end +end + +thirddata.games.go.setup.figurewidth = 0 +thirddata.games.go.setup.figureheight = 0 + +function thirddata.games.go.board_figure() + local width = thirddata.games.go.setup.figurewidth + local height = thirddata.games.go.setup.figureheight + local columns = math.floor( ((nx()-1)*dx()+2*offset()) / width ) -- floor and not ceil because + local rows = math.floor( ((ny()-1)*dy()+2*offset()) / height ) -- I start from 0 and not 1 + if thirddata.games.go.setup['backgroundimage'] ~= nil then + tex.sprint("board := currentpicture ;") + tex.sprint("currentpicture := nullpicture ;") + for row=0,rows do + for col=0,columns do + tex.sprint('externalfigure "' .. thirddata.games.go.setup['backgroundimage'] .. '"') + tex.sprint('xyscaled (' .. bp(width) .. ',' .. bp(height) .. ')') + tex.sprint('shifted (' .. bp(-offset()+row*width) .. ',' .. bp(-offset()+col*height) .. ') ;') + end + end + tex.sprint("mine := unitsquare xyscaled (" .. bp((nx()-1)*dx()+2*offset()) .. "," .. bp((ny()-1)*dy()+2*offset()) .. ")") + tex.sprint(" shifted (" .. bp(-offset()) .. "," .. bp(-offset()) .. ") ;") + tex.sprint("clip currentpicture to mine ;") + tex.sprint("addto currentpicture also board ;") + end +end + +function thirddata.games.go.board_new() + local xy = 0 + thirddata.games.go.field[0] = { } + for col=0,nx()+1 do + thirddata.games.go.field[0][col] = { } + for row=0,ny()+1 do + if col==0 then + xy = 3 + elseif col==nx()+1 then + xy = 3 + elseif row==0 then + xy = 3 + elseif row==ny()+1 then + xy = 3 + else + xy = 0 + end + thirddata.games.go.field[0][col][row] = { color = xy, marker = nil, label = nil, move = nil } + end + end +end + +function thirddata.games.go.board_copy(from,to) + thirddata.games.go.field[to] = { } + for k,v in pairs(thirddata.games.go.field[from]) do + thirddata.games.go.field[to][k] = { } + for x,y in pairs(thirddata.games.go.field[from][k]) do + thirddata.games.go.field[to][k][x] = { } + for a,b in pairs(thirddata.games.go.field[from][k][x]) do + thirddata.games.go.field[to][k][x][a] = thirddata.games.go.field[from][k][x][a] + end + end + end +end + +function thirddata.games.go.board_lines_solid() + for col=1,nx() do + tex.sprint("draw (" .. bp((col-1)*dx()) .. ",0) -- (" .. bp((col-1)*dx()) .. "," .. bp((ny()-1)*dy()) .. ") ;") + end + for row=1,ny() do + tex.sprint("draw (0," .. bp((row-1)*dy()) .. ") -- (" .. bp((nx()-1)*dx()) .. "," .. bp((row-1)*dy()) .. ") ;") + end +end + +function thirddata.games.go.board_lines_gap() + -- draw horizontal rules + for row=2,ny()-1 do + for col=1,nx()-1 do + if thirddata.games.go.field[0][col][row]['color'] == 0 then + tex.sprint("draw (" .. bp((col-1)*dx()) .. "," .. bp((row-1)*dy()) .. ") -- (" .. bp((col)*dx()) .. "," .. bp((row-1)*dy()) .. ") ;") + else + if thirddata.games.go.field[0][col+1][row]['color'] == 0 then + tex.sprint("draw (" .. bp((col-1)*dx()) .. "," .. bp((row-1)*dy()) .. ") -- (" .. bp((col)*dx()) .. "," .. bp((row-1)*dy()) .. ") ;") + end + end + end + end + -- draw vertical rules + for col=2,nx()-1 do + for row=1,ny()-1 do + if thirddata.games.go.field[0][col][row]['color'] == 0 then + tex.sprint("draw (" .. bp((col-1)*dx()) .. "," .. bp((row-1)*dy()) .. ") -- (" .. bp((col-1)*dx()) .. "," .. bp((row)*dy()) .. ") ;") + else + if thirddata.games.go.field[0][col][row+1]['color'] == 0 then + tex.sprint("draw (" .. bp((col-1)*dx()) .. "," .. bp((row-1)*dy()) .. ") -- (" .. bp((col-1)*dx()) .. "," .. bp((row)*dy()) .. ") ;") + end + end + end + end + -- draw border frame + tex.sprint("draw (0,0) -- (0," .. bp((ny()-1)*dy()) .. ") ;") + tex.sprint("draw (" .. bp((nx()-1)*dx()).. ",0) -- (" .. bp((nx()-1)*dx()).. "," .. bp((ny()-1)*dy()) .. ") ;") + tex.sprint("draw (0,0) -- (" .. bp((nx()-1)*dx()) .. ",0) ;") + tex.sprint("draw (0," .. bp((ny()-1)*dy()).. ") -- (" .. bp((nx()-1)*dx()).. "," .. bp((ny()-1)*dy()) .. ") ;") +end + +-- Note: I need to define the alternatives before I can use the test + +thirddata.games.go.linestyles = + { + a = thirddata.games.go.board_lines_solid , + b = thirddata.games.go.board_lines_gap , + } + +function thirddata.games.go.board_lines() + if thirddata.games.go.linestyles[alternative()]==nil then + thirddata.games.go.board_lines_solid() + else + thirddata.games.go.linestyles[alternative()]() + end +end + +function thirddata.games.go.board_hoshi() + for col=1,nx() do + for row=1,ny() do + tex.sprint("\\ifcsname go:hoshi:" .. row .. ":" .. col .. ":" .. board() .. "\\endcsname") + tex.sprint("\\csname go:marker:hoshi\\endcsname") + tex.sprint("{" .. bp(size()/5) .. "}") + tex.sprint("{" .. bp((col-1)*dx()) .. "}") + tex.sprint("{" .. bp((row-1)*dy()) .. "}") + tex.sprint("\\fi") + end + end +end + +function thirddata.games.go.board_stones() + for col=1,nx() do + for row=1,ny() do + local color = thirddata.games.go.field[0][col][row]['color'] + if color==1 then + tex.sprint("\\csname go:stone:" .. symbolset() .. ":black\\endcsname") + tex.sprint("{" .. bp(size()) .. "}") + tex.sprint("{" .. bp((col-1)*dx()) .. "}") + tex.sprint("{" .. bp((row-1)*dy()) .. "}") + elseif color==2 then + tex.sprint("\\csname go:stone:" .. symbolset() .. ":white\\endcsname") + tex.sprint("{" .. bp(size()) .. "}") + tex.sprint("{" .. bp((col-1)*dx()) .. "}") + tex.sprint("{" .. bp((row-1)*dy()) .. "}") + end + end + end +end + +function thirddata.games.go.board_marker() + for col=1,nx() do + for row=1,ny() do + local marker = thirddata.games.go.field[0][col][row]['marker'] + local label = thirddata.games.go.field[0][col][row]['label'] + if marker==nil then + elseif marker=='label' then + tex.sprint("\\csname go:marker:label\\endcsname") + tex.sprint("{" .. label .. "}") + tex.sprint("{" .. bp((col-1)*dx()) .. "}") + tex.sprint("{" .. bp((row-1)*dy()) .. "}") + else + tex.sprint("\\ifcsname go:marker:" .. marker .. "\\endcsname") + tex.sprint("\\csname go:marker:" .. marker .. "\\endcsname") + tex.sprint("{" .. nx() .. "}") + tex.sprint("{" .. ny() .. "}") + tex.sprint("{" .. bp(dx()) .. "}") + tex.sprint("{" .. bp(dy()) .. "}") + tex.sprint("{" .. bp(size()) .. "}") + tex.sprint("{" .. bp((col-1)*dx()) .. "}") + tex.sprint("{" .. bp((row-1)*dy()) .. "}") + tex.sprint("{" .. bp(offset()) .. "}") + tex.sprint("\\fi") + end + end + end +end + +function thirddata.games.go.board_label() + for col=1,nx() do + tex.sprint('label.bot(textext("\\doattributes{@@@@gmgo}{labelstyle}{labelcolor}{\\sgfchar{' .. col .. '}}"),%') + tex.sprint('(' .. bp((col-1)*dx()) .. ',' .. bp(-distance()) .. ')) ;') + end + for row=1,ny() do + tex.sprint('label.lft(textext("\\doattributes{@@@@gmgo}{labelstyle}{labelcolor}{' .. row .. '}"),%') + tex.sprint('(' .. bp(-distance()) .. ',' .. bp((row-1)*dy()) .. ')) ;') + end +end + +function thirddata.games.go.board_markerlines() + for k, v in pairs(thirddata.games.go.lines) do + tex.sprint("draw (" .. line(k,1,dx()) .. "," .. line(k,2,dy()) .. ") -- ") + tex.sprint(" (" .. line(k,3,dx()) .. "," .. line(k,4,dy()) .. ") ; ") + end +end + +function thirddata.games.go.board_markerarrows() + for k, v in pairs(thirddata.games.go.arrows) do + tex.sprint("drawarrow (" .. arrow(k,1,dx()) .. "," .. arrow(k,2,dy()) .. ") -- ") + tex.sprint(" (" .. arrow(k,3,dx()) .. "," .. arrow(k,4,dy()) .. ") ; ") + end +end + +function thirddata.games.go.board_size() + tex.sprint("setbounds currentpicture to unitsquare %") + tex.sprint("xyscaled (" .. bp((nx()-1)*dx()+2*offset()) .. "," .. bp((ny()-1)*dy()+2*offset()) .. ")") + tex.sprint("shifted (" .. bp(-offset()) .. "," .. bp(-offset()) .. ") ;") + tex.sprint("draw boundingbox currentpicture withpen pensquare scaled 1.2 ;") +end + +function thirddata.games.go.board_draw(name) + tex.sprint("\\startuseMPgraphic{" .. name .. "}{}") + tex.sprint("path mine ; picture board ;") + -- thirddata.games.go.board_figure() -- not here, I have to do this at the end + thirddata.games.go.board_lines() + thirddata.games.go.board_hoshi() + thirddata.games.go.board_stones() + thirddata.games.go.board_marker() + thirddata.games.go.board_markerlines() + thirddata.games.go.board_markerarrows() + thirddata.games.go.board_label() + thirddata.games.go.board_size() + thirddata.games.go.board_color() + thirddata.games.go.board_figure() + tex.sprint("\\stopuseMPgraphic") +end + + +-- Deadstone calculator + +local stone = function() return thirddata.games.go.deadstone.stone end +local enemy = function() return thirddata.games.go.deadstone.enemy end +local wall = function() return thirddata.games.go.deadstone.wall end +local marked = function() return thirddata.games.go.deadstone.marked end +local error = function() return thirddata.games.go.deadstone.error end +local dead = function() return thirddata.games.go.deadstone.dead end + +function thirddata.games.go.deadstone.black() + thirddata.games.go.deadstone.stone = 1 + thirddata.games.go.deadstone.enemy = 2 + thirddata.games.go.deadstone.wall = 3 + thirddata.games.go.deadstone.marked = 4 + thirddata.games.go.deadstone.error = 6 + thirddata.games.go.deadstone.dead = 7 +end + +function thirddata.games.go.deadstone.white() + thirddata.games.go.deadstone.stone = 2 + thirddata.games.go.deadstone.enemy = 1 + thirddata.games.go.deadstone.wall = 3 + thirddata.games.go.deadstone.marked = 5 + thirddata.games.go.deadstone.error = 6 + thirddata.games.go.deadstone.dead = 7 +end + +thirddata.games.go.deadstone.deadcount = 2 + +function thirddata.games.go.deadstone.doprocesstones() + for i=1,2 do -- for the moment, I have to check the code + thirddata.games.go.deadstone.markstones() + end + thirddata.games.go.deadstone.deadstones() + for n=1,thirddata.games.go.deadstone.deadcount do + thirddata.games.go.deadstone.checkstones() + end + thirddata.games.go.deadstone.revertstones() +end + +function thirddata.games.go.deadstone.processtones() + -- we placed a black stone + if thirddata.games.go.lastcolor==1 then + thirddata.games.go.deadstone.process_white() + thirddata.games.go.deadstone.process_black() + -- we placed a white stone + elseif thirddata.games.go.lastcolor==2 then + thirddata.games.go.deadstone.process_black() + thirddata.games.go.deadstone.process_white() + end +end + +function thirddata.games.go.deadstone.process_black() + thirddata.games.go.deadstone.black() + thirddata.games.go.deadstone.doprocesstones() +end + +function thirddata.games.go.deadstone.process_white() + thirddata.games.go.deadstone.white() + thirddata.games.go.deadstone.doprocesstones() +end + +local field = function(x,y) return thirddata.games.go.field[0][x][y]['color'] end +-- local field_top = function(x,y) return thirddata.games.go.field[0][x][y+1]['color'] end +-- local field_bottom = function(x,y) return thirddata.games.go.field[0][x][y-1]['color'] end +local field_bottom = function(x,y) return thirddata.games.go.field[0][x][y+1]['color'] end +local field_top = function(x,y) return thirddata.games.go.field[0][x][y-1]['color'] end +local field_left = function(x,y) return thirddata.games.go.field[0][x-1][y]['color'] end +local field_right = function(x,y) return thirddata.games.go.field[0][x+1][y]['color'] end + +--[[ldx-- +<p>The <ldx:function>markstones</ldx:function> mark the stones if they +have the right stones on their sides or let them keep untouched.</p> +--ldx]]-- + +function thirddata.games.go.deadstone.markstones() + for col=1,nx() do + for row=1,ny() do + if field(col,row)==stone() then + if (field_left(col,row)==wall() + or field_left(col,row)==enemy() + or field_left(col,row)==marked()) + and (field_right(col,row)==wall() + or field_right(col,row)==enemy() + or field_right(col,row)==stone()) + and (field_bottom(col,row)==wall() + or field_bottom(col,row)==enemy() + or field_bottom(col,row)==marked()) + and (field_top(col,row)==wall() + or field_top(col,row)==enemy() + or field_top(col,row)==stone()) + then + thirddata.games.go.field[0][col][row]['color'] = marked() + end + end + end + end +end + +--[[ldx-- +<p>The <ldx:function>deadstones</ldx:function> set stones with the value marked +to dead if the conditions in the function are true.</p> +--ldx]]-- + +function thirddata.games.go.deadstone.deadstones() + for col=nx(),1,-1 do + for row=ny(),1,-1 do + if field(col,row)==marked() then + if (field_left(col,row)==wall() + or field_left(col,row)==enemy() + or field_left(col,row)==marked()) + and (field_right(col,row)==enemy() + or field_right(col,row)==wall() + or field_right(col,row)==dead()) + and (field_bottom(col,row)==enemy() + or field_bottom(col,row)==wall() + or field_bottom(col,row)==dead()) + then + thirddata.games.go.field[0][col][row]['color'] = dead() + end + end + end + end +end + +--[[ldx-- +<p>Because the <ldx:function>deadstones</ldx:function> can sometimes set +already living stones to dead. To prevent this in the final result this +function looks through all stones with a loop in reverse direction and +reset the values to their original value if the stone is not dead and +should remain on the board. The function is currently called twice within +processtones but this can be changed with the counter deadcount.</p> +--ldx]]-- + +function thirddata.games.go.deadstone.checkstones() + for col=1,nx() do + for row=1,ny() do + if field(col,row)==marked() then + thirddata.games.go.field[0][col][row]['color'] = stone() + elseif thirddata.games.go.field[0][col][row]['color']==dead() then + if (field_left(col,row)==dead() + or field_left(col,row)==enemy() + or field_left(col,row)==wall()) + and (field_right(col,row)==dead() + or field_right(col,row)==enemy() + or field_right(col,row)==wall()) + and (field_bottom(col,row)==dead() + or field_bottom(col,row)==enemy() + or field_bottom(col,row)==wall()) + and (field_top(col,row)==dead() + or field_top(col,row)==enemy() + or field_top(col,row)==wall()) + then + thirddata.games.go.field[0][col][row]['color'] = dead() + else + thirddata.games.go.field[0][col][row]['color'] = stone() + end + end + end + end +end + +--[[ldx-- +<p>The last thing to do after all dead stones are found on the board +is to remove them and to reset all other stones which are still in a +marked state or we will get wrong input for the next move.</p> +--ldx]]-- + +function thirddata.games.go.deadstone.revertstones() + for col=1,nx() do + for row=1,ny() do + if thirddata.games.go.field[0][col][row]['color']==marked() then + thirddata.games.go.field[0][col][row] = stone() + elseif thirddata.games.go.field[0][col][row]['color']==dead() then + thirddata.games.go.field[0][col][row]['color'] = 0 + end + end + end +end + +end + + +-- SGF parser + +do + + thirddata = thirddata or { } + thirddata.games = thirddata.games or { } + thirddata.games.sgf = thirddata.games.sgf or { } + + local function command(name,x) + tex.sprint(string.format("\\csname sgf!%s\\endcsname{%s}",name,x)) + end + + local nodes = { } + + function nodes.B (x) command("black" ,x) end + function nodes.W (x) command("white" ,x) end + function nodes.AW(x) command("addwhite" ,x) end + function nodes.C (x) command("comment" ,x) end + + local function action(what,data) + local a = nodes[what] + if a then + for w in string.gmatch(data, "%b[]") do + a(string.sub(w,2,-2)) + end + else + print("unknown action: " .. what) + end + end + + local function nodecontent(str) + tex.sprint(string.format("\\csname sgf!node\\endcsname{%s}",string.sub(str,2))) + end + + local space = lpeg.S(' \r\n')^1 + local lcletter = lpeg.R("az") + local ucletter = lpeg.R("AZ") + local letter = lcletter + ucletter + + local propindent = ucletter^1 + + local property = lpeg.C(propindent) * lpeg.C{ (lpeg.P("[") * (1 - lpeg.S"[]")^0 * lpeg.P("]"))^1} / action + + local function nest(str) + tex.sprint(tex.ctxcatcodes,string.format("\\parsesgf{%s}",string.sub(str,2,-2))) + end + + local node = lpeg.P{ ";" * (propindent * (lpeg.P("[") * (1 - lpeg.S"[]")^0 * lpeg.P("]"))^1)^1} / nodecontent + local branch = lpeg.P{ "(" * ((1 - lpeg.S"()") + lpeg.V(1))^0 * ")" } / nest + + local parser = (branch + node + property + space)^0 + + function thirddata.games.sgf.parse(str) + parser:match(str) + end + +end diff --git a/obsolete/macros/context/contrib/context-games/tex/context/third/games/games-go.tex b/obsolete/macros/context/contrib/context-games/tex/context/third/games/games-go.tex new file mode 100644 index 0000000000..10e6ce9fe7 --- /dev/null +++ b/obsolete/macros/context/contrib/context-games/tex/context/third/games/games-go.tex @@ -0,0 +1,383 @@ +%D \module +%D [ file=games-go, +%D version=2008.01.10, +%D title=\CONTEXT\ User Module, +%D subtitle=Go, +%D author=Wolfgang Schuster, +%D date=\currentdate, +%D copyright=Wolfgang Schuster, +%D email=schuster.wolfgang@googlemail.com, +%D license=Public Domain] + +\writestatus{loading}{Context User Module / Games - Go} + +\unprotect + +%D The \type{\definegame} command creates the new goban environment, it is +%D important to use the goban environment in a document and not the game +%D environment itself because in sgf mode the content untill \type{\stopgoban} +%D is read and \type{\endgame} is executed at the end of the parsing process. + +\definegame[\v!goban][\v!go] % not final +%\definegame[\v!weiqi][\v!go] +%\definegame[\v!baduk][\v!go] + +%D Convert number into labels for the board, could be replaced with \type{\ifcase} solution (faster?) + +\def\sgfchar#1% + {\ifnum#1<9 + \char\number\numexpr#1+64\relax + \else\ifnum#1<26 + \char\number\numexpr#1+65\relax + \fi\fi} + +%D List with the commands for the user interface + +\def\go!commands + {newboard,saveboard,useboard,drawboard,marker,stone,move,line,arrow} + +\def\go!copygamecommands + {\expanded{\copyparameters[][go!][\go!commands]}} + +\setvalue{\e!begin\????gm\????gm\v!go}% + {\go!copygamecommands + \go!backgroundcolor + \go!backgroundimage + \go!boardsize % should I set the size with \newboard? + \go!boardvalues + \go!inputtype} % input has to be the last command + +\def\go!inputtype + {\doif{\gameparameter\c!option}\v!sgf\go!inputtype!sgf} + +\def\go!inputtype!sgf + {\grabuntil{\if!!gameenvironment\e!stop\currentname\else\s!do\e!stop\v!game\fi}\dogo!inputtype!sgf} + +\def\dogo!inputtype!sgf#1% + {\newboard + \parsesgf{#1}% + \drawboard + \dostopgame} + +\defineoverlay[overlay:go][\overlaybutton{JS(Walk_Field{games!go})}] + +\setvalue{\e!end\????gm\????gm\v!go}% + {\doif{\gameparameter\c!interactive}\v!yes\go!fieldstack} + +\def\go!fieldstack + {\expanded{\definefieldstack[games!go][\go!list!symbols][\c!frame=\v!off]}% + \framed + [\c!frame=\v!off, + \c!background={foreground,overlay:go}, + \c!offset=\v!overlay] + {\fieldstack[games!go]}} + +\def\go!backgroundcolor + {\doifsomethingelse{\gameparameter\c!backgroundcolor} + {\ctxlua{thirddata.games.go.setup['backgroundcolor'] = '\gameparameter\c!backgroundcolor' }}% + {\ctxlua{thirddata.games.go.setup['backgroundcolor'] = nil }}} + +\def\go!backgroundimage % use groups to keep the dimensions local + {\doifsomethingelse{\gameparameter\c!backgroundimage} + {\ctxlua{thirddata.games.go.setup['backgroundimage'] = '\gameparameter\c!backgroundimage' }% + \getfiguredimensions[\gameparameter\c!backgroundimage][scale=500]% I need a scale parameter + \ctxlua{thirddata.games.go.setup.figurewidth = \number\dimexpr\figurewidth \relax }% + \ctxlua{thirddata.games.go.setup.figureheight = \number\dimexpr\figureheight\relax }}% + {\ctxlua{thirddata.games.go.setup.backgroundimage = nil }}} + +\def\go!boardsize + {\assignvalue{\gameparameter\c!size}\go!board!size{9}{13}{19}% size is only used for hoshi points + \assignvalue{\gameparameter\c!nx }\go!board!nx {9}{13}{19}% + \assignvalue{\gameparameter\c!ny }\go!board!ny {9}{13}{19}% + \ctxlua{thirddata.games.go.setup.board = \number\go!board!size }% + \ctxlua{thirddata.games.go.setup.nx = \number\go!board!nx }% + \ctxlua{thirddata.games.go.setup.ny = \number\go!board!ny }} + +\def\go!boardvalues + {\startlua + thirddata.games.go.setup.dx = \number\dimexpr\gameparameter\c!dx\relax ; + thirddata.games.go.setup.dy = \number\dimexpr\gameparameter\c!dy\relax ; + thirddata.games.go.setup.offset = \number\dimexpr\gameparameter\c!frameoffset\relax ; + thirddata.games.go.setup.labeldistance = \number\dimexpr\gameparameter\c!labeldistance\relax ; + thirddata.games.go.setup.stonesize = \number\dimexpr\gameparameter\c!stonesize\relax ; + thirddata.games.go.setup.symbolset = '\gameparameter\c!symbolset' ; + thirddata.games.go.setup.alternative = '\gameparameter\c!alternative' ; + \stoplua} + +%D User command with protected names + +\def\go!newboard + {\ctxlua{thirddata.games.go.board_new()}% + \doif{\gameparameter\c!interactive}\v!yes\go!symbol} % too early, I should take care of \stone + +\def\go!saveboard#1% + {\ctxlua{thirddata.games.go.board_copy( 0, '#1' )}} + +\def\go!useboard#1% + {\ctxlua{thirddata.games.go.board_copy( '#1', 0 )}} + +\def\go!drawboard + {\doifnot{\gameparameter\c!interactive}\v!yes + {\go!setboard{0}% + \go!getboard{0}}} + +\def\go!setboard#1% + {\ctxlua{thirddata.games.go.board_draw("games:go:#1")}} + +\def\go!getboard#1% + {\useMPgraphic{games:go:#1}} + +\def\go!marker + {\dodoubleempty\dogo!marker} + +\def\dogo!marker[#1][#2]#3#4% + {\ifsecondargument % needed for labels + \ctxlua{thirddata.games.go.field[0][#3][#4]['label'] = '#2' }% + \fi + \ctxlua{thirddata.games.go.field[0][#3][#4]['marker'] = '#1' }} + +\def\go!stone[#1]#2#3% + {\bgroup % keep \stonecolor as local command, this is no problem because Lua calls are global + \processaction + [#1] + [\v!black=>\chardef\stonecolor\plusone, + \v!white=>\chardef\stonecolor\plustwo]% + \ctxlua{thirddata.games.go.field[0][#2][#3]['color'] = \number\stonecolor }% + \ctxlua{thirddata.games.go.lastcolor = \number\stonecolor }% + \doif{\gameparameter\c!calculate}\v!yes{\ctxlua{thirddata.games.go.deadstone.processtones()}}% + \egroup} + +\def\go!move + {\dosingleempty\dogo!move} + +\def\dogo!move[#1]#2#3% + {\iffirstargument + \go!stone[#1]{#2}{#3}% + \fi + \doif{\gameparameter\c!interactive}\v!yes\go!symbol} + +\newcount\go!count!symbols + +\let\go!list!symbols\empty + +\def\go!symbol + {\expanded{\advance\go!count!symbols\plusone}% + \expanded{\go!setboard{\number\go!count!symbols}}% + \expanded{\definesymbol[go!symbol!\number\go!count!symbols][\noexpand\go!getboard{\number\go!count!symbols}]}% + \expanded{\appendtocommalist{go!symbol!\number\go!count!symbols}}\go!list!symbols} + +\def\go!line#1#2#3#4% + {\ctxlua{thirddata.games.go.line(#1,#2,#3,#4)}} + +\def\go!arrow#1#2#3#4% + {\ctxlua{thirddata.games.go.arrow(#1,#2,#3,#4)}} + +%D Stones + +% simple/pure style + +\starttexdefinition go:stone:pure:black #1#2#3 + fill fullcircle scaled #1 shifted (#2,#3) ; + draw fullcircle scaled #1 shifted (#2,#3) ; +\stoptexdefinition + +\starttexdefinition go:stone:pure:white #1#2#3 + fill fullcircle scaled (#1-.2) shifted (#2,#3) withcolor white ; + draw fullcircle scaled (#1-.2) shifted (#2,#3) ; +\stoptexdefinition + +% complex/shade style + +\starttexdefinition go:stone:shade:black #1#2#3 + circular_shade ( fullcircle scaled (#1+.4) shifted (#2,#3) , 4 , .8white , black ) ; +\stoptexdefinition + +\starttexdefinition go:stone:shade:white #1#2#3 + circular_shade ( fullcircle scaled (#1+.4) shifted (#2,#3) , 2 , .8white , white ) ; +\stoptexdefinition + +%D Marker + +% #1 = nx +% #2 = ny +% #3 = dx +% #4 = dy +% #5 = stonesize +% #6 = hoffset +% #7 = voffset +% #8 = frameoffset + +\starttexdefinition go:marker:circle #1#2#3#4#5#6#7#8 + draw fullcircle scaled (0.6*#5) shifted (#6,#7) ; +\stoptexdefinition + +\starttexdefinition go:marker:square #1#2#3#4#5#6#7#8 + draw fullsquare scaled (sqrt(2)*(#5-.4)/2) shifted (#6,#7) ; +\stoptexdefinition + +\starttexdefinition go:marker:cross #1#2#3#4#5#6#7#8 + draw (((-(#5-.4)/2,0)--((#5-.4)/2,0)) rotated -45) shifted (#6,#7) ; + draw (((-(#5-.4)/2,0)--((#5-.4)/2,0)) rotated +45) shifted (#6,#7) ; +\stoptexdefinition + +\starttexdefinition go:marker:triangle #1#2#3#4#5#6#7#8 + draw (origin--((3*(#5-.4))/(2*sqrt(3)),0)--((3*(#5-.4))/(2*sqrt(3)),0) rotated 60--cycle) shifted (#6-(3*(#5-.4))/(2*sqrt(3))/2,#7-(#5-.4)/4) ; +\stoptexdefinition + +\starttexdefinition go:marker:select #1#2#3#4#5#6#7#8 + width := #1*#2+2*#8 ; % I have to do this + height := #2*#4+2*#8 ; % in a better way + board := currentpicture ; + currentpicture := nullpicture ; + mine := unitsquare xyscaled (width,height) shifted (-#8,-#8) -- reverse % + fullsquare scaled sqrt(5*4mm) shifted (#6,#7)--cycle ; + clip board to mine ; + currentpicture := board ; + fill fullsquare scaled sqrt(2.5*4mm) shifted (#6,#7) ; +\stoptexdefinition + +\starttexdefinition go:marker:hash #1#2#3#4#5#6#7#8 + % make a hole in the board, should only be done if no stone is on this position + width := #1*#3+2*#8 ; % I have to do this + height := #2*#4+2*#8 ; % in a better way + board := currentpicture ; + currentpicture := nullpicture ; + mine := unitsquare xyscaled (width,height) shifted (-#8,-#8) -- reverse % + fullsquare scaled sqrt(5*4mm) shifted (#6,#7) -- cycle ; + clip board to mine ; + currentpicture := board ; + % draw the pattern + board := currentpicture ; + currentpicture := nullpicture ; + for i=-5 upto 5: + draw ((sqrt((#2**2)/2)*i*.25,-5mm)--(sqrt((#2**2)/2)*i*.25,5mm)) rotated - 45 shifted (#6,#7) ; + endfor ; % why do I need a simikolon here, it worked in MPdrawing without them (related to obeylines in texdefintion?) + clip currentpicture to fullsquare xyscaled (#2,#4) shifted (#6,#7) ; + addto board also currentpicture ; + currentpicture := board ; +\stoptexdefinition + +\starttexdefinition go:marker:label #1#2#3 + label(textext("\doattributes{\????gm\currentgame}{style}{color}{#1}"),(#2,#3)) ; +\stoptexdefinition + +\starttexdefinition go:marker:label #1#2#3 + label(textext("\doattributes{\????gm\currentgame}{style}{color}{#1}"),(#2,#3)) ; +\stoptexdefinition + +\starttexdefinition go:marker:hoshi #1#2#3 + fill fullcircle scaled #1 shifted (#2,#3) ; +\stoptexdefinition + +%D Hoshi points + +\def\definehoshi #1 #2 #3 + {\resetvalue{go:hoshi:#2:#3:#1}} + +% #1 = boardsize +% #1 = column +% #3 = row + +%D small board: 9 + +\definehoshi 9 3 3 +\definehoshi 9 3 7 +\definehoshi 9 5 5 +\definehoshi 9 7 3 +\definehoshi 9 7 7 + +%D medium board: 13 + +\definehoshi 13 4 4 +\definehoshi 13 4 10 +\definehoshi 13 7 7 +\definehoshi 13 10 4 +\definehoshi 13 10 10 + +%D big board: 19 + +\definehoshi 19 4 4 +\definehoshi 19 4 10 +\definehoshi 19 4 16 +\definehoshi 19 10 4 +\definehoshi 19 10 10 +\definehoshi 19 10 16 +\definehoshi 19 16 4 +\definehoshi 19 16 10 +\definehoshi 19 16 16 + +%D Mapping from SGF code to TeX commands + +\def\sgfflush#1{\ctxlua{thirddata.games.sgf.parse("#1")}} + +\def\sgfnumber#1% + {\ifnum`#1>105 + \number\numexpr`#1-97\relax + \else\ifnum`#1>96 + \number\numexpr`#1-96\relax + \else\ifnum`#1<73 + \number\numexpr`#1-39\relax + \else + \number\numexpr`#1-40\relax + \fi\fi\fi} + +\def\convertsgfnumber#1#2\relax + {\edef\valuea{\sgfnumber{#1}}% + \edef\valueb{\sgfnumber{#1}}} + +\starttexdefinition parsesgf #1 + \sgfflush{#1} +\stoptexdefinition + +\starttexdefinition sgf!node #1 + \sgfflush{#1} +\stoptexdefinition + +\starttexdefinition sgf!white #1 + \expandafter\convertsgfnumber#1\relax + \move[white]\valuea\valueb +\stoptexdefinition + +\starttexdefinition sgf!black #1 + \expandafter\convertsgfnumber#1\relax + \move[black]\valuea\valueb +\stoptexdefinition + +\starttexdefinition sgf!addwhite #1 + \expandafter\convertsgfnumber#1\relax + \stone[white]\valuea\valueb +\stoptexdefinition + +\starttexdefinition sgf!comment #1 + % no output +\stoptexdefinition + +%D Lua functions are saved in a separate file + +\ctxloadluafile{games-go}{} + +%D Setup for the default values + +\setupgame % \setupgame[go] == \setupgoban + [\v!go] + [\c!size=\v!medium, + \c!stonesize=.92\bodyfontsize, + \c!nx=\gameparameter\c!size, + \c!ny=\gameparameter\c!size, + \c!dx=\bodyfontsize, + \c!dy=\gameparameter\c!dx, + \c!style=\txx, + \c!color=, + \c!labelstyle=\txx, + \c!labelcolor=, + \c!symbolset=\v!pure, % \v!shade + \c!labeldistance=.25\bodyfontsize, + \c!frameoffset=2\bodyfontsize, + \c!interactive=\v!no, + \c!calculate=\v!no, + \c!option=\v!tex, + \c!alternative=\v!b, + \c!backgroundcolor=, + \c!backgroundimage=] + +\protect \endinput diff --git a/obsolete/macros/context/contrib/context-games/tex/context/third/games/games-hex.lua b/obsolete/macros/context/contrib/context-games/tex/context/third/games/games-hex.lua new file mode 100644 index 0000000000..b8aee372d4 --- /dev/null +++ b/obsolete/macros/context/contrib/context-games/tex/context/third/games/games-hex.lua @@ -0,0 +1,90 @@ +if not modules then modules = { } end modules ['games-hex'] = { + version = 1.000, + comment = "Hex", + author = "Wolfgang Schuster", + copyright = "Wolfgang Schuster", + email = "schuster.wolfgang@googlemail.com", + license = "Public Domain" +} + +do + +thirddata = thirddata or { } +thirddata.games = thirddata.games or { } +thirddata.games.hex = thirddata.games.hex or { } +thirddata.games.hex.setup = thirddata.games.hex.setup or { } + +local nx = function() return thirddata.games.hex.setup.nx end +local ny = function() return thirddata.games.hex.setup.ny end +local dx = function() return thirddata.games.hex.setup.dx end +local dy = function() return thirddata.games.hex.setup.dy end +local offset = function() return thirddata.games.hex.setup.offset end +local size = function() return thirddata.games.hex.setup.size end +local distance = function() return thirddata.games.hex.setup.distance end +local bp = function(value) return number.tobasepoints(value) end +local sp = function(value) return value * 65536/(7227/7200) end + +function thirddata.games.hex.board_new() + thirddata.games.hex.field = { } + for col=1,nx() do + thirddata.games.hex.field[col] = { } + for row=1,ny() do + thirddata.games.hex.field[col][row] = { color = 0 } + end + end +end + +function thirddata.games.hex.board_lines() + for row=1,ny() do + for col=1,ny() do + tex.sprint("draw (") + for rot=0,5 do + tex.sprint("(" .. bp(size()) .. ",0) rotated (" .. rot*60+90 .. ") --") + end + tex.sprint("cycle) shifted (" .. bp(math.cos(math.pi/6)*size()*(2*(col-1)+(row-1))) .. "," .. bp(-size()*1.5*(row-1)) .. ") ; ") + end + end +end + +function thirddata.games.hex.board_labels() + for col=1,nx() do + tex.sprint('label.top(textext("\\doattributes{@@@@gmhex}{labelstyle}{labelcolor}{\\sgfchar{' .. col .. '}}"),%') + tex.sprint('(' .. bp(-(size()+distance())*math.tan(math.pi/6)+2*(col-1)*math.cos(math.pi/6)*size()) .. ',' .. bp(size()+distance()) .. ')) ;') + end + for row=1,ny() do + tex.sprint('label.lft(textext("\\doattributes{@@@@gmhex}{labelstyle}{labelcolor}{' .. row .. '}"),%') + tex.sprint('(' .. bp(-math.cos(math.pi/6)*size()-distance()+(row-1)*math.cos(math.pi/6)*size()) .. ',' .. bp(-1.5*(row-1)*size()) .. ')) ;') + end +end + +function thirddata.games.hex.board_stones() + local color = function(x,y) return thirddata.games.hex.field[x][y]['color'] end + for col=1,nx() do + for row=1,ny() do + if color(col,row)==1 then + thirddata.games.hex.stone(math.cos(math.pi/6)*size()*(2*(col-1)+(row-1)),-size()*1.5*(row-1),"red") + elseif color(col,row)==2 then + thirddata.games.hex.stone(math.cos(math.pi/6)*size()*(2*(col-1)+(row-1)),-size()*1.5*(row-1),"blue") + end + end + end +end + +function thirddata.games.hex.stone(x,y,color) + tex.sprint("fill (") + for rot=0,5 do + tex.sprint("(" .. bp(size()) .. ",0) rotated (" .. rot*60+90 .. ") --") + end + tex.sprint("cycle) shifted (" .. bp(x) .. "," .. bp(y) .. ")") + tex.sprint("withcolor \\MPcolor{" .. color .. "} ;") +end + +function thirddata.games.hex.board_draw(name) + tex.sprint("\\startuniqueMPgraphic{" .. name .. "}{}") + thirddata.games.hex.board_stones() + thirddata.games.hex.board_lines() + thirddata.games.hex.board_labels() + tex.sprint("\\stopuniqueMPgraphic") +end + +end diff --git a/obsolete/macros/context/contrib/context-games/tex/context/third/games/games-hex.tex b/obsolete/macros/context/contrib/context-games/tex/context/third/games/games-hex.tex new file mode 100644 index 0000000000..e03554a16f --- /dev/null +++ b/obsolete/macros/context/contrib/context-games/tex/context/third/games/games-hex.tex @@ -0,0 +1,119 @@ +%D \module +%D [ file=games-hex, +%D version=2008.10.29, +%D title=\CONTEXT\ User Module, +%D subtitle=Hex, +%D author=Wolfgang Schuster, +%D date=\currentdate, +%D email=schuster.wolfgang@googlemail.com, +%D copyright=Wolfgang Schuster] + +\writestatus{loading}{Context User Module / Games - Hex} + +\unprotect + +\definegame[\v!hexgame][\v!hex] + +\def\sgfchar#1% + {\ifnum#1<9 + \char\number\numexpr#1+64\relax + \else\ifnum#1<26 + \char\number\numexpr#1+65\relax + \fi\fi} + +\def\hex!commands + {newboard,drawboard,player} + +\def\hex!copygamecommands + {\expanded{\copyparameters[][hex!][\hex!commands]}} + +\setvalue{\e!begin\????gm\????gm\v!hex}% + {\hex!copygamecommands + \hex!boardsize + \hex!gamevalues} + +\defineoverlay[overlay:hex][\overlaybutton{JS(Walk_Field{games!hex})}] + +\setvalue{\e!end\????gm\????gm\v!hex}% + {\doif{\gameparameter\c!interactive}\v!yes\hex!fieldstack} + +\def\hex!fieldstack + {\expanded{\definefieldstack[games!hex][\hex!list!symbols][\c!frame=\v!off]}% + \framed + [\c!frame=\v!off, + \c!background={foreground,overlay:hex}, + \c!offset=\v!overlay] + {\fieldstack[games!hex]}} + +\def\hex!boardsize % what are common values for hex + {\assignvalue{\gameparameter\c!nx}\hex!board!nx{11}{14}{19}% + \assignvalue{\gameparameter\c!ny}\hex!board!ny{11}{14}{19}% + \ctxlua{thirddata.games.hex.setup.nx = \number\hex!board!nx }% + \ctxlua{thirddata.games.hex.setup.ny = \number\hex!board!ny }} + +\def\hex!gamevalues + {\startlua + thirddata.games.hex.setup.size = \number\dimexpr\gameparameter\c!stonesize\relax ; + thirddata.games.hex.setup.dx = \number\dimexpr\gameparameter\c!dx\relax ; + thirddata.games.hex.setup.dy = \number\dimexpr\gameparameter\c!dy\relax ; + thirddata.games.hex.setup.offset = \number\dimexpr\gameparameter\c!frameoffset\relax ; + thirddata.games.hex.setup.distance = \number\dimexpr\gameparameter\c!labeldistance\relax ; + \stoplua} + +%D User commands + +\def\hex!newboard + {\ctxlua{thirddata.games.hex.board_new()}} + +\def\hex!drawboard + {\doifnot{\gameparameter\c!interactive}\v!yes + {\hex!setboard{0}% + \hex!getboard{0}}} + +\def\hex!setboard#1% + {\ctxlua{thirddata.games.hex.board_draw("games:hex:#1")}} + +\def\hex!getboard#1% + {\uniqueMPgraphic{games:hex:#1}} + +\def\hex!player[#1]#2#3% + {\bgroup + \processaction + [#1] + [ \v!red=>\chardef\stonecolor\plusone, + \v!blue=>\chardef\stonecolor\plustwo]% + \ctxlua{thirddata.games.hex.field[#2][#3] = { color = \number\stonecolor }}% + \egroup + \doif{\gameparameter\c!interactive}\v!yes\hex!symbol} + +\newcount\hex!count!symbols + +\let\hex!list!symbols\empty + +\def\hex!symbol + {\expanded{\advance\hex!count!symbols\plusone}% + \expanded{\hex!setboard{\number\hex!count!symbols}}% + \expanded{\definesymbol[hex!symbol!\number\hex!count!symbols][\noexpand\hex!getboard{\number\hex!count!symbols}]}% + \expanded{\appendtocommalist{hex!symbol!\number\hex!count!symbols}}\hex!list!symbols} + +%D Lua functions + +\ctxloadluafile{games-hex}{} + +%D Default values + +\setupgame + [\v!hex] + [\c!size=\v!small, + \c!nx=\gameparameter\c!size, + \c!ny=\gameparameter\c!size, + \c!stonesize=\bodyfontsize, + \c!dx=\gameparameter\c!stonesize, + \c!dy=\gameparameter\c!dx, + \c!frameoffset=0pt, + \c!labeldistance=0pt, + \c!labelstyle=\tx, + \c!labelcolor=, + \c!interaction=\v!no] + +\protect \endinput diff --git a/obsolete/macros/context/contrib/context-games/tex/context/third/games/holz280.jpg b/obsolete/macros/context/contrib/context-games/tex/context/third/games/holz280.jpg Binary files differnew file mode 100644 index 0000000000..9d7f23fc01 --- /dev/null +++ b/obsolete/macros/context/contrib/context-games/tex/context/third/games/holz280.jpg diff --git a/obsolete/macros/context/contrib/context-games/tex/context/third/games/t-games.tex b/obsolete/macros/context/contrib/context-games/tex/context/third/games/t-games.tex new file mode 100644 index 0000000000..63dc6d4ca2 --- /dev/null +++ b/obsolete/macros/context/contrib/context-games/tex/context/third/games/t-games.tex @@ -0,0 +1,110 @@ +%D \module +%D [ file=t-games, +%D version=2008.01.10, +%D title=\CONTEXT\ User Module, +%D subtitle=Games, +%D author=Wolfgang Schuster, +%D date=\currentdate, +%D copyright=Wolfgang Schuster, +%D email=schuster.wolfgang@googlemail.com, +%D license=Public Domain] + +\writestatus{loading}{Context User Module / Games} + +\unprotect + +%D Constants + +\startinterface all + \setinterfaceconstant {labelstyle} {labelstyle} + \setinterfaceconstant {labelcolor} {labelcolor} + \setinterfaceconstant {labeldistance} {labeldistance} + \setinterfaceconstant {stonesize} {stonesize} + \setinterfaceconstant {backgroundimage} {backgroundimage} + \setinterfaceconstant {interactive} {interactive} +\stopinterface + +%D Variables + +\startinterface all + \setinterfacevariable {game} {game} + \setinterfacevariable {black} {black} + \setinterfacevariable {white} {white} + \setinterfacevariable {go} {go} + \setinterfacevariable {hex} {hex} + \setinterfacevariable {goban} {goban} + \setinterfacevariable {hexgame} {hexgame} + \setinterfacevariable {red} {red} + \setinterfacevariable {blue} {blue} + \setinterfacevariable {weiqi} {weiqi} + \setinterfacevariable {baduk} {baduk} + \setinterfacevariable {pure} {pure} + \setinterfacevariable {shade} {shade} + \setinterfacevariable {tex} {tex} + \setinterfacevariable {sgf} {sgf} + \setinterfacevariable {chess} {chess} + \setinterfacevariable {pgn} {pgn} +\stopinterface + +%D Namespace + +\def\????ga{@@@@ga} +\def\????gm{@@@@gm} + +\def\gameparameter#1% + {\csname\????gm\currentgame#1\endcsname} + +%D Game environment, not more than a simple wrapper to load the real +%D environments in the from \type {\????gm\????gm...}. + +\def\dostartgame + {\!!gameenvironmenttrue + \dotripleempty\dodostartgame} + +\def\dodostartgame[#1][#2][#3]% + {\bgroup + \edef\currentname{#1}% needed for the parser + \edef\currentgame{#2}% I should look for better names + \gameparameter\c!before + \ifsecondargument + \setupgame[#2][#3]% + \fi + \executeifdefined{\e!begin\????gm\????gm\currentgame}{\@EA\gobbleuntil\csname\e!stop\currentname\endcsname}} + +\def\dostopgame + {\executeifdefined{\e!end\????gm\????gm\currentgame}\donothing + \gameparameter\c!after + \egroup} + +\def\dogame + {\dotripleempty\dodogame} + +\newif\if!!gameenvironment + +\def\dodogame[#1][#2][#3]#4% + {\!!gameenvironmentfalse\dodostartgame[#1][#2][#3]{#4}\dostopgame} + + +\def\definegame + {\dodoubleargument\dodefinegame} + +\def\dodefinegame[#1][#2]% + {\setvalue{\e!start#1}{\dostartgame[#1][#2]}% + \setvalue{\e!stop #1}{\dostopgame}% + \setvalue {#1}{\dogame[#1][#2]}% + \setvalue{\e!setup#1\e!endsetup}{\setupgame[#2]}} + +%D Setup command. + +\def\setupgame + {\dodoubleargument\dosetupgame} + +\def\dosetupgame[#1][#2]% + {\getparameters[\????gm#1][#2]} + +%D Load the games with their own macros. + +\input games-go +\input games-hex + +\protect \endinput diff --git a/obsolete/macros/context/contrib/context-lilypond/doc/context/third/lilypond/demo.pdf b/obsolete/macros/context/contrib/context-lilypond/doc/context/third/lilypond/demo.pdf Binary files differnew file mode 100644 index 0000000000..3682e7c3b8 --- /dev/null +++ b/obsolete/macros/context/contrib/context-lilypond/doc/context/third/lilypond/demo.pdf diff --git a/obsolete/macros/context/contrib/context-lilypond/doc/context/third/lilypond/t-lilypond.pdf b/obsolete/macros/context/contrib/context-lilypond/doc/context/third/lilypond/t-lilypond.pdf Binary files differnew file mode 100644 index 0000000000..15d5d3116e --- /dev/null +++ b/obsolete/macros/context/contrib/context-lilypond/doc/context/third/lilypond/t-lilypond.pdf diff --git a/obsolete/macros/context/contrib/context-lilypond/tex/context/third/lilypond/t-lilypond.tex b/obsolete/macros/context/contrib/context-lilypond/tex/context/third/lilypond/t-lilypond.tex new file mode 100644 index 0000000000..acde63655e --- /dev/null +++ b/obsolete/macros/context/contrib/context-lilypond/tex/context/third/lilypond/t-lilypond.tex @@ -0,0 +1,432 @@ +%D \module +%D [ file=t-lilypond, +%D version=2010.03.11, +%D title=\CONTEXT\ User Modules, +%D subtitle=LilyPond Bridge (Music Typesetting), +%D author={Christopher Creutzig, H. Ramm et al.}, % , Mojca Miklavec, Wolfgang Schuster +%D maintainer={Henning Hraban Ramm, hraban@fiee.net}, +%D date=\currentdate, +%D copyright=the authors] +%C +%C This module is licensed under the GNU GPL. + +%D This module serves to include LilyPond music directly in the +%D \CONTEXT\ source, just as \METAPOST\ code can be. +%D +%D It is supposed to work only with LilyPond's stable version 2.12 and \CONTEXT\ MkIV i.\,e. \LUATEX. +%D +%D {\bfa Complete list of options:} +%D +%D \starttabulate[|l|l|l|] +%D \NC option\NC default\NC comment\NC\NR +%D \HL +%D \NC staffsize\NC 14\NC in pt \NC\NR +%D \NC indent\NC 0pt\NC first line indent \NC\NR +%D \NC time\NC yes\NC count time? (i.e. show time signature, set bars, split line) \NC\NR +%D \NC clef\NC yes\NC show clef? \NC\NR +%D \NC linewidth\NC \type{\localhsize}\NC \NC\NR +%D \NC betweensystemspace\NC 54pt\NC space between systems \NC\NR +%D \NC height\NC \type{\textheight}\NC \NR +%D \NC align\NC ?\NC default depends on fragment=... \NC\NR +%D \NC fragment\NC no\NC whole staff line or only snippet? \NC\NR +%D \NC barnumbers\NC no\NC show numbers of measures? \NC\NR +%D \NC showempty\NC no\NC drop empty staves? \NC\NR +%D \NC seriffont\NC "TeX Gyre Schola"\NC font for e.g. lyrics \NC\NR +%D \NC sansfont\NC "LMSans10"\NC font for e.g. chords \NC\NR +%D \NC monofont\NC "LMTypewriter10" \NC normally not used \NC\NR +%D \NC tmpdir\NC ./lilytemp \NC directory for temporary files \NC\NR +%D \NC imgdir\NC ./lilypdfs \NC directory for image files (note PDFs) \NC\NR +%D \stoptabulate +%D +%D {\bfa Todo list} +%D +%D \startitemize[packed,joinedup] +%D \item Proper support for multipage results. +%D \item Set LilyPond page size to remaining page space. +%D \item Place instrument names in margin. +%D \item Work with existing PDFs on systems where LilyPond isn't installed. +%D \stopitemize +%D +%D {\bfa Commented Source} +%D +%D As usual, we use a prefix for buffers, \type{\getparameters} etc.: + +\writestatus{loading}{LilyPond module} + +\startmodule[lilypond] + +\unprotect + +\definesystemvariable{lily} + +%D Define the text snippets to be placed around fragments. +%D Since LilyPond uses similar syntax to TeX, we must do some catcode fiddling. + +\bgroup + +\catcode`\/=\@@escape +/catcode`/\=/@@other +/catcode`/#=/@@other +/catcode`/<=/@@begingroup +/catcode`/>=/@@endgroup +/catcode`/{=/@@other +/catcode`/}=/@@other +/catcode`/%=/@@other +/catcode`/-=/@@letter + +/gdef/lily!fragmentprefix + </string^^J + /string^^J + {/string^^J + % ly snippet contents follows:/string^^J + > + +/gdef/lily!fragmentsuffix + </string^^J + % end ly snippet/string^^J + }/string^^J + > + +/gdef/lily!prefix + </string^^J + /string^^J + #(ly:set-option (quote no-point-and-click))/string^^J + #(ly:set-option (quote delete-intermediate-files))/string^^J + /string^^J + \version "2.12.0"/string^^J + #(define version-seen? #t)/string^^J + \layout {/string^^J + /iflily!showempty/else + % drop empty staves/string^^J + \context { \RemoveEmptyStaffContext } % MUST come first/string^^J + \context { \Score \override VerticalAxisGroup #'remove-first = ##t }/string^^J + /fi + /string^^J + /unless/iflily!time + % switch off time signature (i.e. only one line, no bars)/string^^J + ragged-last = ##t/string^^J + \context { \Score timing = ##f }/string^^J + \context { \Staff \remove "Time_signature_engraver" }/string^^J + /string^^J + /fi + /unless/iflily!barnumbers + % switch off bar numbers/string^^J + \context { \Score \remove "Bar_number_engraver" }/string^^J + /fi + /string^^J + /unless/iflily!clef + % switch off clef sign/string^^J + \context { \Staff \remove "Clef_engraver" }/string^^J + /fi + /string^^J + #(define fonts + (make-pango-font-tree + /@@lilyseriffont/space + /@@lilysansfont/space + /@@lilymonofont/space + (/letterslash/space/@@lilystaffsize/space 20)))/string^^J + /string^^J + }/string^^J + \paper {/string^^J + #(define dump-extents #t)/string^^J + ragged-right = /iflily!align ##f/else ##t/fi/string^^J + indent = /withoutpt/the/lily!indent\pt/string^^J + line-width = /withoutpt/the/lily!linewidth\pt/string^^J + vsize = /withoutpt/the/lily!vsize\pt/string^^J + printpagenumber = ##f/string^^J + oddFooterMarkup=##f/string^^J + oddHeaderMarkup=##f/string^^J + bookTitleMarkup = ##f/string^^J + scoreTitleMarkup = ##f/string^^J + ragged-bottom=##t/string^^J + ragged-last-bottom=##t/string^^J + between-system-padding = #0/string^^J + between-system-space = /withoutpt/the/lily!betweensystemspace\pt/string^^J + }/string^^J + > + +/egroup + +%D Here, we define our parameters: + +\newdimen\lily!linewidth +\newdimen\lily!vsize +\newdimen\lily!indent +\newdimen\lily!betweensystemspace +\newif\iflily!showempty +\newif\iflily!align +\newif\iflily!clef +\newif\iflily!time +\newif\iflily!barnumbers + +\newcounter\lily!figures + +%D Again, as usual, there is a \type{\setuplilypond} command +%D that accepts the same parameters as \type{\lilypond} and +%D \type{\startlilypond} do in their optional argument. + +\def\setuplilypond + {\bgroup + \catcode`\#=\@@other + \dosingleempty\dosetuplilypond} + +\def\dosetuplilypond[#1]% + {\egroup + \getparameters[\??lily][#1]} + +%D We set the following defaults: + +\setuplilypond + [staffsize=20, + indent=0pt, + betweensystemspace=54pt, + time=\v!yes, + clef=\v!yes, + align=?, % default depends on fragment=... + fragment=\v!no, + barnumbers=\v!no, + showempty=\v!no, + seriffont="TeX Gyre Schola", % LilyPond default font + sansfont="LMSans10", + monofont="LMTypewriter10", + tmpdir={./lilytemp}, + imgdir={./lilypdfs}] +%D +%D If you want to know which fonts of your system LilyPond can see +%D with which names, try \type{lilypond -dshow-available-fonts any}. +%D (The 3rd parameter is necessary, but can be anything.)\par +%D There are a lot of restrictions, e.g. no fonts from the \TeX\ tree (don't know why), +%D only one face per font file etc. + +%D +%D Check if temporary and image directories exist and create them if not: +%D + +\def\tmpdir{\@@lilytmpdir} % for intermediate files +\def\imgdir{\@@lilyimgdir} % for music PDFs + +\startluacode + if not lfs.isdir("\tmpdir") then + logs.report("LilyPond Warn ", "Temporary directory not found, trying to make '\tmpdir'") + lfs.mkdir("\tmpdir") + end + if not lfs.isdir("\imgdir") then + logs.report("LilyPond Warn ", "Image directory not found, trying to make '\imgdir'") + lfs.mkdir("\imgdir") + end +\stopluacode + +%D +%D \type{\startlilypond} is a multistage implementation, because +%D end-of-line characters must be treated specially in the +%D \type{\startlilypond} \dots\ \type{\stoplilypond} range. +%D + +\def\startlilypond + {\bgroup + \catcode`\#=\@@other + \dosingleempty\dostartlilypond} + +\def\dostartlilypond[#1]% + {\obeylines + \dodostartlilypond[#1]} + +\long\def\dodostartlilypond[#1]#2\stoplilypond + {\egroup + \bgroup +%D +%D The default of the \type{linewidth} parameter is the local \type{\hsize}. +%D + \setlocalhsize + \getparameters[\??lily][linewidth=\the\localhsize,height=\the\textheight,#1]% + \lily!linewidth\@@lilylinewidth + \lily!vsize\@@lilyheight + \lily!indent\@@lilyindent + \lily!betweensystemspace\@@lilybetweensystemspace +%D +%D The default of \type{align} depends on whether we typeset a fragment: +%D + \doifelse\@@lilyalign\v!yes\lily!aligntrue\lily!alignfalse + \doif\@@lilyfragment\v!no{\doif\@@lilyalign{?}\lily!aligntrue}% + \doifelse\@@lilytime\v!yes\lily!timetrue\lily!timefalse + \doifelse\@@lilybarnumbers\v!yes\lily!barnumberstrue\lily!barnumbersfalse + \doifelse\@@lilyshowempty\v!yes\lily!showemptytrue\lily!showemptyfalse + \doifelse\@@lilyclef\v!yes\lily!cleftrue\lily!cleffalse +%D +%D We are using a counter to keep the different LilyPond pieces +%D separate. This allows to typeset them only once, during the +%D first run. +%D +%D TODO: This won't work any longer once we pass the remaining +%D vertical space to LilyPond. +%D + \doglobal\increment\lily!figures + \edef\lily!filename{\bufferprefix lilypond-\lily!figures}% + \edef\lily!tmpfilename{\tmpdir/\lily!filename.tmp}% + \edef\lily!img{\imgdir/\lily!filename.pdf} + \def\obeyedlines{\string^^J}% + \convertargument#2\to\ascii + \startexpanded + \noexpand\setbuffer[\lily!tmpfilename]% + \lily!prefix + \letterhash(set-global-staff-size \getvalue{\??lily staffsize})\string^^J% + \ifdefined\@@lilyfragment\lily!fragmentprefix\fi +%D TODO: Option \quote{packed} + \ascii + \ifdefined\@@lilyfragment\lily!fragmentsuffix\fi + \noexpand\endbuffer + \stopexpanded +%D +%D In \LUATEX\ buffers are kept in memory +%D in contrast to older flavours of \TeX\ where they're written to a +%D file automatically. We have to require writing to a file explicitely +%D with \type{\savebuffer}. +%D + \writestatus{LilyPond}{\lily!filename} + \startluacode + buffers.save('\lily!tmpfilename') + if not lfs.isfile('\lily!tmpfilename') then + logs.report("LilyPond ERROR", "File '\lily!tmpfilename' was not written!") + end +%D +%D Generating a PDF directly previously created always a whole page, so we generate EPS first. +%D In recent versions of LilyPond that gets converted to PDF immediately, but we check for that. +%D +%D It would be nice, if \type{-ddelete-intermediate-files} would delete all useless intermediate files. +%D It would be even better, if mtxrun wouldn't declare non-existing files as \quotation{unchanged}. (Is that fixed now?) +%D +%D Remember: More possible options in \type{lily.scm}. +%D + os.execute('mtxrun --ifchanged="\lily!tmpfilename" --exec bin:lilypond -dbackend=eps -dno-gs-load-fonts -dinclude-eps-fonts -ddelete-intermediate-files -o"\tmpdir/\lily!filename" "\lily!tmpfilename"') + if not lfs.isfile('\tmpdir/\lily!filename.pdf') then + os.execute('mtxrun --ifchanged="\tmpdir/\lily!filename.eps" --exec bin:pstopdf "\tmpdir/\lily!filename.eps"') + end +%D At least on Windows, Lua's \type{os.rename} won't overwrite existing files, so we need to remove them before. + if lfs.isfile('\lily!img') and lfs.isfile('\tmpdir/\lily!filename.pdf') then + os.remove('\lily!img') + end + os.rename('\tmpdir/\lily!filename.pdf', '\lily!img') + \stopluacode +%D +%D TODO: Get the relevant dimension directly from LilyPond, +%D to place the instrument name into the left margin for +%D short snippets as well. (Is that possible at all?) +%D +%D If we are not in the middle of some text, we have to check +%D whether LilyPond created an image that is wider than requested: +%D It places the instrument names in the left margin. +%D + \ifvmode + \getfiguredimensions[\lily!img]% + \leavevmode + \!!dimenb\figurewidth + \ifdim\!!dimenb>\localhsize + \!!dimena=\localhsize + \advance\!!dimena-\!!dimenb + \noindent\hskip\!!dimena + \fi + \fi + \externalfigure[\lily!img]% + \egroup} + +%D For short snippets, we define an inline alternative to +%D our start/stop pair: + +\def\lilypond {\dosingleempty\dolilypond} +\def\dolilypond[#1]#2{\startlilypond[#1]#2\stoplilypond} + +\stopmodule + +\protect \doifnotmode{demo}{\endinput} + + +%D End of file. +%D +%D Here follows a sample. (\type{context t-lilypond --mode=demo}) + +\starttext + +\startbuffer[sample] +\subject{Telemann, TWV 40:11} +\startlilypond + \relative c' { + \set Staff.instrumentName = flute + \key fis \minor + \time 3/4 + \partial 4 + r8 fis'8 | fis4. cis8 a cis | fis, a cis fis a fis | + b, d fis b d b | eis,, gis cis eis gis b, | + a fis' gis, fis' cis eis | fis,4 r8 + a' gis fis | e gis, a e' fis cis | + d fis, gis b e d | cis4 \trill r8 + cis b a | b dis e gis cis, b | + a e' dis fis b, a | gis4 \trill r8 + } +\stoplilypond +\stopbuffer + +The input +\typebuffer[sample] +is typeset as +\getbuffer[sample] + +\type{\startlilypond} accepts options, as in\crlf +\type{\startlilypond[staffsize=18, linewidth=14cm, indent=5cm, time=no, clef=no]}: +\nobreak +\startlilypond[staffsize=18,linewidth=14cm,indent=5cm,time=no,clef=no] + \relative c' { + \key fis \minor + \time 3/4 + \partial 4 + r8 fis'8 | fis4. cis8 a cis | fis, a cis fis a fis | + b, d fis b d b | eis,, gis cis eis gis b, | + a fis' gis, fis' cis eis | fis,4 r8 + a' gis fis | e gis, a e' fis cis | + d fis, gis b e d | cis4 \trill r8 + cis b a | b dis e gis cis, b | + a e' dis fis b, a | gis4 \trill r8 + } +\stoplilypond + +It is also possible to mix text and music: +\lower 8.2pt\hbox{\lilypond[fragment=true,staffsize=16,time=no,clef=no]{g'}} is a g. + +TODO: The \type{\lower} in the example above should not be necessary. + +\subject{Starlight (round)} + +Here is a sample with lyrics: + +\startlilypond +<< +\context Staff = onlyone << + \clef treble + \key a \major + \time 6/8 + \context Voice = one { + \relative c'' { + a4.^\markup{1.} e' | + e8( d cis) b4. | + e4.^\markup{2.} d4 d8 | + cis( b) a b4 e,8 | + a4 a8 gis( a) b | + cis4 cis8 b( cis d) | + cis( d) e e4 e,8 | + fis4 fis8 gis4. + \bar ":|" + } + } +>> +\lyricsto one \new Lyrics { + \lyricmode { + Star -- light, star -- bright, + first star I see to -- night; + I wish I may, I wish I might + have the wish I wish to -- night. + } +} +>> + +\stoplilypond + +\stoptext diff --git a/obsolete/macros/context/contrib/context-sgf/doc/context/third/sgf/README b/obsolete/macros/context/contrib/context-sgf/doc/context/third/sgf/README new file mode 100644 index 0000000000..331ec51a16 --- /dev/null +++ b/obsolete/macros/context/contrib/context-sgf/doc/context/third/sgf/README @@ -0,0 +1,7 @@ +Name of module: Go Module for ConTeXt
+Author: Wolfgang Schuster and Zhichu Chen
+
+Description: You can set go boards in your document.
+
+The module documentation is available in doc/context/third/go/t-go.pdf
+
diff --git a/obsolete/macros/context/contrib/context-sgf/doc/context/third/sgf/deadstone-lua.pdf b/obsolete/macros/context/contrib/context-sgf/doc/context/third/sgf/deadstone-lua.pdf Binary files differnew file mode 100644 index 0000000000..44f33fafbe --- /dev/null +++ b/obsolete/macros/context/contrib/context-sgf/doc/context/third/sgf/deadstone-lua.pdf diff --git a/obsolete/macros/context/contrib/context-sgf/doc/context/third/sgf/deadstone-mkii.pdf b/obsolete/macros/context/contrib/context-sgf/doc/context/third/sgf/deadstone-mkii.pdf Binary files differnew file mode 100644 index 0000000000..db5ac6475f --- /dev/null +++ b/obsolete/macros/context/contrib/context-sgf/doc/context/third/sgf/deadstone-mkii.pdf diff --git a/obsolete/macros/context/contrib/context-sgf/doc/context/third/sgf/deadstone-mkiv.pdf b/obsolete/macros/context/contrib/context-sgf/doc/context/third/sgf/deadstone-mkiv.pdf Binary files differnew file mode 100644 index 0000000000..2602eaadb7 --- /dev/null +++ b/obsolete/macros/context/contrib/context-sgf/doc/context/third/sgf/deadstone-mkiv.pdf diff --git a/obsolete/macros/context/contrib/context-sgf/doc/context/third/sgf/t-deadstone.pdf b/obsolete/macros/context/contrib/context-sgf/doc/context/third/sgf/t-deadstone.pdf Binary files differnew file mode 100644 index 0000000000..aecb9b7753 --- /dev/null +++ b/obsolete/macros/context/contrib/context-sgf/doc/context/third/sgf/t-deadstone.pdf diff --git a/obsolete/macros/context/contrib/context-sgf/doc/context/third/sgf/t-sgf.pdf b/obsolete/macros/context/contrib/context-sgf/doc/context/third/sgf/t-sgf.pdf Binary files differnew file mode 100644 index 0000000000..d526398f5c --- /dev/null +++ b/obsolete/macros/context/contrib/context-sgf/doc/context/third/sgf/t-sgf.pdf diff --git a/obsolete/macros/context/contrib/context-sgf/tex/context/third/sgf/deadstone.lua b/obsolete/macros/context/contrib/context-sgf/tex/context/third/sgf/deadstone.lua new file mode 100644 index 0000000000..656de4e17c --- /dev/null +++ b/obsolete/macros/context/contrib/context-sgf/tex/context/third/sgf/deadstone.lua @@ -0,0 +1,224 @@ +if not modules then modules = { } end modules ['deadstone'] = {
+ version = 0.100,
+ comment = "Dead stone calculator for go",
+ author = "Wolfgang Schuster",
+ copyright = "Public Domain",
+}
+
+--[[ldx--
+<p>This is the <l n='lua'/> version of my deadstone calculator.
+It is a nearly one to one copy of my original idea of my method,
+I developed to find the dead stones on the goban.</p>
+--ldx]]--
+
+laststone = 1
+
+--[[ldx--
+<p>The <ldx:function>clearboard</ldx:function> is called at the
+begin of a new board to initialize all fields with the value 0
+and the margins with the value 3. I need this values for the later
+calculations of the field states.</p>
+--ldx]]--
+
+function clearboard()
+ field = {}
+ for y=0,tex.count.boardsize+1 do
+ field[y] = {}
+ for x=0,tex.count.boardsize+1 do
+ if x==0 then
+ field[y][x] = { 3, 0 }
+ elseif x==tex.count.boardsize+1 then
+ field[y][x] = { 3, 0 }
+ elseif y==0 then
+ field[y][x] = { 3, 0 }
+ elseif y==tex.count.boardsize+1 then
+ field[y][x] = { 3, 0 }
+ else
+ field[y][x] = { 0, 0 }
+ end
+ end
+ end
+end
+
+--[[ldx--
+<p>To decide wheter I handle in the calculation a white or a black
+stone the state for stone and enemy depends of the current color.</p>
+<p>The value for marked depends also on the current stone color to
+reset already living stones in the last step back to the normal color.
+This could have been done also by checking the current stone color
+but two different values work without this test.</p>
+<p>The values for wall, error (should never happen) and dead is the
+same for both, black and white stones. There is no need to make a
+difference between them.</p>
+--ldx]]--
+
+function blackstone()
+ stone=1
+ enemy=2
+ wall=3
+ marked=4
+ error=6
+ dead=7
+end
+
+function whitestone()
+ stone=2
+ enemy=1
+ wall=3
+ marked=5
+ error=6
+ dead=7
+end
+
+--[[ldx--
+<p>The <ldx:function>doprocesstones</ldx:function> is used to call all
+subfunctions. It is called twice, once for the black stones and a second
+time for the white stones.</p>
+--ldx]]--
+
+function doprocesstones()
+ markstones()
+ deadstones()
+ -- for n=1,tex.count.deadcount
+ -- checkstones()
+ -- end
+ checkstones()
+ checkstones()
+ revertstones()
+end
+
+--[[ldx--
+<p>The order in which the last <ldx:function>doporocesstones</ldx:function>
+ist called depends on the current placed stones.</p>
+<p>This mean if the last stone was a black one, we look at the begin for
+dead white stone and reverse if the last stone was a white one.</p>
+<p>We could check the current stone color with the variable
+<ldx:variable>laststone</ldx:variable> and test for the numeric value.</p>
+--ldx]]--
+
+function processtones()
+ -- we placed a black stone
+ if laststone==1 then
+ processwhitetones()
+ processblackstones()
+ -- we placed a white stone
+ elseif laststone==2 then
+ processblackstones()
+ processwhitetones()
+ end
+end
+
+function processblackstones()
+ blackstone()
+ doprocesstones()
+end
+
+function processwhitetones()
+ whitestone()
+ doprocesstones()
+end
+
+--[[ldx--
+<p>The <ldx:function>markstones</ldx:function> mark the stones if they
+have the right stones on their sides or let them keep untouched.</p>
+--ldx]]--
+
+function markstones()
+ for y=1,tex.count.boardsize do
+ for x=1,tex.count.boardsize do
+ if field[y][x][1]==stone then
+ if (field[y][x-1][1]==wall or field[y][x-1][1]==enemy or field[y][x-1][1]==marked)
+ and (field[y][x+1][1]==wall or field[y][x+1][1]==enemy or field[y][x+1][1]==stone)
+ and (field[y-1][x][1]==wall or field[y-1][x][1]==enemy or field[y-1][x][1]==marked)
+ and (field[y+1][x][1]==wall or field[y+1][x][1]==enemy or field[y+1][x][1]==stone)
+ then
+ field[y][x] = { marked, field[y][x][2] }
+ end
+ end
+ end
+ end
+end
+
+--[[ldx--
+<p>The <ldx:function>deadstones</ldx:function> set stones with the value marked
+to dead if the conditions in the function are true.</p>
+--ldx]]--
+
+function deadstones()
+ for y=tex.count.boardsize,1,-1 do
+ for x=tex.count.boardsize,1,-1 do
+ if field[y][x][1]==marked then
+ if (field[y][x-1][1]==wall or field[y][x-1][1]==enemy or field[y][x-1][1]==marked)
+ and (field[y][x+1][1]==enemy or field[y][x+1][1]==wall or field[y][x+1][1]==dead)
+ and (field[y+1][x][1]==enemy or field[y+1][x][1]==wall or field[y+1][x][1]==dead)
+ then
+ field[y][x] = { dead, field[y][x][2] }
+ end
+ end
+ end
+ end
+end
+
+--[[ldx--
+<p>Because the <ldx:function>deadstones</ldx:function> can sometimes set
+already living stones to dead. To prevent this in the final result this
+function looks through all stones with a loop in reverse direction and
+reset the values to their original value if the stone is not dead and
+should remain on the board. The function is currently called twice within
+processtones but this can be changed with the counter deadcount.</p>
+--ldx]]--
+
+function checkstones()
+ for y=1,tex.count.boardsize do
+ for x=1,tex.count.boardsize do
+ if field[y][x][1]==marked then
+ field[y][x] = { stone, field[y][x][2] }
+ elseif field[y][x][1]==dead then
+ if (field[y][x-1][1]==dead or field[y][x-1][1]==enemy or field[y][x-1][1]==wall)
+ and (field[y][x+1][1]==dead or field[y][x+1][1]==enemy or field[y][x+1][1]==wall)
+ and (field[y-1][x][1]==dead or field[y-1][x][1]==enemy or field[y-1][x][1]==wall)
+ and (field[y+1][x][1]==dead or field[y+1][x][1]==enemy or field[y+1][x][1]==wall)
+ then
+ field[y][x] = { dead, field[y][x][2] }
+ else
+ field[y][x] = { stone, field[y][x][2] }
+ end
+ end
+ end
+ end
+end
+
+--[[ldx--
+<p>The last thing to do after all dead stones are found on the board
+is to remove them and to reset all other stones which are still in a
+marked state or we will get wrong input for the next move.</p>
+--ldx]]--
+
+function revertstones()
+ for y=1,tex.count.boardsize do
+ for x=1,tex.count.boardsize do
+ if field[y][x][1]==marked then
+ field[y][x] = { stone, field[y][x][2] }
+ elseif field[y][x][1]==dead then
+ appendtodeadstonelist(y,x,stone,field[y][x][2]) -- append to deadstonelist
+ field[y][x] = { 0, 0 } -- before reseting the field
+ end
+ end
+ end
+end
+
+--[[ldx--
+<p>To use the dead stones we found in this run on the board for later
+use they are saved in two commalist, one for white stones and another
+one for the black ones. They can be used by other macros, the only thing
+here is done is to append the removed stones in the current run to the
+already romved stones in one of the former calculations.</p>
+--ldx]]--
+
+function appendtodeadstonelist(row,column,color,count)
+ if color==1 then
+ tex.print("\\expanded{\\appendtocommalist{{" .. row .. ":" .. column .. ":1:" .. count .. "}}}\\deadblackstones")
+ elseif color==2 then
+ tex.print("\\expanded{\\appendtocommalist{{" .. row .. ":" .. column .. ":2:" .. count .. "}}}\\deadwhitestones")
+ end
+end
diff --git a/obsolete/macros/context/contrib/context-sgf/tex/context/third/sgf/deadstone.mkii b/obsolete/macros/context/contrib/context-sgf/tex/context/third/sgf/deadstone.mkii new file mode 100644 index 0000000000..7698017a0b --- /dev/null +++ b/obsolete/macros/context/contrib/context-sgf/tex/context/third/sgf/deadstone.mkii @@ -0,0 +1,343 @@ +%D \module
+%D [ file=deadstone,
+%D version=2007.07.31,
+%D title=\CONTEXT\ User Module,
+%D subtitle=Dead stone calculator for go,
+%D author=Wolfgang Schuster,
+%D email=schuster.wolfgang@googlemail.com,
+%D date=\currentdate,
+%D copyright=Public Domain]
+
+\writestatus{loading}{Context User Module / Dead stone calculator for go}
+
+\unprotect
+
+%D This is the \TEX\ version of the dead stone calculator for the
+%D go module. They are a copy of the original idea of the algorithm
+%D to find dead stones with a few modifications the author needed
+%D to make them work.
+
+%D \macros{clearboard}
+%D
+%D The \tex{clearboard} set all fields with a intial value of~0 for
+%D the empty fields and a value of~3 for the margins. The command
+%D can also be used to clear a board and remove all set values.
+
+\def\clearboard
+ {\dorecurse{\numexpr\boardsize+\plustwo\relax}
+ {\edef\boardrow{\the\numexpr\recurselevel-\plusone\relax}%
+ \dorecurse{\numexpr\boardsize+\plustwo\relax}
+ {\edef\boardcolumn{\the\numexpr\recurselevel-\plusone\relax}%
+ \presetcurrentstone
+ {\ifnum\boardrow=\zerocount
+ \plusthree
+ \else\ifnum\boardrow=\numexpr\boardsize+\plusone\relax
+ \plusthree
+ \else\ifnum\boardcolumn=\zerocount
+ \plusthree
+ \else\ifnum\boardcolumn=\numexpr\boardsize+\plusone\relax
+ \plusthree
+ \else
+ \zerocount
+ \fi\fi\fi\fi}}}}
+
+\let\laststone\plusone
+
+%D \macros{addstone}
+%D
+%D The \tex{addstone} is the used to place a stone on the board.
+%D The three arguments keeps the current row, the column and the
+%D stone color. The values for the row and the column have to be
+%D a number, the stone color has do be given with the two values
+%D \type{B} for black and \type{W} for white.
+
+\def\addstone(#1:#2:#3)%
+ {\global\advance\stonecount\plusone
+ \ifx#3B
+ \global\let\laststone\plusone
+ \else\ifx#3W
+ \global\let\laststone\plustwo
+ \fi\fi
+ \setevalue{field:\number#1:\number#2}%
+ {\ifx#3B
+ \plusone
+ \else\ifx#3W
+ \plustwo
+ \fi\fi:\number\stonecount}}
+
+\def\blackstone
+ {\let\stone \plusone
+ \let\enemy \plustwo
+ \let\wall \plusthree
+ \let\marked\plusfour
+ \let\dead \plusseven}
+
+\def\whitestone
+ {\let\stone \plustwo
+ \let\enemy \plusone
+ \let\wall \plusthree
+ \let\marked\plusfive
+ \let\dead \plusseven}
+
+\def\firstofcurrentstone #1:#2\relax{\number#1}
+\def\secondofcurrentstone#1:#2\relax{\number#2}
+
+\def\currentstone
+ {\@EA\@EA\@EA\@EA\@EA\@EA\@EA\firstofcurrentstone\getvalue{field:\boardrow:\boardcolumn}\relax}
+
+\def\currentstonenumber
+ {\@EA\@EA\@EA\@EA\@EA\@EA\@EA\secondofcurrentstone\getvalue{field:\boardrow:\boardcolumn}\relax}
+
+\def\leftstone
+ {\@EA\@EA\@EA\@EA\@EA\@EA\@EA\firstofcurrentstone\getvalue{field:\boardrow:\the\numexpr\boardcolumn-\plusone\relax}\relax}
+
+\def\rightstone
+ {\@EA\@EA\@EA\@EA\@EA\@EA\@EA\firstofcurrentstone\getvalue{field:\boardrow:\the\numexpr\boardcolumn+\plusone\relax}\relax}
+
+\def\topstone
+ {\@EA\@EA\@EA\@EA\@EA\@EA\@EA\firstofcurrentstone\getvalue{field:\the\numexpr\boardrow-\plusone\relax:\boardcolumn}\relax}
+
+\def\bottomstone
+ {\@EA\@EA\@EA\@EA\@EA\@EA\@EA\firstofcurrentstone\getvalue{field:\the\numexpr\boardrow+\plusone\relax:\boardcolumn}\relax}
+
+\newif\iftracingstones
+
+\def\doprocessstones
+ {\markstones
+ \iftracingstones\placeterminalboard\fi
+ \deadstones
+ \dorecurse\deadcount\checkstones
+ \revertstones}
+
+\def\processtones
+ {\ifcase\laststone
+ \or\processwhitetones\processblackstones
+ \or\processblackstones\processwhitetones
+ \fi}
+
+\def\processblackstones
+ {\blackstone
+ \doprocessstones}
+
+\def\processwhitetones
+ {\whitestone
+ \doprocessstones}
+
+\def\setstonemark
+ {\setcurrentstone{\ifcase\stone\or\plusfour\or\plusfive\else\plussix\fi}}
+
+%D \macros{markstones}
+%D
+%D The first internal command is \tex{markstones}, it set the stone value
+%D to marked if all consitions are true, otherwise the state will remain
+%D with the old value and we check the next one.
+
+\def\markbottomstone
+ {\ifcase\bottomstone
+ \or\setstonemark
+ \or\setstonemark
+ \or\setstonemark
+ \fi}
+
+\def\markrightstone
+ {\ifcase\rightstone
+ \or\markbottomstone
+ \or\markbottomstone
+ \or\markbottomstone
+ \fi}
+
+\def\marktopstone
+ {\ifcase\topstone
+ \or\ifnum\stone=\plusone\else\markrightstone\fi
+ \or\ifnum\stone=\plustwo\else\markrightstone\fi
+ \or\markrightstone
+ \or\ifnum\stone=\plusone\relax\markrightstone\fi
+ \or\ifnum\stone=\plustwo\relax\markrightstone\fi
+ \fi}
+
+\def\markstones
+ {\dorecurse\boardsize
+ {\edef\boardrow{\recurselevel}%
+ \dorecurse\boardsize
+ {\edef\boardcolumn{\recurselevel}%
+ \ifnum\currentstone=\stone
+ \ifcase\leftstone
+ \or\ifnum\stone=\plusone\else\marktopstone\fi
+ \or\ifnum\stone=\plustwo\else\marktopstone\fi
+ \or\marktopstone
+ \or\ifnum\stone=\plusone\relax\marktopstone\fi
+ \or\ifnum\stone=\plustwo\relax\marktopstone\fi
+ \fi
+ \fi}}}
+
+%D \macros{deadstones}
+%D
+%D The \tex{deadstones} macro check the marked stones from the last
+%D step for a dead state. We will now state from the right bottom and
+%D go to the left top corner.
+
+\def\deadleftstone
+ {\ifcase\leftstone
+ \or\ifnum\stone=\plusone\else\setdeadstone\fi
+ \or\ifnum\stone=\plustwo\else\setdeadstone\fi
+ \or\setdeadstone
+ \or\setdeadstone
+ \or\setdeadstone
+ \fi}
+
+\def\deadbottomstone
+ {\ifcase\bottomstone
+ \or\ifnum\stone=\plusone\else\deadleftstone\fi
+ \or\ifnum\stone=\plustwo\else\deadleftstone\fi
+ \or\deadleftstone
+ \or\resetdeadstone
+ \or\resetdeadstone
+ \or\resetdeadstone
+ \or\deadleftstone
+ \fi}
+
+\def\deadstones
+ {\dostepwiserecurse\boardsize\plusone\minusone
+ {\edef\boardrow{\recurselevel}%
+ \dostepwiserecurse\boardsize\plusone\minusone
+ {\edef\boardcolumn{\recurselevel}%
+ \ifnum\currentstone=\marked
+ \ifcase\rightstone
+ \or\ifnum\stone=\plusone\else\deadbottomstone\fi
+ \or\ifnum\stone=\plustwo\else\deadbottomstone\fi
+ \or\deadbottomstone
+ \or
+ \or
+ \or
+ \or\deadbottomstone
+ \fi
+ \fi}}}
+
+%D \macros{revertstones}
+%D
+%D The \tex{revertstones} is called after all dead stones are and we will
+%D make the board ready for the next move. There are still fields with the
+%D value marked on the board and we have to make sure they get their normal
+%D state with the values for stone and enemy.
+
+\def\revertstones
+ {\dorecurse\boardsize
+ {\edef\boardrow{\recurselevel}%
+ \dorecurse\boardsize
+ {\edef\boardcolumn{\recurselevel}%
+ \ifcase\currentstone
+ \or
+ \or
+ \or
+ \or\resetstone
+ \or\resetstone
+ \or
+ \or\removedeadstone
+ \fi}}}
+
+\def\presetcurrentstone#1%
+ {\setxvalue{field:\boardrow:\boardcolumn}{\number#1:0}}
+
+\def\setcurrentstone#1%
+ {\setxvalue{field:\boardrow:\boardcolumn}{\number#1:\number\currentstonenumber}}
+
+\def\setdeadstone
+ {\setcurrentstone{\plusseven}}
+
+\def\resetdeadstone
+ {\setcurrentstone{\ifcase\stone\or\plusone\or\plustwo\else\plussix\fi}}
+
+\let\resetstone\resetdeadstone
+
+\def\keepdeadstone
+ {\setcurrentstone{\ifcase\stone\or\plusseven\or\plusseven\else\plussix\fi}}
+
+\def\removedeadstone
+ {\appendtodeadstonelist
+ \setcurrentstone{\zerocount}}
+
+%D \macros{deadblackstones,deadwhitestones}
+%D
+%D The dead stones we found in one run are saved in two commalists, their names
+%D are \tex{deadblacktones} and \tex{deadwhitestones}. They can be used by users
+%D to their positions and numbers in their own macros.
+
+\def\appendtodeadstonelist
+ {\ifcase\stone
+ \or\expanded{\appendtocommalist{{\boardrow:\boardcolumn:\number\stone:\currentstonenumber}}}\deadblackstones
+ \or\expanded{\appendtocommalist{{\boardrow:\boardcolumn:\number\stone:\currentstonenumber}}}\deadwhitestones
+ \fi}
+
+\def\cleardeadstonelist
+ {\let\deadblackstones\empty
+ \let\deadwhitestones\empty}
+
+%D \macros{checkstones}
+%D
+%D As one of the first examples has shown sometimes still living stones
+%D get the value dead in the last step and we have to check for such
+%D a case. Tests has shown this need to be done at least two times and
+%D make sure this can be increased without problems users can change this
+%D with the counter \tex{deadcount} but you should also know increasing
+%D this counter will result in longer processing time.
+
+\def\checkdeadstones
+ {\ifcase\leftstone
+ \or\ifnum\stone=\plusone\relax\resetdeadstone\else\checktopdeadstone\fi
+ \or\ifnum\stone=\plustwo\relax\resetdeadstone\else\checktopdeadstone\fi
+ \or\checktopdeadstone
+ \or\resetdeadstone
+ \or\resetdeadstone
+ \or\resetdeadstone
+ \or\checktopdeadstone
+ \fi}
+
+\def\checktopdeadstone
+ {\ifcase\topstone
+ \or\ifnum\stone=\plusone\relax\resetdeadstone\else\checkrightdeadstone\fi
+ \or\ifnum\stone=\plustwo\relax\resetdeadstone\else\checkrightdeadstone\fi
+ \or\checkrightdeadstone
+ \or\resetdeadstone
+ \or\resetdeadstone
+ \or\resetdeadstone
+ \or\checkrightdeadstone
+ \fi}
+
+\def\checkrightdeadstone
+ {\ifcase\rightstone
+ \or\ifnum\stone=\plusone\relax\resetdeadstone\else\checkbottomdeadstone\fi
+ \or\ifnum\stone=\plustwo\relax\resetdeadstone\else\checkbottomdeadstone\fi
+ \or\checkbottomdeadstone
+ \or\resetdeadstone
+ \or\resetdeadstone
+ \or\resetdeadstone
+ \or\checkbottomdeadstone
+ \fi}
+
+\def\checkbottomdeadstone
+ {\ifcase\bottomstone
+ \or\ifnum\stone=\plusone\relax\resetdeadstone\else\keepdeadstone\fi
+ \or\ifnum\stone=\plustwo\relax\resetdeadstone\else\keepdeadstone\fi
+ \or\keepdeadstone
+ \or\resetdeadstone
+ \or\resetdeadstone
+ \or\resetdeadstone
+ \or\keepdeadstone
+ \fi}
+
+\def\checkstones
+ {\dorecurse\boardsize
+ {\edef\boardrow{\recurselevel}%
+ \dorecurse\boardsize
+ {\edef\boardcolumn{\recurselevel}%
+ \ifcase\currentstone
+ \or
+ \or
+ \or
+ \or\ifnum\stone=\plusone\relax\resetdeadstone\fi
+ \or\ifnum\stone=\plustwo\relax\resetdeadstone\fi
+ \or
+ \or\checkdeadstones
+ \fi}}}
+
+\protect \endinput
diff --git a/obsolete/macros/context/contrib/context-sgf/tex/context/third/sgf/deadstone.mkiv b/obsolete/macros/context/contrib/context-sgf/tex/context/third/sgf/deadstone.mkiv new file mode 100644 index 0000000000..6b0513fb38 --- /dev/null +++ b/obsolete/macros/context/contrib/context-sgf/tex/context/third/sgf/deadstone.mkiv @@ -0,0 +1,63 @@ +%D \module
+%D [ file=deadstone,
+%D version=2007.07.31,
+%D title=\CONTEXT\ User Module,
+%D subtitle=Dead stone calculator for go,
+%D author=Wolfgang Schuster,
+%D email=schuster.wolfgang@googlemail.com,
+%D date=\currentdate,
+%D copyright=Public Domain]
+
+\unprotect
+
+%D This is the \MKIV\ part of the dead stone calculator, it was
+%D written to get rid of tex \TEX\ workarounds used in the \MKII\
+%D version. If you want to understand how the algoritm works you
+%D should use the \LUA\ implementation.
+%D
+%D The functions to calculate the current state of the stones are
+%D saved in a seperate \LUA\ file, loading this file is the first
+%D thing we do here.
+
+\ctxloadluafile{deadstone}{}
+
+%D The \tex{clearboard} command is only a call to the \LUA\
+%D implementation and no longer a \TEX\ loop as in the first version.
+
+\def\clearboard{\ctxlua{clearboard()}}
+
+\def\processtones{\ctxlua{processtones()}}
+
+%D \macros{addstone}
+%D
+%D The \tex{addstone} macro is shorter as in the \MKII\ version because
+%D I can now use \tex{doifelse} and can avoid the low level \tex{ifx}
+%D test as needed before. I can now also pass laststone as argument for
+%D \tex{ctxlua} and prevent a extra \tex{ifx} as before.
+
+\def\addstone(#1:#2:#3)%
+ {\global\advance\stonecount\plusone
+ \doifelse{#3}{B}
+ {\ctxlua{field[#1][#2] = { 1, tex.count.stonecount }; laststone = 1}}
+ {\doif{#3}{W}
+ {\ctxlua{field[#1][#2] = { 2, tex.count.stonecount }; laststone = 2}}}}
+
+\def\currentstone
+ {\ctxlua{tex.print(field[\boardrow][\boardcolumn][1])}}
+
+\def\currentstonenumber
+ {\ctxlua{tex.print(field[\boardrow][\boardcolumn][2])}}
+
+%D \macros{cleardeadstonelist}
+%D
+%D This is the only pure \TEX\ command I use in this module, all other
+%D commands are only wrappers for the \LUA\ part but I need this because
+%D the two commands \tex{deadblackstones} and \tex{deadwhitestones} can
+%D be used by other macros and this seems to be the best solution I found
+%D for the moment.
+
+\def\cleardeadstonelist
+ {\let\deadblackstones\empty
+ \let\deadwhitestones\empty}
+
+\protect
diff --git a/obsolete/macros/context/contrib/context-sgf/tex/context/third/sgf/go-view-test-1.tex b/obsolete/macros/context/contrib/context-sgf/tex/context/third/sgf/go-view-test-1.tex new file mode 100644 index 0000000000..cbecb8ea35 --- /dev/null +++ b/obsolete/macros/context/contrib/context-sgf/tex/context/third/sgf/go-view-test-1.tex @@ -0,0 +1,27 @@ +\usemodule[go]
+
+\starttext
+
+\setupboard
+ [calculate=yes,
+ alternative=a]
+
+\startSGF
+;B[jj];W[ji];B[jh];W[ij];B[ii];W[jk];B[ki];W[kj];B[lj];W[ji];B[kk];W[lk]
+\stopSGF
+
+\setupboard
+ [alternative=b]
+
+\startSGF
+;B[jj];W[ji];B[jh];W[ij];B[ii];W[jk];B[ki];W[kj];B[lj];W[ji];B[kk];W[lk]
+\stopSGF
+
+\setupboard
+ [alternative=c]
+
+\startSGF
+;B[jj];W[ji];B[jh];W[ij];B[ii];W[jk];B[ki];W[kj];B[lj];W[ji];B[kk];W[lk]
+\stopSGF
+
+\stoptext
diff --git a/obsolete/macros/context/contrib/context-sgf/tex/context/third/sgf/go-view-test-2.tex b/obsolete/macros/context/contrib/context-sgf/tex/context/third/sgf/go-view-test-2.tex new file mode 100644 index 0000000000..e01d7b3c2a --- /dev/null +++ b/obsolete/macros/context/contrib/context-sgf/tex/context/third/sgf/go-view-test-2.tex @@ -0,0 +1,27 @@ +\usemodule[go]
+
+\starttext
+
+\setupboard
+ [calculate=yes]
+
+\startSGF
+;B[qd];W[cp];B[pp];W[dc];B[ep];W[od];B[cq];W[de];B[oc];W[nc]
+;B[pc];W[nd];B[qf];W[bq];B[dq];W[bo];B[iq];W[jd];B[dm];W[cn]
+;B[dn];W[nq];B[np];W[op];B[oo];W[oq];B[pq];W[po];B[qo];W[pn]
+;B[mp];W[qn];B[mq];W[ro];B[rq];W[qh];B[nn];W[nl];B[lb];W[mb]
+;B[lc];W[ic];B[le];W[pe];B[qe];W[og];B[kf];W[if];B[kh];W[lg]
+;B[jf];W[ig];B[jh];W[hi];B[mi];W[oi];B[mk];W[nj];B[mj];W[ch]
+;B[ei];W[hk];B[eg];W[fh];B[eh];W[cf];B[ci];W[cj];B[bi];W[dj]
+;B[ej];W[di];B[cg];W[bg];B[bh];W[dg];B[dh];W[cg];B[bk];W[bj]
+;B[dk];W[ah];B[nk];W[ok];B[ol];W[pl];B[hm];W[il];B[im];W[kl]
+;B[ml];W[fk];B[gj];W[fj];B[fi];W[gi];B[fl];W[jm];B[jk];W[jl]
+;B[ek];W[gk];B[br];W[ar];B[bs];W[do];B[bm];W[eo];B[bn];W[fo]
+;B[gp];W[hp];B[gq];W[go];B[fm];W[io];B[jn];W[hq];B[gr];W[hr]
+;B[jq];W[kq];B[kr];W[kp];B[jr];W[lr];B[lq];W[mr];B[kn];W[jp]
+;B[ls];W[nr];B[ns];W[os];B[ks];W[fp];B[fq];W[er];B[eq];W[dr]
+;B[cr];W[ds];B[fs];W[hs];B[gs];W[ho];B[es];W[in];B[ck];W[lm]
+;B[ln];W[mm];B[nm];W[mn];B[lo]
+\stopSGF
+
+\stoptext
diff --git a/obsolete/macros/context/contrib/context-sgf/tex/context/third/sgf/go-view-test-3.tex b/obsolete/macros/context/contrib/context-sgf/tex/context/third/sgf/go-view-test-3.tex new file mode 100644 index 0000000000..9b53493f20 --- /dev/null +++ b/obsolete/macros/context/contrib/context-sgf/tex/context/third/sgf/go-view-test-3.tex @@ -0,0 +1,21 @@ +\usemodule[go]
+
+\starttext
+
+\setupboard
+ [calculate=yes,
+ alternative=b]
+
+\startSGF
+;B[jj];W[ji];B[jh];W[ij];B[ii];W[jk];B[ki];W[kj];B[lj];W[ji];B[kk];W[lk];B[jj]
+\stopSGF
+
+\setupboard
+ [conversion=stone 1,
+ size=small]
+
+\startSGF
+;B[de];B[ed];W[ee];B[ef];B[fe]
+\stopSGF
+
+\stoptext
diff --git a/obsolete/macros/context/contrib/context-sgf/tex/context/third/sgf/go-view-test-4.tex b/obsolete/macros/context/contrib/context-sgf/tex/context/third/sgf/go-view-test-4.tex new file mode 100644 index 0000000000..644e7acac1 --- /dev/null +++ b/obsolete/macros/context/contrib/context-sgf/tex/context/third/sgf/go-view-test-4.tex @@ -0,0 +1,34 @@ +\usemodule[go]
+
+\starttext
+
+\setupboard
+ [calculate=yes]
+
+\startSGF
+;B[ji];W[jl];B[ij];W[ik];B[kj];W[kk];B[jk];W[jj]
+;B[jk];W[jj];B[jk];W[jj];B[jk];W[jj];B[jk];W[jj]
+;B[jk];W[jj];B[jk];W[jj];B[jk];W[jj];B[jk];W[jj]
+;B[jk];W[jj];B[jk];W[jj];B[jk];W[jj];B[jk];W[jj]
+;B[jk];W[jj];B[jk];W[jj];B[jk];W[jj];B[jk];W[jj]
+\stopSGF
+
+\setupboard
+ [alternative=b]
+
+\startSGF
+;B[ji];W[jl];B[ij];W[ik];B[kj];W[kk];B[jk];W[jj]
+;B[jk];W[jj];B[jk];W[jj];B[jk];W[jj];B[jk];W[jj]
+;B[jk];W[jj];B[jk];W[jj];B[jk];W[jj];B[jk];W[jj]
+;B[jk];W[jj];B[jk];W[jj];B[jk];W[jj];B[jk];W[jj]
+;B[jk];W[jj];B[jk];W[jj];B[jk];W[jj];B[jk];W[jj]
+;B[jk];W[jj];B[jk];W[jj];B[jk];W[jj];B[jk];W[jj]
+;B[jk];W[jj];B[jk];W[jj];B[jk];W[jj];B[jk];W[jj]
+;B[jk];W[jj];B[jk];W[jj];B[jk];W[jj];B[jk];W[jj]
+;B[jk];W[jj];B[jk];W[jj];B[jk];W[jj];B[jk];W[jj]
+;B[jk];W[jj];B[jk];W[jj];B[jk];W[jj];B[jk];W[jj]
+;B[jk];W[jj];B[jk];W[jj];B[jk];W[jj];B[jk];W[jj]
+;B[jk];W[jj];B[jk];W[jj];B[jk];W[jj];B[jk];W[jj]
+\stopSGF
+
+\stoptext
diff --git a/obsolete/macros/context/contrib/context-sgf/tex/context/third/sgf/go-view-test-5.tex b/obsolete/macros/context/contrib/context-sgf/tex/context/third/sgf/go-view-test-5.tex new file mode 100644 index 0000000000..b7c55fd1de --- /dev/null +++ b/obsolete/macros/context/contrib/context-sgf/tex/context/third/sgf/go-view-test-5.tex @@ -0,0 +1,21 @@ +\usemodule[go]
+
+\starttext
+
+\startSGF[printable=yes]
+;B[jj];W[ji];B[jh];W[ij];B[ii];W[jk];B[ki];W[kj];B[lj];W[ji];B[kk];W[lk];B[jj]
+\stopSGF
+
+\startSGF[printable=no]
+;B[jj];W[ji];B[jh];W[ij];B[ii];W[jk];B[ki];W[kj];B[lj];W[ji];B[kk];W[lk];B[jj]
+\stopSGF
+
+\startSGF[printable=no,calculate=yes]
+;B[jj];W[ji];B[jh];W[ij];B[ii];W[jk];B[ki];W[kj];B[lj];W[ji];B[kk];W[lk];B[jj]
+\stopSGF
+
+\startSGF
+;B[jj];W[ji];B[jh];W[ij];B[ii];W[jk];B[ki];W[kj];B[lj];W[ji];B[kk];W[lk];B[jj]
+\stopSGF
+
+\stoptext
diff --git a/obsolete/macros/context/contrib/context-sgf/tex/context/third/sgf/t-deadstone.tex b/obsolete/macros/context/contrib/context-sgf/tex/context/third/sgf/t-deadstone.tex new file mode 100644 index 0000000000..dab8ad9f3d --- /dev/null +++ b/obsolete/macros/context/contrib/context-sgf/tex/context/third/sgf/t-deadstone.tex @@ -0,0 +1,90 @@ +%D \module
+%D [ file=t-deadstone,
+%D version=2007.07.31,
+%D title=\CONTEXT\ User Module,
+%D subtitle=Dead stone calculator for go,
+%D author=Wolfgang Schuster,
+%D email=schuster.wolfgang@googlemail.com,
+%D date=\currentdate,
+%D copyright=Public Domain]
+
+
+\writestatus{loading}{Context User Module / Dead stone calculator for go}
+
+\unprotect
+
+\newcount\boardsize
+\newcount\deadcount
+\newcount\stonecount
+
+\chardef\plussix =6
+\chardef\plusseven=7
+
+\boardsize=19
+\deadcount=2
+
+%D \macros{placeboard,placeterminalboard}
+%D
+%D The following two commands can be used to draw a simple board with
+%D the current state, \tex{placeboard} is only used for testing the module
+%D and let me see the current values of every node.
+%D
+%D The second board is intended for tracing the output and calculations
+%D of my macros on the terminal and will also appear in the log file
+%D if the user has it enabled. It use a symbols instead of numeric values
+%D for the output.
+%D
+%D Only meant for my test files and not for real output. I need another
+%D name to prevent a clash with another modules.
+
+\def\intersctionfield{.} % was previously 0
+\def\blackfield {X} % was previously 1
+\def\whitefield {O} % was previously 2
+\def\fieldstyle {\tt}
+
+\def\placeboard
+ {\dorecurse{\the\boardsize}
+ {\edef\boardrow{\recurselevel}%
+ \hbox{\dorecurse{\the\boardsize}
+ {\edef\boardcolumn{\recurselevel}%
+ \hbox\!!to1em
+ {\hss\fieldstyle % switched from roman to mono
+ \ifcase\currentstone\relax
+ \intersctionfield\or
+ \blackfield \or
+ \whitefield \or
+ 3\ignorespaces \or
+ 4\ignorespaces \or
+ 5\ignorespaces \or
+ 6\ignorespaces \or
+ 7\ignorespaces \fi\hss}}}}}
+
+%D Todo:
+%D
+%D \startitemize[intro]
+%D \item header above every board
+%D \item empty line before and after every board
+%D \item frame for the baord on all four sides
+%D \stopitemize
+
+\def\placeterminalboard
+ {\newlinechar=`\^^J
+ \message{^^J}% start a new line before we place the board
+ \dorecurse{\the\boardsize}
+ {\edef\boardrow{\recurselevel}%
+ \edef\zahl{ }% put a space to the left of the line
+ \dorecurse{\the\boardsize}
+ {\edef\boardcolumn{\recurselevel}%
+ \edef\zahl
+ {\zahl
+ \ifcase\currentstone
+ \intersctionfield\space\or
+ \blackfield \space\or
+ \whitefield \space\fi}}
+ \message{\zahl^^J}}} % place the current line and move to the next
+
+%D Loading of the mkii and mkiv files.
+
+\loadmarkfile{deadstone}
+
+\protect \endinput
diff --git a/obsolete/macros/context/contrib/context-sgf/tex/context/third/sgf/t-go.tex b/obsolete/macros/context/contrib/context-sgf/tex/context/third/sgf/t-go.tex new file mode 100644 index 0000000000..f527aacfd5 --- /dev/null +++ b/obsolete/macros/context/contrib/context-sgf/tex/context/third/sgf/t-go.tex @@ -0,0 +1,16 @@ +%D \module
+%D [ file=t-go,
+%D version=2007.09.09,
+%D title=\CONTEXT\ User Module,
+%D subtitle=Go Module,
+%D author={Zhichu Chen \& Wolfgang Schuster},
+%D date=\currentdate,
+%D copyright=Public Domain]
+
+\writestatus{loading}{Context User Module / Go Module}
+
+\unprotect
+
+\usemodule[sgf]
+
+\protect \endinput
diff --git a/obsolete/macros/context/contrib/context-sgf/tex/context/third/sgf/t-sgf-generic.tex b/obsolete/macros/context/contrib/context-sgf/tex/context/third/sgf/t-sgf-generic.tex new file mode 100644 index 0000000000..c703e99061 --- /dev/null +++ b/obsolete/macros/context/contrib/context-sgf/tex/context/third/sgf/t-sgf-generic.tex @@ -0,0 +1,108 @@ +%D \module
+%D [ file=t-go-generic,
+%D version=2007.08.15,
+%D title=\CONTEXT\ User Module,
+%D subtitle=Go extensions,
+%D author={Zhichu Chen \& Wolfgang Schuster},
+%D date=\currentdate,
+%D copyright=Public Domain]
+
+\writestatus{loading}{Context User Module / Go extensions}
+
+\unprotect
+
+\startvariables all
+ game: game
+ stone: stone
+ black: black
+ white: white
+\stopvariables
+
+\startconstants all
+ printable: printable
+\stopconstants
+
+\def\????bd{@@@@bd} % BoarD
+
+\newif\ifhighlightlabel \highlightlabeltrue
+
+\def\dosetupboardsize[#1]%
+ {\assigndimension{#1}\boardsize{9}{13}{19}}
+
+\def\setupboardsize
+ {\dosingleargument\dosetupboardsize}
+
+\def\dosetupboard[#1][#2]%
+ {\ifsecondargument
+ \getparameters[\????bd#1][#2]%
+ \else
+ \getparameters[\????bd][#1]%
+ \setupboardsize[\@@@@bdsize]%
+ \fi}
+
+\def\setupboard
+ {\dodoubleempty\dosetupboard}
+
+\def\charactertonumber#1%
+ {\ifx#1a1\else
+ \ifx#1b2\else
+ \ifx#1c3\else
+ \ifx#1d4\else
+ \ifx#1e5\else
+ \ifx#1f6\else
+ \ifx#1g7\else
+ \ifx#1h8\else
+ \ifx#1i9\else
+ \ifx#1j10\else
+ \ifx#1k11\else
+ \ifx#1l12\else
+ \ifx#1m13\else
+ \ifx#1n14\else
+ \ifx#1o15\else
+ \ifx#1p16\else
+ \ifx#1q17\else
+ \ifx#1r18\else
+ \ifx#1s19\else
+ \ifx#1t20\else
+ \ifx#1u21\else
+ \ifx#1v22\else
+ \ifx#1w23\else
+ \ifx#1x24\else
+ \ifx#1y25\else
+ \ifx#1z26\fi\fi
+ \fi\fi\fi\fi\fi
+ \fi\fi\fi\fi\fi
+ \fi\fi\fi\fi\fi
+ \fi\fi\fi\fi\fi
+ \fi\fi\fi\fi}
+
+\def\sgfcharacter#1%
+ {\ifcase#1\unknowncharacter
+ \or A\or B\or C\or D\or E\or F\or G\or H\or J\or K\or L\or M\or N%
+ \or O\or P\or Q\or R\or S\or T\or U\or V\or W\or X\or Y\or Z\or
+ \else
+ \unknowncharacter
+ \fi}
+
+\setupboard
+ [\c!alternative=\v!a,
+ \c!calculate=\v!no,
+ \c!color=\v!black,
+ \c!conversion=stone 2,
+ \c!distance=\boardunit,
+ \c!n=3,
+ \c!printable=\v!no,
+ \c!size=\v!big,
+ \c!style=\v!sans]
+
+\setupboard
+ [\v!black]
+ [\c!style=\@@@@bdstyle,
+ \c!color=\v!white]
+
+\setupboard
+ [\v!white]
+ [\c!style=\@@@@bdstyle,
+ \c!color=\v!black]
+
+\protect \endinput
diff --git a/obsolete/macros/context/contrib/context-sgf/tex/context/third/sgf/t-sgf-library.tex b/obsolete/macros/context/contrib/context-sgf/tex/context/third/sgf/t-sgf-library.tex new file mode 100644 index 0000000000..972f24e718 --- /dev/null +++ b/obsolete/macros/context/contrib/context-sgf/tex/context/third/sgf/t-sgf-library.tex @@ -0,0 +1,163 @@ +%D \module
+%D [ file=t-go-library,
+%D version=2007.08.15,
+%D title=\CONTEXT\ User Module,
+%D subtitle=Go extensions,
+%D author={Zhichu Chen \& Wolfgang Schuster},
+%D date=\currentdate,
+%D copyright=Public Domain]
+
+\writestatus{loading}{Context User Module / Go extensions}
+
+\unprotect
+
+\startMPinitializations
+ StoneUnit=\the\stoneunit ;
+ BoardSize=\the\boardsize ;
+ BoardUnit=\the\boardunit ;
+ BoardColumns=\@@@@bdn ;
+
+ GridWidth=.7pt ;
+
+ defaultfont := "cmss10" ;
+ defaultscale := .05*BoardUnit ;
+
+ vardef Alph (expr n) =
+ if (n = 1) : "A"
+ elseif (n = 2) : "B"
+ elseif (n = 3) : "C"
+ elseif (n = 4) : "D"
+ elseif (n = 5) : "E"
+ elseif (n = 6) : "F"
+ elseif (n = 7) : "G"
+ elseif (n = 8) : "H"
+ elseif (n = 9) : "J"
+ elseif (n = 10) : "K"
+ elseif (n = 11) : "L"
+ elseif (n = 12) : "M"
+ elseif (n = 13) : "N"
+ elseif (n = 14) : "O"
+ elseif (n = 15) : "P"
+ elseif (n = 16) : "Q"
+ elseif (n = 17) : "R"
+ elseif (n = 18) : "S"
+ elseif (n = 19) : "T"
+ fi
+ enddef ;
+\stopMPinitializations
+
+%D Stone set 1, simple black and white stones:
+
+\startreusableMPgraphic{blackstone pure}
+drawfill fullcircle scaled StoneUnit withcolor black ;
+\stopreusableMPgraphic
+
+\startreusableMPgraphic{whitestone pure}
+fill fullcircle scaled StoneUnit withcolor white ;
+draw fullcircle scaled StoneUnit withcolor black ;
+\stopreusableMPgraphic
+
+%D Stone set 2, shaded black and white stones:
+
+\startreusableMPgraphic{blackstone shade}
+circular_shade ( fullcircle scaled StoneUnit , 4 , \MPcolor{gray} , black ) ;
+\stopreusableMPgraphic
+
+\startreusableMPgraphic{whitestone shade}
+circular_shade ( fullcircle scaled StoneUnit , 2 , .8white , white ) ;
+\stopreusableMPgraphic
+
+%D The board, one for all stone sets.
+
+\startuseMPgraphic{board}
+numeric u , v ;
+if "\@@@@bdalternative"="a" :
+ u = OverlayWidth/(BoardSize+2) ;
+ v = (OverlayHeight-BoardColumns*2*BoardUnit)/(BoardSize+2) ;
+elseif "\@@@@bdalternative"="b":
+ u = (OverlayWidth-BoardColumns*4*BoardUnit)/(BoardSize+2) ;
+ v = OverlayHeight/(BoardSize+2) ;
+elseif "\@@@@bdalternative"="c":
+ u = OverlayWidth/(BoardSize+2) ;
+ v = OverlayHeight/(BoardSize+2) ;
+fi
+
+for i=3 upto BoardSize :
+ draw ((2u,-i*v)--((BoardSize+1)*u,-i*v))
+ if "\@@@@bdalternative"="a" :
+ shifted (-.5u,.5v)
+ elseif "\@@@@bdalternative"="b" :
+ shifted (BoardColumns*2*BoardUnit-.5u,.5v)
+ elseif "\@@@@bdalternative"="c" :
+ shifted (-.5u,.5v)
+ fi withpen pencircle scaled GridWidth ;
+ draw ((i*u,-2v)--(i*u,(BoardSize+1)*-v))
+ if "\@@@@bdalternative"="a" :
+ shifted (-.5u,.5v)
+ elseif "\@@@@bdalternative"="b" :
+ shifted (BoardColumns*2*BoardUnit-.5u,.5v)
+ elseif "\@@@@bdalternative"="c" :
+ shifted (-.5u,.5v)
+ fi withpen pencircle scaled GridWidth ;
+endfor
+
+draw if "\@@@@bdalternative"="b" : ( fi
+ (1.5u,-1.5v)--(1.5u,(-.5-BoardSize)*v)--
+ ((BoardSize+.5)*u,(-.5-BoardSize)*v)--
+ ((BoardSize+.5)*u,-1.5v)--cycle
+ if "\@@@@bdalternative"="b" : ) shifted (BoardColumns*2*BoardUnit,0) fi
+ withpen pencircle scaled (2*GridWidth) ;
+
+if BoardSize=19 :
+ for i=4,10,16 :
+ for j=4,10,16 :
+ drawdot ((i+.5)*u , -(j+.5)*v)
+ if "\@@@@bdalternative"="b" : shifted (BoardColumns*2*BoardUnit,0) fi
+ withpen pencircle scaled (6*GridWidth) ;
+ endfor
+ endfor
+elseif BoardSize=13 :
+ for i=4,7,10 :
+ for j=4,7,10 :
+ drawdot ((i+.5)*u , -(j+.5)*v)
+ if "\@@@@bdalternative"="b" : shifted (BoardColumns*2*BoardUnit,0) fi
+ withpen pencircle scaled (6*GridWidth) ;
+ endfor
+ endfor
+elseif BoardSize=9 :
+ for i=3,7 :
+ for j=3,7 :
+ drawdot ((i+.5)*u , -(j+.5)*v)
+ if "\@@@@bdalternative"="b" : shifted (BoardColumns*2*BoardUnit,0) fi
+ withpen pencircle scaled (6*GridWidth) ;
+ endfor
+ endfor
+ drawdot ((5.5)*u , -(5.5)*v)
+ if "\@@@@bdalternative"="b" : shifted (BoardColumns*2*BoardUnit,0) fi
+ withpen pencircle scaled (6*GridWidth) ;
+fi
+
+%D Draw labels on the edge of the board
+for i=1 upto BoardSize :
+ label ( Alph(i) , ( if "\@@@@bdalternative"="b" : (i+2.5)*u else : (i+.5)*u fi , -.5*v ) )
+ if "\@@@@bdalternative"="b" : shifted ((BoardColumns-1)*2*BoardUnit,0) fi ;
+ label ( decimal i, ( if "\@@@@bdalternative"="b" : 2.5*u else : .5*u fi , ( BoardSize - i + 1.5 ) * (-v) ) )
+ if "\@@@@bdalternative"="b" : shifted ((BoardColumns-1)*2*BoardUnit,0) fi ;
+endfor
+
+setbounds currentpicture to (0,0)--(OverlayWidth,0)--(OverlayWidth,-OverlayHeight)--(0,-OverlayHeight)--cycle;
+\stopuseMPgraphic
+
+%D Here we define a conversion set for our two stone sets.
+
+\defineconversion
+ [stone 1]
+ [\reuseMPgraphic{blackstone pure},
+ \reuseMPgraphic{whitestone pure}]
+
+\defineconversion
+ [stone 2]
+ [\reuseMPgraphic{blackstone shade},
+ \reuseMPgraphic{whitestone shade}]
+
+\protect \endinput
diff --git a/obsolete/macros/context/contrib/context-sgf/tex/context/third/sgf/t-sgf.tex b/obsolete/macros/context/contrib/context-sgf/tex/context/third/sgf/t-sgf.tex new file mode 100644 index 0000000000..4909848d91 --- /dev/null +++ b/obsolete/macros/context/contrib/context-sgf/tex/context/third/sgf/t-sgf.tex @@ -0,0 +1,458 @@ +%D \module
+%D [ file=t-sgf,
+%D version=2007.09.09,
+%D title=\CONTEXT\ User Module,
+%D subtitle=Go Module,
+%D author={Zhichu Chen \& Wolfgang Schuster},
+%D date=\currentdate,
+%D copyright=Public Domain]
+
+\writestatus{loading}{Context User Module / Go Module}
+
+\unprotect
+
+%D The dead stone calculator, the board background and the
+%D stones are saved in two extra modules. The third module
+%D contains two extra conversion commands and the default setup.
+
+\usemodule[deadstone]
+\usemodule[sgf-generic]
+\usemodule[sgf-library]
+
+\useJSscripts[fld][FieldStack]
+
+\setuppagenumbering[\c!location=,\c!state=\v!stop]
+
+\setupcolors[\c!state=\v!start]
+\definecolor[boardbackground][r=1,g=.625,b=.0625]
+\definecolor[deadstonebackground][r=1,g=1,b=1]
+
+\setupinteraction
+ [\c!state=\v!start,
+ \c!focus=\v!height,
+ \c!page=\v!yes,
+ \c!openaction=\v!firstpage,
+ \c!click=\v!off]
+
+\newcounter\thegame
+\newcounter\thestep
+
+\definesymbol[\v!empty][]%
+
+\newdimen\stoneunit \stoneunit=.5632cm
+\newdimen\boardunit \boardunit=.6cm
+\newdimen\capturedunit \capturedunit=.4cm
+
+\defineoverlay[board][{\useMPgraphic{board}}]
+
+\setupinterlinespace
+ [\c!height=0,
+ \c!depth=1,
+ \c!top=0,
+ \c!bottom=0,
+ \c!line=\boardunit]
+
+%D \macros{drawboard}
+%D
+%D The main loop to draw the board with all stones and the
+%D stone numbers. The number color depends on the current
+%D stone color and on the currently placed stone.
+
+\def\drawboard
+ {\vbox{\dorecurse\boardsize
+ {\edef\boardrow{\recurselevel}%
+ \hbox{\dorecurse\boardsize
+ {\edef\boardcolumn{\recurselevel}%
+ \hbox\!!to\boardunit
+ {\hss\vbox\!!to\boardunit
+ {\vss
+ \ifcase\currentstone
+ \or\convertnumber\@@@@bdconversion\currentstone
+ \or\convertnumber\@@@@bdconversion\currentstone
+ \fi
+ \vss}\hss}%
+ \hskip-\boardunit
+ \hbox\!!to\boardunit
+ {\vbox\!!to\boardunit
+ {\hsize\boardunit
+ \vss
+ \ifhighlightlabel
+ \ifnum\currentstonenumber=\stonecount
+ \def\@@@@bdblackcolor{red}% I overload the preset values
+ \def\@@@@bdwhitecolor{red}% from the setupbaord settings!
+ \fi
+ \fi
+ \ifcase\currentstone
+ \or\hbox\!!to\hsize{\hss\doattributes{\????bd\v!black}\c!style\c!color\currentstonenumber\hss}
+ \or\hbox\!!to\hsize{\hss\doattributes{\????bd\v!white}\c!style\c!color\currentstonenumber\hss}
+ \fi
+ \vss}}}}}}}
+
+%D \macros{drawboarda,drawboardb,drawboardc}
+%D
+%D The next three macros take care of the three board alternatives
+%D and put the area for the removed stones on the left and right
+%D side or at the bottom.
+
+\def\drawboarda
+ {\increment\thestep
+ \definesymbol
+ [stone:\thegame:\thestep]
+ [{\vbox
+ {\offinterlineskip
+ \framed
+ [\c!offset=\boardunit,\c!frameoffset=\!!zeropoint,\c!strut=\v!no,
+ \c!top=\!!zeropoint,\c!bottom=\!!zeropoint,\c!depth=\!!zeropoint,
+ \c!frame=\v!off]
+ {\offinterlineskip
+ \drawboard}
+ \framed
+ [\c!frame=\v!off,
+ \c!width=\dimexpr\boardsize\boardunit+\plustwo\boardunit\relax,
+ \c!height=\numexpr\@@@@bdn*\plustwo\relax\boardunit,
+ \c!background=color,
+ \c!backgroundcolor=deadstonebackground]
+ {\vbox\!!to\vsize
+ {\vbox\!!to.5\vsize{\processdeadstones[\deadblackstones]\vfill}
+ \vbox\!!to.5\vsize{\processdeadstones[\deadwhitestones]\vfill}}}}}]}
+
+\def\drawboardb
+ {\increment\thestep
+ \definesymbol
+ [stone:\thegame:\thestep]
+ [{\hbox
+ {\framed
+ [\c!frame=\v!off,
+ \c!width=\numexpr\@@@@bdn*\plustwo\relax\boardunit,
+ \c!height=\dimexpr\boardsize\boardunit+\plustwo\boardunit\relax,
+ \c!background=color,
+ \c!backgroundcolor=deadstonebackground]%
+ {\vbox\!!to\vsize{\processdeadstones[\deadblackstones]\vfill}}%
+ \framed
+ [\c!offset=\boardunit,\c!frameoffset=\!!zeropoint,\c!strut=\v!no,
+ \c!top=\!!zeropoint,\c!bottom=\!!zeropoint,\c!depth=\!!zeropoint,
+ \c!frame=\v!off]%
+ {\offinterlineskip
+ \drawboard}%
+ \framed
+ [\c!frame=\v!off,
+ \c!width=\numexpr\@@@@bdn*\plustwo\relax\boardunit,
+ \c!height=\dimexpr\boardsize\boardunit+\plustwo\boardunit\relax,
+ \c!background=color,
+ \c!backgroundcolor=deadstonebackground]%
+ {\vbox\!!to\vsize
+ {\processdeadstones[\deadwhitestones]\vfill}}}}]}
+
+\def\drawboardc
+ {\increment\thestep
+ \definesymbol
+ [stone:\thegame:\thestep]
+ [{\framed
+ [\c!offset=\boardunit,\c!frameoffset=\!!zeropoint,\c!strut=\v!no,
+ \c!top=\!!zeropoint,\c!bottom=\!!zeropoint,\c!depth=\!!zeropoint,
+ \c!frame=\v!off]%
+ {\offinterlineskip
+ \drawboard}}]}
+
+%D \macros{processdeadstones}
+%D
+%D The removed stones in the interactive version are placed with
+%D the \tex{processdeadstones} command. It is called twice, once
+%D for the black stones and a second time for the white stones.
+
+\def\processdeadstones[#1]%
+ {\def\dodoprocessdeadstones##1:##2:##3:##4\relax
+ {\hbox\!!to\boardunit
+ {\hss\vbox\!!to\boardunit{\convertnumber\@@@@bdconversion{##3}}\hss}%
+ \hskip-\boardunit
+ \hbox\!!to\boardunit
+ {\vbox\!!to\boardunit
+ {\hsize\boardunit
+ \vss
+ \ifcase##3
+ \or\hbox\!!to\hsize{\hss\doattributes{\????bd\v!black}\c!style\c!color{##4}\hss}
+ \or\hbox\!!to\hsize{\hss\doattributes{\????bd\v!white}\c!style\c!color{##4}\hss}
+ \fi
+ \vss}}%
+ \hbox\!!to\boardunit
+ {\vbox\!!to\boardunit
+ {\vfill
+ \smallbodyfont % problems in mkiv
+ \hbox\!!to\hsize{\doattributes\????bd\c!style\c!color
+ {\sgfcharacter{##2}\Numbers{\numexpr\boardsize-##1+\plusone\relax}}\hss}
+ \vfill\vfill}}}%
+ \def\doprocessdeadstones##1%
+ {\ifdim\wd\scratchbox>\hsize
+ \hbox\!!to\hsize{\box\scratchbox\hss}%
+ \setbox\scratchbox\hbox
+ {\box\scratchbox\hbox\!!to\plustwo\boardunit{\@EA\dodoprocessdeadstones##1\relax}}%
+ \else
+ \setbox\scratchbox\hbox
+ {\box\scratchbox\hbox\!!to\plustwo\boardunit{\@EA\dodoprocessdeadstones##1\relax}}%
+ \fi}%
+ \processcommacommand[#1]\doprocessdeadstones
+ \hbox\!!to\hsize{\box\scratchbox\hss}}
+
+%D \macros{flushboard}
+%D
+%D After \tex{drawboard} with its three alternatives had drawn a board
+%D and saved it in a field we flush it with the \tex{flushboard} command.
+
+\def\flushboard
+ {\ifnum\thestep=\@@fdstart\relax
+ \definefield
+ [\v!game:\thegame:\thestep][\s!check][\v!game:\thegame]
+ [\v!stone:\thegame:\thestep,\v!empty]
+ [\v!stone:\thegame:\thestep]%
+ \else
+ \definefield
+ [\v!game:\thegame:\thestep][\s!check][\v!game:\thegame]
+ [\v!stone:\thegame:\thestep,\v!empty][\v!empty]%
+ \fi
+ \removeunwantedspaces
+ \vbox\!!to\!!zeropoint
+ {\vskip-\plusone\points\hbox\!!to\!!zeropoint{\fitfield[\v!game:\thegame:\thestep]\hss}\vss}%
+ \vskip-\baselineskip}
+
+\def\clearoverlapstatus
+ {\dorecurse\boardsize
+ {\edef\boardrow{\recurselevel}%
+ \dorecurse\boardsize
+ {\edef\boardcolumn{\recurselevel}%
+ \presetcurrentstatus{\zerocount}}}%
+ \global\let\overlaplist\empty}
+
+\def\presetcurrentstatus#1%
+ {\setxvalue{status:\boardrow:\boardcolumn}{#1}%
+ \resetvalue{overlap:\boardrow:\boardcolumn}}
+
+\def\makeoverlaplist#1%
+ {\appendtocommalist{#1}\overlaplist}
+
+\def\stonecolor#1%
+ {\@EA\@EA\@EA\@EA\@EA\@EA\@EA\firstofcurrentstone\getvalue{field:#1}\relax}
+
+\def\stonestep#1%
+ {\@EA\@EA\@EA\@EA\@EA\@EA\@EA\secondofcurrentstone\getvalue{field:#1}\relax}
+
+\def\currentstatus
+ {\getvalue{status:\boardrow:\boardcolumn}}
+
+\def\setstatus#1#2%
+ {\setevalue{status:\number#1:\number#2}}
+
+\def\setcurrentstatus
+ {\setstatus\boardrow\boardcolumn}
+
+\def\currentoverlap
+ {\getvalue{overlap:\boardrow:\boardcolumn}}
+
+\def\setoverlap#1#2%
+ {\setevalue{overlap:\number#1:\number#2}}
+
+\def\setcurrentoverlap
+ {\setoverlap\boardrow\boardcolumn}
+
+\def\dummystonebox
+ {\hbox\!!to\boardunit
+ {\hss\vbox\!!to\boardunit
+ {\vss
+ \ifcase\currentstone
+ \or\convertnumber\@@@@bdconversion\currentstone
+ \or\convertnumber\@@@@bdconversion\currentstone
+ \fi
+ \vss}%
+ \hss}%
+ \hskip-\boardunit
+ \hbox\!!to\boardunit
+ {\vbox\!!to\boardunit
+ {\hsize\boardunit
+ \vss
+ \ifcase\currentstone
+ \or\hbox\!!to\hsize{\hss\doattributes{\????bd\v!black}{\c!style}{\c!color}{\currentstonenumber}\hss}
+ \or\hbox\!!to\hsize{\hss\doattributes{\????bd\v!white}{\c!style}{\c!color}{\currentstonenumber}\hss}
+ \fi
+ \vss}}}
+
+%D \macros{adddummystone}
+%D
+%D This is a alternative for the \tex{addstone} command in the
+%D dead stone calculator. It saves only the position and states
+%D of every field in a macro and make a listentry if there is
+%D already a stone on the position and we replace it.
+
+\def\adddummystone(#1:#2:#3)%
+ {\global\advance\stonecount\plusone
+ \edef\boardrow{\number#1}%
+ \edef\boardcolumn{\number#2}%
+ \ifcase\currentstatus
+ \setcurrentstatus{\plusone}%
+ \or
+ \setcurrentstatus{\plustwo}%
+ \makeoverlaplist\currentstonenumber
+ \setvalue{overlaplist:\currentstonenumber}{\csname overlap:#1:#2\endcsname}%
+ \setcurrentoverlap{\dummystonebox}%
+ \else
+ \setcurrentstatus{\plusthree}%
+ \fi
+ \setevalue{field:\number#1:\number#2}%
+ {\ifx#3B
+ \plusone
+ \else\ifx#3W
+ \plustwo
+ \fi\fi:\number\stonecount}%
+ \ifcase\currentstatus\or\else
+ \setcurrentoverlap
+ {\hbox
+ {\currentoverlap
+ \vbox\!!to\boardunit{\vss\hbox\!!to\boardunit{\hss$\mathstrut{}={}$\hss}\vss}%
+ \dummystonebox}}%
+ \fi}
+
+%D \macros{processoverlappedstones}
+%D
+%D This is the alternative to \tex{processdeadstones} for the printable
+%D version. The stones are sorted from the lowest number to the highest.
+
+\def\processoverlappedstones
+ {\scratchdimen\hsize
+ \def\doprocessoverlappedstones##1%
+ {\setbox\globalscratchbox\hbox{\getvalue{overlaplist:##1}}%
+ \ifdim\wd\globalscratchbox>\scratchdimen
+ \scratchdimen\dimexpr\hsize-\wd\globalscratchbox\relax
+ \hbox\!!to\hsize{\box\scratchbox\hfill}%
+ \box\scratchbox\box\globalscratchbox
+ \else
+ \scratchdimen\dimexpr\scratchdimen-\wd\globalscratchbox-\@@@@bddistance\relax
+ \setbox\scratchbox\hbox{\box\scratchbox\box\globalscratchbox\hskip\@@@@bddistance}%
+ \fi}%
+ \sortcommacommand[\overlaplist]\donumericcompare
+ \processcommacommand[\sortedcommalist]\doprocessoverlappedstones
+ \hbox\!!to\hsize{\box\scratchbox\hss}}
+
+\bgroup
+\catcode`\;=13
+\gdef\dostartSGFbox
+ {\setupboard[\c!alternative=\v!c]%
+ \switchtobodyfont[\the\dimexpr.45\boardunit\relax]%
+ \doglobal\increment\thegame
+ \clearboard\clearoverlapstatus
+ \doglobal\let\thestep\zerocountervalue
+ \global\stonecount\!!zerocount
+ \def;##1[##2##3]%
+ {\adddummystone(\charactertonumber##2:\charactertonumber##3:##1)}%
+ \catcode`\^^M=\@@ignore}
+\egroup
+
+\def\stopSGFbox
+ {\framed
+ [\c!offset=\v!overlay,\c!strut=\v!no,
+ \c!top=\!!zeropoint,\c!bottom=\!!zeropoint,\c!depth=\!!zeropoint,
+ \c!frame=\v!on]
+ {\vbox
+ {\offinterlineskip
+ \framed
+ [\c!offset=\boardunit,\c!frameoffset=\!!zeropoint,\c!strut=\v!no,
+ \c!top=\!!zeropoint,\c!bottom=\!!zeropoint,\c!depth=\!!zeropoint,
+ \c!width=\dimexpr\boardsize\boardunit+2\boardunit\relax,
+ \c!frame=\v!on,\c!background={color,board},
+ \c!backgroundcolor=boardbackground]%
+ {\dontcomplain
+ \offinterlineskip
+ \highlightlabelfalse
+ \drawboard}
+ \framed
+ [\c!frame=\v!on,
+ \c!width=\dimexpr\boardsize\boardunit+\plustwo\boardunit\relax,
+ \c!height=\numexpr\@@@@bdn*\plustwo\relax\boardunit,
+ \c!offset=.2\boardunit]%
+ {\vbox\!!to\vsize{\processoverlappedstones}}}}}
+
+\bgroup
+\catcode`\;=13
+\gdef\dostartSGFpage
+ {\startTEXpage
+ [\c!width=\dimexpr\boardsize\boardunit
+ \if\@@@@bdalternative\v!a
+ +\plustwo\boardunit
+ \else\if\@@@@bdalternative\v!b
+ +\numexpr\@@@@bdn*\plusfour+\plustwo\relax\boardunit
+ \else
+ +\plustwo\boardunit
+ \fi\fi\relax,
+ \c!height=\dimexpr\boardsize\boardunit
+ \if\@@@@bdalternative\v!a
+ +\numexpr\@@@@bdn*\plustwo+\plustwo\relax\boardunit
+ \else\if\@@@@bdalternative\v!b
+ +\plustwo\boardunit
+ \else
+ +\plustwo\boardunit
+ \fi\fi\relax,
+ \c!background={color,board},
+ \c!backgroundcolor=boardbackground]%
+ \switchtobodyfont[\the\dimexpr.45\boardunit\relax]%
+ \doglobal\increment\thegame
+ \clearboard
+ \getparameters[\??fd][\c!start=1,\c!width=\v!fit,\c!height=\c!fit,\c!offset=\v!overlay,\c!frame=\v!off]%
+ \doglobal\let\thestep\zerocountervalue
+ \global\stonecount\!!zerocount
+ \setupfield
+ [\v!game:\thegame]
+ [\v!reset]%
+ \setupfield
+ [\v!game:\thegame]
+ [\c!option=\v!readonly,
+ \c!frameoffset=\!!zeropoint,
+ \c!strut=\v!no,
+ \c!top=\!!zeropoint,
+ \c!bottom=\!!zeropoint,
+ \c!depth=\!!zeropoint,
+ \c!width=\v!fit,
+ \c!height=\v!fit,
+ \c!offset=\v!overlay,
+ \c!frame=\v!off]%
+ \definefield
+ [\v!game:\thegame:\thestep][\s!check][\v!game:\thegame]
+ [\v!empty,\v!empty][\v!empty]%
+ \cleardeadstonelist
+ \executeifdefined{drawboard\@@@@bdalternative}\drawboarda
+ \flushboard
+ \def;##1[##2##3]%
+ {\addstone(\charactertonumber##2:\charactertonumber##3:##1)%
+ \doif\@@@@bdcalculate\v!yes\processtones
+ \executeifdefined{drawboard\@@@@bdalternative}\drawboarda
+ \flushboard}%
+ \catcode`\^^M=\@@ignore}
+\egroup
+
+%D \macros{starSGF,stopSGF}
+%D
+%D The two macros \tex{startSGF} and \tex{stopSGF} begin and end
+%D the parser for the go stones saved with the \type{sgf} syntax.
+
+\def\stopSGFpage
+ {\startoverlay{\overlaybutton{JS(Walk_Field{\v!game:\thegame})}}\stopoverlay
+ \stopTEXpage}
+
+\def\startSGF
+ {\bgroup
+ \catcode`\;=13
+ \dosingleempty\dostartSGF}
+
+\def\dostartSGF[#1]%
+ {\iffirstargument
+ \setupboard[#1]%
+ \fi
+ \doif\@@@@bdcalculate\v!no
+ {\setupboard[\c!alternative=\v!c]}%
+ \doifelse\@@@@bdprintable\v!no
+ \dostartSGFpage
+ \dostartSGFbox}
+
+\def\stopSGF
+ {\doifelse\@@@@bdprintable\v!no
+ \stopSGFpage
+ \stopSGFbox
+ \egroup}
+
+\protect \endinput
diff --git a/obsolete/macros/context/contrib/context-sgf/tex/context/third/sgf/t-weiqi.tex b/obsolete/macros/context/contrib/context-sgf/tex/context/third/sgf/t-weiqi.tex new file mode 100644 index 0000000000..5c9ac0d79b --- /dev/null +++ b/obsolete/macros/context/contrib/context-sgf/tex/context/third/sgf/t-weiqi.tex @@ -0,0 +1,16 @@ +%D \module
+%D [ file=t-weiqi,
+%D version=2007.09.09,
+%D title=\CONTEXT\ User Module,
+%D subtitle=Go Module,
+%D author={Zhichu Chen \& Wolfgang Schuster},
+%D date=\currentdate,
+%D copyright=Public Domain]
+
+\writestatus{loading}{Context User Module / Go Module}
+
+\unprotect
+
+\usemodule[sgf]
+
+\protect \endinput
diff --git a/obsolete/macros/context/contrib/context-taspresent/doc/context/third/taspresent/demo.tex b/obsolete/macros/context/contrib/context-taspresent/doc/context/third/taspresent/demo.tex new file mode 100644 index 0000000000..5f6988d7f5 --- /dev/null +++ b/obsolete/macros/context/contrib/context-taspresent/doc/context/third/taspresent/demo.tex @@ -0,0 +1,153 @@ +\usemodule[taspresent][style=rules,font=MyriadPro,size=17pt,stylecolor=red] + +\setvariables [taspresent] + [author={Groucho Marx}, + title={Marriage the Chief Cause of Divorce}] + +% \usetypescriptfile[type-gtamacfonts] +% \definetypeface[MyFace][ss][sans][optima][default][encoding=ec] +% %\usetypescript[LucidaSans][ec] +% \setupbodyfont[MyFace,ss,\Normalsize] + +% \usesymbols[lucidasans] +% \setupsymbolset[LucidaSans] +% \definesymbol[1][{\symbol[Check2]}] + +% \showframe + +% \traceexternalfigurestrue + +\starttext + +\Maketitle + +\Slidetitle{Text} + +\lecback + +Thus, I came to the conclusion that the designer of a new +system must not only be the implementer and first +large||scale user; the designer should also write the first +user manual. + +The separation of any of these four components would have +hurt \TeX\ significantly. If I had not participated fully in +all these activities, literally hundreds of improvements +would never have been made, because I would never have +thought of them or perceived why they were important. + +But a system cannot be successful if it is too strongly +influenced by a single person. Once the initial design is +complete and fairly robust, the real test begins as people +with many different viewpoints undertake their own +experiments. + +\Slidetitle{Itemization} + +\startitemize[1] +\item Thus, I came to the conclusion that the designer of a new + system +\item must not only be the implementer and first + large||scale user; +\item the designer should also write the first + user manual. +\item The separation of any of these four components would have + hurt \TeX\ significantly. +\stopitemize + +\Slidetitle{Numbered Itemization} + +\startitemize[n] +\item Thus, I came to the conclusion that the designer of a new + system +\item must not only be the implementer and first + large||scale user; +\item the designer should also write the first + user manual. +\item The separation of any of these four components would have + hurt \TeX\ significantly. +\stopitemize + +\Slidetitle{Picture in Horizontal Mode} + +\PicHoriz[hor][height=\NormalHeight] + +\page + +\picback + +\PicVert[vert][width=\NormalWidth]{Picture in \\ Vertical Mode} + +\page + +\CircVert[scale=22,x=23,y=25][vert][width=\NormalWidth]{Circle in \\ Vertical Mode} + +\page + +\ArrowVert[direction=90,x=7,y=23][vert][width=\NormalWidth]{Arrow in \\ Vertical Mode} + +\Slidetitle{Red Circle} + +\lecback + +\CircHoriz[scale=40,x=120,y=80][hor][height=\NormalHeight] + +\Slidetitle{Red Arrow} + +\ArrowHoriz[direction=135,x=105,y=15][hor][height=\NormalHeight] + +\Slidetitle{A MetaFun graphic} + +\placefigure[here]{none}{% +\startMPcode +pickup pencircle scaled 4pt ; +draw unitsquare xyscaled (5cm,5cm) withcolor red ; +\stopMPcode +} + +\Slidetitle{Some Code Snippets} + +To set up a horizontal picture, simply type: + +\startTEX +\PicHoriz[hor][height=\Normalheight] +\stopTEX + +\blank[line] + +For vertical pictures: + +\startTEX +\PicVert[vert][width=\NormalWidth]% +{Text placed \\ opposite picture} +\stopTEX + +\Slidetitle{Math} + +Since I know nothing about math, this example is copied from the wiki: + +\startformula + f(x) = \startmathcases + \NC x, \NC if $0 \le x \le \frac12$ \NR + \NC 1-x ,\NC if $\frac12 \le x \le 1$ \NR +\stopmathcases +\stopformula + +\Slidetitle{Your Own Ideas?} + +\null + +\vfill + +\midaligned{\tfd Go \color[red]{here!}} + +\vfill + +\page + +\stoptext + +%%% Local Variables: +%%% mode: context +%%% TeX-master: t +%%% End: diff --git a/obsolete/macros/context/contrib/context-taspresent/doc/context/third/taspresent/hor.jpg b/obsolete/macros/context/contrib/context-taspresent/doc/context/third/taspresent/hor.jpg Binary files differnew file mode 100644 index 0000000000..892615f812 --- /dev/null +++ b/obsolete/macros/context/contrib/context-taspresent/doc/context/third/taspresent/hor.jpg diff --git a/obsolete/macros/context/contrib/context-taspresent/doc/context/third/taspresent/readme b/obsolete/macros/context/contrib/context-taspresent/doc/context/third/taspresent/readme new file mode 100644 index 0000000000..cbbc956c4b --- /dev/null +++ b/obsolete/macros/context/contrib/context-taspresent/doc/context/third/taspresent/readme @@ -0,0 +1,136 @@ +Module for projector-based presentations +----------------------------------------- + +This directory provides a module to produce presentations with ConTeXt. It +contains the following files: + +doc/taspresent/readme (this file) +doc/taspresent/demo.tex +doc/taspresent/hor.jpg +doc/taspresent/taspresent-manual.pdf +doc/taspresent/vert.jpg +texmf/tex/context/third/taspresent/rainbow.pdf +texmf/tex/context/third/taspresent/t-blackblue.tex +texmf/tex/context/third/taspresent/t-bluegray.tex +texmf/tex/context/third/taspresent/t-bluestripe.tex +texmf/tex/context/third/taspresent/t-darkshade.tex +texmf/tex/context/third/taspresent/t-doubleframe.tex +texmf/tex/context/third/taspresent/t-doubleshade.tex +texmf/tex/context/third/taspresent/t-embossed.tex +texmf/tex/context/third/taspresent/t-graybeams.tex +texmf/tex/context/third/taspresent/t-graysquare.tex +texmf/tex/context/third/taspresent/t-greenblue.tex +texmf/tex/context/third/taspresent/t-horizontalblue.tex +texmf/tex/context/third/taspresent/t-lightblue.tex +texmf/tex/context/third/taspresent/t-narrowstripe.tex +texmf/tex/context/third/taspresent/t-quadblue.tex +texmf/tex/context/third/taspresent/t-rainbowstripe.tex +texmf/tex/context/third/taspresent/t-redframe.tex +texmf/tex/context/third/taspresent/t-taspresent.tex + +The two images hor.jpg and vert.jpg are copyright 2007 Patrick Gundlach and are +published under the GNU General Public License v. 2.0. All other files are +copyright 2007 by Thomas A. Schmitz; they are published under the GNU General +Public License v. 2.0. + + +Installation +------------ + +Simply move the module files t-* into a place where TeX can find them. The +canonical location would be $TEXMF/tex/context/third, where you can create a +subdiretory "presentations" to keep everything together. On most systems, you +will have to run texhash after installing new packages. If you want to test the +module before actually installing it, just leave everything in the original +directory and typeset the demo file. + + +Use +--- + +A full manual is included, Here is a very short version for the impatient: + +To use the module, include this line in your file: + +\usemodule[taspresent] +[style=doubleframe,font=Helvetica,size=17pt,stylecolor=blue,stylebottom=sqaure] + +For the "style" parameter, there are currently sixteen options: + +blackblue +bluegray +bluestripe +darkshade +doubleframe +doubleshade +embossed +graybeams +graysquare +greenblue +horizontalblue +lightblue +narrowstripe +quadblue +rainbowstripe +redframe + +This will modify the background of your slides and the placement of certain +elements. + +For the "font" parameter, there are currently five options: + +LatinModern [typesets in LatinModern Serif] +LatinModernSans [typesets in LatinModern Sans] +Times [the free clone of TimesNew Roman] +Helvetica [the free clone of Helvetica] +Pagella [the tex-gyre clone of Palatino; only if you have the tex-gyre + fonts installed] +User [this does not set a font; provide your own definitions] + +If you want to use your own typescripts, remember to use the bodyfont at +\Normalsize like so: + +\usetypescriptfile[type-mytypescript] +\usetypescript[myfont][ec] +\setupbodyfont[MyFont,\Normalsize] + +And of course, invoke the typescript after the \usemodule part! + +The "size" can be set to 16pt, 17pt, 18pt, 19pt, 20pt, or 21pt ; the default is +17pt for text and 27pt for titles. + +The easiest way to see what the module does and which macros it provides is +looking at (and typesetting) the included file "demo.tex" with different +options. If you want to know more about the way in which the module is set up, +typeset the source of the different source files with the command texmfstart +texexec --module. The source is annotated, so you should be able to see how it +works even if you don't have too much experience with ConTeXt. + +Defining your own styles is easy: have a look at the style files which are +included. Certain macros have to be defined. Roll your own definitions for +these macros and for the background, write them into a file whatever.tex and +use this new style by setting it as the value to the "style" key like so: +\usemodule[taspresent][font=Times,size=17pt,style=whatever] + + +Revision History +---------------- + +2008-08-11 + +- Added still more styles; +- cleaned up syntax for placing pictures and circles/arrows. + +2007-08-08 +- Added some new styles; +- added the \setvariables and \Maketitle macros; +- added the "stylecolor" and "stylebottom" options; +- arrows and circles for vertical pictures. + +2007-07-24 +- Added new commands for arrows and circles in vertical pictures; +- made syntax for picture placement more conform to ConTeXt use; +- easier syntax for adding custom styles (suggestion by Peter Münster). + +2007-07-22 +Initial release diff --git a/obsolete/macros/context/contrib/context-taspresent/doc/context/third/taspresent/taspresent-manual.pdf b/obsolete/macros/context/contrib/context-taspresent/doc/context/third/taspresent/taspresent-manual.pdf Binary files differnew file mode 100644 index 0000000000..f2748c3019 --- /dev/null +++ b/obsolete/macros/context/contrib/context-taspresent/doc/context/third/taspresent/taspresent-manual.pdf diff --git a/obsolete/macros/context/contrib/context-taspresent/doc/context/third/taspresent/taspresent-manual.tex b/obsolete/macros/context/contrib/context-taspresent/doc/context/third/taspresent/taspresent-manual.tex new file mode 100644 index 0000000000..609dece5dc --- /dev/null +++ b/obsolete/macros/context/contrib/context-taspresent/doc/context/third/taspresent/taspresent-manual.tex @@ -0,0 +1,496 @@ +%&latex + +\setupcolors[state=start] + +\setupbodyfontenvironment[default][em=italic] + +\definetype[typeTEX][option=color] +\setuptype[option=TEX] + +%\setuphead[subsection][page=yes] + +\define[1]\MyStyle{\color[blue]{\bf #1}} + +\starttext + +\section{Introduction} + +The modules in the {\tt taspresent} directory aim to provide an +easy|-|to|-|use, consistent interface for writing simple presentations in +\CONTEXT. I had the idea to write this module when I was preparing my own +presentations with \CONTEXT. I wanted to be able to achieve visually +different results without changing my source files, so I wrote different +styles that followed the same logic and provided the same macros. When I +created this module, I had the following requirements in mind: + +\startitemize +\item Most of the styles that are provided are rather sober in + appearance. I use them for my university lectures in the humanities. They + provide a nice but not too distracting background and a lot of space for + presentations with large amounts of text. +\item The module is meant for presentations which will be shown with the + help of a digital projector. Hence, they have no interactive elements + (such as buttons) and no tools for navigation (such as a table of + contents). +\item The module allows for user configurability. It comes with several + predefined styles and some predefined font options. The modular structure + makes it easy to add further styles. +\item Picture placement and changing backgrounds is made easy by predefined + macros. +\stopitemize + +The module provides a simple, basic structure; I think it will be best suited +for beginners or intermediate users of \CONTEXT. It is definitely not meant +to compete with Hans's fuller and fancier presentation modules, and it +offers much less than the \LaTeX\ {\tt beamer} package. On the other hand, +it is much easier to use; you should be able to write your first +presentation after spending five minutes with this manual. + +\section{Installation} + +Installation is easy: just put the files {\tt t-<something>} into a +directory where \TeX\ can see them. For \CONTEXT\ third|-|party modules, +the canonical place would be in one of your {\tt TEXMF} trees, under {\tt + tex/context/third}. If you want to keep things tidy, place them in a +subdirectory {\tt taspresent}. If you just unzip the archive {\tt + taspresent.zip} in a {\tt TEXMF} directory, things will be moved to the +right place automatically. On many \TeX|-|systems, you will have to run +{\tt texhash} after installing new files. To doublecheck whether the system +finds your files, run {\tt kpsewhich t-taspresent.tex} from the command +line; if all goes well, this should return the position of the file you +have just installed. + +\section{Setting up the Module} + +To use the module, you put this line into your source file: + +\startTEX +\usemodule[taspresent][style=,font=,size=,stylecolor=,stylebottom=] +\stopTEX + +The values for the different keys will be explained in the following +sections. + +\section{The {\tt style} Key} + +There are ten options for the {\tt style} key: + +\subsection{\MyStyle{blackblue}} + +This style was inspired by the \quotation{Copenhagen} theme of the \LaTeX\ +{\tt beamer} package. The narrow blue and black stripes at the top and the +bottom of the slides display the date and slidenumber (top) and the title +and author of the presentation. + +\placefigure[here]{The \MyStyle{blackblue} + style}{\externalfigure[blackblue][width=\textwidth]} + +\page + +\subsection{\MyStyle{bluegray}} + +The colors of this style are very subdued and quiet; the interesting thing +is the pagenumber on the border of the margin and text area; this detail +was inspired by Hans's \quotation{split} style ({\tt pre-14}). + +\placefigure[here]{The \MyStyle{bluegray} + style}{\externalfigure[bluegray][width=\textwidth]} + +\page + +\subsection{\MyStyle{bluestripe}} + +This theme is inspired by the \quotation{Berkeley} style of the \LaTeX\ +{\tt beamer} package. Apart from the blue sidebars, it has no ornaments. + +\placefigure[here]{The \MyStyle{bluestripe} + style}{\externalfigure[bluestripe][width=\textwidth]} + +\page + +\subsection{\MyStyle{darkshade}} + +The only ornament to this style is the dark shaded background; it has two +style colors, {\tt stylecolor=blue} and {\tt stylecolor=green}; if you feel +really adventurous, try {\tt stylecolor=bluered}! It uses \CONTEXT's {\tt + interactionbar} mechanism to show the progress of the presentation. It +provides much space for text. + +\placefigure[here]{The \MyStyle{darkshade} + style with {\tt stylecolor=blue}}{\externalfigure[blueshade][width=\textwidth]} + +\page + +\subsection{\MyStyle{doubleframe}} + +This style was inspired by Hans's \quotation{green} style ({\tt s-pre-02}). It +has a thick blue frame around the entire slide area and a thinner frame around +the text area. The style has two options for the bottom area: {\tt +stylebottom=stripe} will display a shaded blue area which will grow with each +slide; {\tt stylebottom=square} displays a row of blue squares at the bottom +which also measure the presentation's progress. + +\placefigure[here]{The \MyStyle{doubleframe} +style with the {\tt stylebottom=stripe} option}{\externalfigure[blueframe][width=\textwidth]} + +\page + +\placefigure[here]{The \MyStyle{doubleframe} +style with the {\tt stylebottom=square} option}{\externalfigure[squareframe][width=\textwidth]} + +\page + +\subsection{\MyStyle{doubleshade}} + +Similar to the \MyStyle{blueshade} style, but there is a differently shaded +area on the left with a progress meter. + +\placefigure[here]{The \MyStyle{doubleshade} + style}{\externalfigure[doubleshade][width=\textwidth]} + +\page + +\subsection{\MyStyle{embossed}} + +Spread the word, don't be shy! Show your pride in using \CONTEXT. The color +theme will probably look familiar; I copied it from the {\tt enattab} +manual. + +\placefigure[here]{The \MyStyle{embossed} + style}{\externalfigure[embossed][width=\textwidth]} + +\page + +\subsection{\MyStyle{graybeams}} + +This design is inspired by the {\tt husky} theme for the \LaTeX\ package {\tt +powerdot}, created by Jack Stalnaker. + +\placefigure[here]{The \MyStyle{graybeams} + style}{\externalfigure[graybeams][width=\textwidth]} + +\page + +\subsection{\MyStyle{graysquare}} + +This minimalistic design is inspired by a presentation Taco gave at EuroTeX +2006. + +\placefigure[here]{The \MyStyle{graysquare} + style}{\externalfigure[graysquare][width=\textwidth]} + +\page + +\subsection{\MyStyle{greenblue}} + +This style has cool colors and lots of white space; it is probably best suited +for presentations with relatively little text. + +\placefigure[here]{The \MyStyle{greenblue} + style}{\externalfigure[greenblue][width=\textwidth]} + +\page + +\subsection{\MyStyle{horizontalblue}} + +A sober style with an emphasis on horizontal lines, inspired by {\tt + beamer}'s \quotation{Szeged} theme. + +\placefigure[here]{The \MyStyle{horizontalblue} + style}{\externalfigure[horizontalblue][width=\textwidth]} + +\page + +\subsection{\MyStyle{lightblue}} + +This style emphasizes the title with its lively colors; the text area is +delimited by a light blue, shaded margin. + +\placefigure[here]{The \MyStyle{lightblue} + style}{\externalfigure[lightblue][width=\textwidth]} + +\page + +\subsection{\MyStyle{narrowstripe}} + +A variation on the \MyStyle{bluestripe} style, with shaded narrow +stripes. This style comes with two color options, which you set with the +{\tt stylecolor} key; {\tt stylecolor=red}, {\tt stylecolor=green}, or {\tt + stylecolor=blue}. + +\placefigure[here]{The \MyStyle{narrowblue} +style with {\tt stylecolor=blue}}{\externalfigure[narrowblue][width=\textwidth]} + +% \page +% +% \subsection{\MyStyle{narrowred}} +% +% Like the \MyStyle{narrowblue} style, but with a red theme color. +% +% \placefigure[here]{The \MyStyle{narrowred} +% style}{\externalfigure[narrowred][width=\textwidth]} + +\page + +\subsection{\MyStyle{quadblue}} + +This style is inspired by the colors and corporate look of my +university. It is very sober and offers much space for text and +images. There is a rough progress meter built into the blue quadrangles. + +\placefigure[here]{The \MyStyle{quadblue} + style}{\externalfigure[quadblue][width=\textwidth]} + +\page + + +\subsection{\MyStyle{rainbowstripe}} + +A colorful style for daring presenters. The black line which marks the +progress is reminiscent of absorption lines in star spectra, so this style +may be apt for astrophysical presentations? + +\placefigure[here]{The \MyStyle{rainbowstripe} + style}{\externalfigure[rainbowstripes][width=\textwidth]} + +\page + +\subsection{\MyStyle{redframe}} + +This style is inspired by the screen version of the Metafun manual. Watch +the small gray circles at the bottom! + +\placefigure[here]{The \MyStyle{redframe} + style}{\externalfigure[redframe][width=\textwidth]} + +\subsection{Customization} + +The style parameter allows easy customization. If you want to develop your +own theme, I would suggest copying one of the style files to another name, +say {\tt MyStyle.tex}, and modifying it to your heart's content: you can +change the colors or define a different background altogether, think of a +different way of displaying titles, different margins, etc. Just be sure to +define all the macros that are needed. After producing your own style, +again, copy it to a place where \TeX\ can find it (such as the same +directory where the source of your presentation resides) and instruct the +module to use your file: + +\startTEX +\usemodule[taspresent][style=MyStyle,font=Times,size=17pt] +\stopTEX + +\section{The {\tt font} Key} + +There is a number of predefined fonts which can be selected by setting the +{\tt font} key. + +\starttabulate[|l|p|] +\NC {\tt LatinModern} \NC typesets in LatinModern Serif\NC \NR +\NC {\tt LatinModernSans} \NC typesets in LatinModern Sans\NC \NR +\NC {\tt Times} \NC the free clone of TimesNew Roman\NC \NR +\NC {\tt Helvetica} \NC the free clone of Helvetica\NC \NR +\NC {\tt Pagella} \NC the tex-gyre clone of Palatino; this will +only work if you have the tex-gyre fonts installed\NC \NR +\stoptabulate + +In addition, there is a value {\tt User}; this will not set a font but +allow you to provide your own settings. If you set your own font, please +remember to select the bodyfont at \typeTEX{\Normalsize} and to give your setup +commands {\em after} loading the module (or \TeX\ will not know what +\typeTEX{\Normalsize} means and complain about an \quotation{undefined control + sequence}). For example, for the samples included here, I have used my own +typescript which defines the Adobe MyriadPro font: + +\startTEX +\usetypescriptfile[type-myriadpro] +\usetypescript[MyriadPro] [texnansi] +\setupbodyfont[MyMyriadPro,ss,\Normalsize] +\stopTEX + +\section{The {\tt size} Key} + +This selects the font size for the main text and defines a corresponding +size for titles. + +\placefigure[here]{Text and title sizes} +{\setupTABLE[column][width=3cm,align=middle] +\bTABLE +\bTR \bTD Value \eTD \bTD Normalsize \eTD \bTD Titlesize \eTD \eTR +\bTR \bTD 16pt \eTD \bTD 16pt \eTD \bTD 25pt \eTD \eTR +\bTR \bTD 17pt \eTD \bTD 17pt \eTD \bTD 27pt \eTD \eTR +\bTR \bTD 18pt \eTD \bTD 18pt \eTD \bTD 28pt \eTD \eTR +\bTR \bTD 19pt \eTD \bTD 19pt \eTD \bTD 30pt \eTD \eTR +\bTR \bTD 20pt \eTD \bTD 20pt \eTD \bTD 30pt \eTD \eTR +\bTR \bTD 21pt \eTD \bTD 21pt \eTD \bTD 30pt \eTD \eTR +\eTABLE} + +\section{Macros} + +The module provides some macros to facilitate the preparation of +presentations. + +\subsection{\typeTEX{\setvariables}} + +Begin your presentation by setting the name of the author(s) and the title +with this macro: + +\startTEX + +\setvariables [taspresent] + [author={Groucho Marx}, + title={Marriage the Chief Cause of Divorce}] +\stopTEX + +\subsection{\typeTEX{\Maketitle}} + +This macro will produce a title page with the author and the title of the +presentation; the look is of course determined by the style of your +presentation. + +\placefigure[here]{A Title Page}{\externalfigure[titlepage][width=\textwidth]} + +\subsection{\typeTEX{\Slidetitle{}}} + +As the name suggests, this macro typesets its argument as the title of the +slide. What the title looks like is determined by the selected presentation +style. + +\subsection{\typeTEX{\PicHoriz}} + +This macro facilitates the placement of landscape images. It takes two +arguments: + +\startTEX +\PicHoriz[image][height=\NormalHeight] +\stopTEX + +The first argument is the name of the image you want to place; the second +argument determines the size. If your picture is not too broad, a height of +\typeTEX{\NormalHeight} will make it fill up the entire text area. If your +picture is too broad, you should set \typeTEX{width=\textwidth}. + +\placefigure[here]{Placement of a horizontal picture}{\externalfigure[horizontal][width=\textwidth]} + +\page + +\subsection{\typeTEX{\PicVert}} + +This macro facilitates the placement of portrait images. It takes three +arguments: + +\startTEX +\PicVert[image][width=\NormalWidth]{Text \\ to go \\ with the picture} +\stopTEX + +Again, the first argument is the name of the image you want to place; the +second argument determines the size. If your picture is not too high, a +width of \typeTEX{\NormalWidth} will make it fill up the entire left half +of the text area. If your picture is too hight, you should set +\typeTEX{height=\textheight}. The third argument is the text that will be +placed opposite the picture. + +\placefigure[here]{Placement of a vertical picture}{\externalfigure[vertical][width=\textwidth]} + +\page + +\subsection{\typeTEX{\CircHoriz}} + +This command works exactly like \typeTEX{\PicHoriz}, but takes an +additional (third) argument. It places a red circle on top of the picture; +the placement and size of this circle is determined by this third argument: + +\startTEX +\CircHoriz[scale=40,x=120,y=80][image][height=\NormalHeight] +\stopTEX + +The {\tt scale} key sets the diameter of the circle (in mm), {\tt x} +and {\tt y} set horizontal and vertical position. You will probably +have to fiddle with these keys to get the circle exactly where you want +it. + + +\placefigure[here]{A picture with a red circle}{\externalfigure[circle][width=\textwidth]} + +\page + +\subsection{\typeTEX{\ArrowHoriz}} + +This command works exactly like \typeTEX{\PicHoriz}, but takes an +additional (third) argument. It places a red arrow on top of the picture; +the direction and size of this arrow is determined by this third argument: + +\startTEX +\CircHoriz[direction=135,x=120,y=80][image][height=\NormalHeight] +\stopTEX + +The {\tt direction} key sets the direction into which the arrowhead points, +{\tt x} and {\tt y} set its horizontal and vertical position. You will +probably have to fiddle with these keys to get the circle exactly where you +want it. + +\placefigure[here]{A picture with a red arrow}{\externalfigure[arrow][width=\textwidth]} + +\page + +\subsection{\typeTEX{\CircVert} and \typeTEX{ArrowVert}} + +Of course, there are also circles and arrows for \quotation{vertical} +pictures; again, the first argument is the position of the circle/arrow: + +\startTEX +\CircVert[scale=22,x=23,y=25]% +[vert]% +[width=\NormalWidth]% +{Circle in \\ Vertical Mode} + +\ArrowVert[direction=90,x=7,y=23]% +[vert]% +[width=\NormalWidth]% +{Arrow in \\ Vertical Mode} +\stopTEX + +\placefigure[here]{Vertical picture with red circle}{\externalfigure[circvert][width=\textwidth]} + +\placefigure[here]{Vertical picture with red arrow}{\externalfigure[arrvert][width=\textwidth]} + +\subsection{Background} + +Some of the styles provide up to three backgrounds: for titles, for slides +with vertical image, and for normal slides with text or horizontal +images. Switching the backgrounds also adjusts parameters like margins or +headers, where this is necessary. There are three commands for setting the +background for title slides, \quotation{horizontal} slides and +\quotation{vertical} slides respectively: + +\startTEX +\titback +\lecback +\picback +\stopTEX + +\section{Handouts} + +The easiest way to make handouts from your slides is post|-|processing the +pdf|-|file of your presentation. If you want to make the handouts from the +slides such as they appear, just run this command in the directory where +your slides are located (of course, put the name of your own presentation +where you see {\tt demo.pdf} in the example; the entire command has to go +in one long line): + +{\tt texmfstart texexec --pdfcombine --combination='2*3' --nobanner + + --result=handout demo.pdf} + +This way, you will get a handout with six slides typeset in two columns per +page. + +If you prefer to have the handouts without the colored background, typeset +your presentation and leave the {\em style} key unset; that way, you will +get a default version without backgrounds and fancy frames. + +\stoptext + +%%% Local Variables: +%%% mode: context +%%% TeX-master: t +%%% End: diff --git a/obsolete/macros/context/contrib/context-taspresent/doc/context/third/taspresent/vert.jpg b/obsolete/macros/context/contrib/context-taspresent/doc/context/third/taspresent/vert.jpg Binary files differnew file mode 100644 index 0000000000..ff9d234db1 --- /dev/null +++ b/obsolete/macros/context/contrib/context-taspresent/doc/context/third/taspresent/vert.jpg diff --git a/obsolete/macros/context/contrib/context-taspresent/tex/context/third/taspresent/t-blackblue.tex b/obsolete/macros/context/contrib/context-taspresent/tex/context/third/taspresent/t-blackblue.tex new file mode 100644 index 0000000000..6e79488a9b --- /dev/null +++ b/obsolete/macros/context/contrib/context-taspresent/tex/context/third/taspresent/t-blackblue.tex @@ -0,0 +1,145 @@ +%D \module +%D [ file=t-blackblue, +%D version=2007.07.17, +%D title=\CONTEXT\ Style File, +%D subtitle=Presentation Module blackblue, +%D author=Thomas A. Schmitz, +%D date=\currentdate, +%D copyright={Thomas A. Schmitz}] +%C +%C Copyright 2007 Thomas A. Schmitz. +%C This file may be distributed under the GNU General Public License v. 2.0. + +%D This file provides the \quotation{blackblue} style for the presentation +%D module. It is loaded at runtime. The look of this style was inspired by the +%D \quotation{Copenhagen} theme of the \LaTeX\ {\tt beamer} package. + +\writestatus{loading}{module blackblue} + +\startmodule[blackblue] + +\unprotect + +%D The taspresentation module provides a skeleton into which different styles +%D can be hooked. It uses a number of variables and macros which have to be set +%D beforehand. Some parts are optional. We begin with the necessary definitions: + +%D We start colors: + +\setupcolors[state=start] + +%D These macros are used for placing figures/pictures: + +\define\NormalHeight{\textheight} +\define\NormalWidth{.476\textwidth} +\define\PictureFrameHeight{\textheight} +\define\PictureFrameWidth{.476\textwidth} + +%D The page layout: + +\setuplayout [width=fit, + margin=0cm, + height=fit, + header=3.2cm, + footer=.5cm, + topspace=.6cm, + backspace=1cm, + location=singlesided] + +%D The macro for typesetting the Slidetitle; this is adapted from a sample +%D document that Brooks Moses published on the wiki: + +\definelayer[slidetitle] + [width=\paperwidth, + height=\paperheight, + x=10mm, + y=12mm] + +\define[1]\Slidetitle{\page\setlayer[slidetitle]% + {\framed[corner=round,background=color,backgroundcolor=a,frame=off,width=\textwidth,height=2.1cm,offset=0pt,top=\vss,bottom=\vss]{\switchtobodyfont[\Titlesize]\color[b]{#1}}}} + +%D The macro \tex{Maketitle} produces a default title page with the author, the +%D title of the presentation, and the date. Using it is not mandatory. + +\define\Maketitle{% +\titback +\null +\vfill +\framed[corner=round,background=color,backgroundcolor=a,frame=off,width=\textwidth,height=.75\textheight,top=\vss,bottom=\vss,align=middle]{\switchtobodyfont[\Titlesize]\color[b]{\getvariable{taspresent}{title}}\switchtobodyfont[\Normalsize]\blank[line]\color[b]{\getvariable{taspresent}{author}\blank[2*line]\currentdate}} +\vfill +\null} + +%D The following parts are optional; if you don't use backgrounds and are +%D content with CONTEXT's default itemization, you don't have to set these +%D macros. + +%D We define our colors: + +\definecolor [b] [s=.9] +\definecolor [c] [s=0] +\definecolor [a] [r=.2, g=.2, b=.72] +\definecolor [Item] [r=.2, g=.2, b=.75] + +%D We let Metapost calculate the background: + +\startuseMPgraphic{slide} +StartPage ; +path p[] ; +numeric a; a=.5cm ; +fill Page withcolor \MPcolor{b} ; +path Main ; +z1 = ulcorner Page shifted (0,-a) ; +z2 = urcorner Page shifted (0,-a) ; +z3 = llcorner Page shifted (0,a) ; +z4 = lrcorner Page shifted (0,a) ; +z5 = 1/2[ulcorner Page,urcorner Page] ; +z6 = 1/2[z1,z2] ; +z7 = 1/2[llcorner Page,lrcorner Page] ; +z8 = 1/2[z3,z4] ; +p[1] = ulcorner Page -- urcorner Page -- z2 -- z1 -- cycle ; +p[2] = ulcorner Page -- z5 -- z6 -- z1 -- cycle ; +p[3] = llcorner Page -- lrcorner Page -- z4 -- z3 -- cycle ; +p[4] = llcorner Page -- z7 -- z8 -- z3 -- cycle ; +fill p[1] withcolor \MPcolor{a} ; +fill p[2] withcolor \MPcolor{c} ; +fill p[3] withcolor \MPcolor{c} ; +fill p[4] withcolor \MPcolor{a} ; +draw \sometxt{\framed[frame=off,offset=0pt,width=.5\textwidth,height=.5cm,align=left,top=\vss,bottom=\vss,strut=no]{\ix\color[b]{\currentdate \quad}}} shifted (1cm,y1) ; +draw \sometxt{\framed[frame=off,offset=0pt,width=.5\textwidth,height=.5cm,align=right,top=\vss,bottom=\vss,strut=no]{\ix\color[b]{\quad \folio\ of \lastpage}}} shifted (x5,y1) ; +draw \sometxt{\framed[frame=off,offset=0pt,width=.5\textwidth,height=.5cm,align=left,top=\vss,bottom=\vss,strut=no]{\ix\color[b]{\getvariable{taspresent}{author}\quad}}} shifted (1cm,0) ; +draw \sometxt{\framed[frame=off,offset=0pt,width=.5\textwidth,height=.5cm,align=right,top=\vss,bottom=\vss,strut=no]{\ix\color[b]{\quad \getvariable{taspresent}{title}}}} shifted (x5,0) ; +StopPage ; +\stopuseMPgraphic + +%D We define these backgrounds as overlays: + +\defineoverlay +[lecbackground] +[\useMPgraphic{slide}] + +\defineoverlay +[picbackground] +[\useMPgraphic{slide}] + +%D These are shortcuts to switch backgrounds: + +\define\lecback{\setuplayout[header=3.2cm]\setupbackgrounds[page][background={lecbackground,bottom,slidetitle}]} +\define\titback{\setuplayout[header=.5cm]\setupbackgrounds[page][background=lecbackground]} +\define\picback{\setuplayout[header=.5cm]\setupbackgrounds[page][background={lecbackground,bottom}]} +\define\noback{\setupbackgrounds[page][background=nobackground]} + +%D We use combinations for placing vertical pictures and text side by side, and +%D we want a distance of 1.1 cm between both. + +\setupcombinations[distance=1.1cm] + +%D The symbol for the first level of itemizations. + +\definesymbol[1][\useMPgraphic{ItSquare}] +\setupitemize[1][color=a] + +\protect +\stopmodule + +\endinput + diff --git a/obsolete/macros/context/contrib/context-taspresent/tex/context/third/taspresent/t-bluegray.tex b/obsolete/macros/context/contrib/context-taspresent/tex/context/third/taspresent/t-bluegray.tex new file mode 100644 index 0000000000..e83b3e6f0e --- /dev/null +++ b/obsolete/macros/context/contrib/context-taspresent/tex/context/third/taspresent/t-bluegray.tex @@ -0,0 +1,271 @@ +%D \module +%D [ file=t-bluegray, +%D version=2007.07.17, +%D title=\CONTEXT\ Style File, +%D subtitle=Presentation Module bluegray, +%D author=Thomas A. Schmitz, +%D date=\currentdate, +%D copyright={Thomas A. Schmitz}] +%C +%C Copyright 2007 Thomas A. Schmitz. +%C This file may be distributed under the GNU General Public License v. 2.0. + +%D This file provides the \quotation{bluegray} style for the presentation +%D module. It is loaded at runtime. + +\writestatus{loading}{module bluegray} + +\startmodule[bluegray] + +\unprotect + +%D The taspresentation module provides a skeleton into which different styles +%D can be hooked. It uses a number of variables and macros which have to be set +%D beforehand. Some parts are optional. We begin with the necessary definitions: + +%D The bluegray module has parameters of its own; we set them up and use +%D them: + +\setupmodule[color=blue] + +\processaction[\currentmoduleparameter{color}] + [ blue=>\def\colormode{bluemode}, + red=>\def\colormode{redmode}, + \v!unknown=>\def\colormode{bluemode}, + \v!default=>\def\colormode{bluemode}] + +\enablemode[\colormode] + +%D We define our colors: + +\startmode[bluemode] +\definecolor [outer] [r=0.8,g=0.8,b=0.9] +\definecolor [inner] [s=.88] +\definecolor [One] [r=.67, g=0, b=.04] +\definecolor [tcolor] [s=0] +\stopmode + +\startmode[redmode] +\definecolor [outer] [r=0.45,] +\definecolor [inner] [s=.18] +\definecolor [One] [r=.67, g=0, b=.04] +\definecolor [tcolor] [s=1] +\stopmode + +%D We start colors: + +\setupcolors[state=start,textcolor=tcolor] + +%D These macros are used for placing figures/pictures: + +\define\NormalHeight{\textheight} +\define\NormalWidth{.476\textwidth} +\define\PictureFrameHeight{\textheight} +\define\PictureFrameWidth{.476\textwidth} + +%D The page layout: + +\setuplayout [width=fit, + margin=2cm, + height=fit, + leftmargindistance=.8cm, + rightmargindistance=0cm, + header=18mm, + footer=0cm, + topspace=.8cm, + backspace=2cm, + location=singlesided] + +%D The macro for typesetting the Slidetitle; this is adapted from a sample +%D document that Brooks Moses published on the wiki: + +\definelayer[slidetitle] + [width=\paperwidth, + height=\paperheight, + x=20mm] + +\define[1]\Slidetitle{\page\setlayer[slidetitle]% + {\framed[frame=off,height=2.5cm,width=\textwidth,offset=0pt,align=middle,top=\vss,bottom=\vss]{\switchtobodyfont[\Titlesize]#1}}} + +%D The macro \tex{Maketitle} produces a default title page with the author, the +%D title of the presentation, and the date. Using it is not mandatory. + +\define\Maketitle{% +\titback +\null +\vfill +\midaligned{\switchtobodyfont[\Titlesize]\getvariable{taspresent}{title}} +\blank[2*line] +\midaligned{\getvariable{taspresent}{author}} +\blank[3*line] +\midaligned{\currentdate} +\vfill +\null} + +%D The following parts are optional; if you don't use backgrounds and are +%D content with CONTEXT's default itemization, you don't have to set these +%D macros. + +%D This is the font we will use to draw the numbers on the slides + +\beginOLDTEX +\definefontsynonym [BigN] [uhvb8r] +\definefont[NumberFont] [BigN at 30pt] + +%D We let Metapost calculate the background: + +\startuniqueMPgraphic{textslide} +StartPage ; +fill Page withcolor \MPcolor{outer} ; +fill Field[Text][Text] enlarged.2cm withcolor \MPcolor{inner} ; +StopPage ; +\stopuniqueMPgraphic + +\startuniqueMPgraphic{vertpic} +StartPage ; +fill Page withcolor \MPcolor{outer} ; +path Main ; +z1 = urcorner Field[Text][Text] shifted (.2cm,0) ; +z2 = lrcorner Field[Text][Text] shifted (.2cm,-.2cm) ; +z3 = z1 shifted (-8.05cm,0) ; +z4 = (x3,y2) ; +Main := z1 -- z2 -- z4 -- z3 --cycle ; +fill Main withcolor \MPcolor{inner} ; +StopPage ; +\stopuniqueMPgraphic + +\startuseMPgraphic{Bottomone} +StartPage +picture Left, Right ; +%defaultfont := "texnansi-myros-MyriadProBold" ; +%defaultfont := "texnansi-lmssbx10" ; +%Left := Right := thelabel("\folio",origin) ysized 5cm ; +if PageNumber < 10: + Left := \sometxt{\framed[width=1cm,offset=0pt,align=middle,frame=off]{\color[outer]{\NumberFont \folio}}} ysized 6cm; + Right := \sometxt{\framed[width=1cm,offset=0pt,align=middle,frame=off]{\color[inner]{\NumberFont \folio}}} ysized 6cm; + clip Right to boundingbox Right xyscaled(0,3cm) shifted (bbwidth(Right)/2,0) ; + draw Left shifted (16.34cm,-.3cm) ; + draw Right shifted (16.34cm,-.3cm) ; +fi; +StopPage +\stopuseMPgraphic + + +\startuseMPgraphic{Bottomten} +StartPage +picture Left, Right ; +%defaultfont := "texnansi-myros-MyriadProBold" ; +%defaultfont := "texnansi-lmssbx10" ; +%Left := Right := thelabel("\folio",origin) ysized 5cm ; +if PageNumber >= 10: + Left := \sometxt{\framed[width=1.7cm,offset=0pt,align=middle,frame=off]{\color[outer]{\NumberFont \folio}}} ysized 6cm ; + Right := \sometxt{\framed[width=1.7cm,offset=0pt,align=middle,frame=off]{\color[inner]{\NumberFont \folio}}} ysized 6cm ; + clip Right to boundingbox Right xyscaled(0,3cm) shifted (bbwidth(Right)/1.5,0) ; + draw Left shifted (12.61cm,-.3cm) withcolor \MPcolor{outer} ; + draw Right shifted (12.61cm,-.3cm) withcolor \MPcolor{inner} ; +fi ; +StopPage +\stopuseMPgraphic +\endOLDTEX + +\beginLUATEX +\definefontfeature[intended][script=latn,language=dflt,liga=yes,kern=yes,tlig=yes,trep=yes,mode=node] +\font\NumberFont=name:texgyreheros-bold*intended at 30pt + +%D We let Metapost calculate the background: + +\startuniqueMPgraphic{textslide} +StartPage ; +fill Page withcolor \MPcolor{outer} ; +fill Field[Text][Text] enlarged.2cm withcolor \MPcolor{inner} ; +StopPage ; +\stopuniqueMPgraphic + +\startuniqueMPgraphic{vertpic} +StartPage ; +fill Page withcolor \MPcolor{outer} ; +path Main ; +z1 = urcorner Field[Text][Text] shifted (.2cm,0) ; +z2 = lrcorner Field[Text][Text] shifted (.2cm,-.2cm) ; +z3 = z1 shifted (-8.05cm,0) ; +z4 = (x3,y2) ; +Main := z1 -- z2 -- z4 -- z3 --cycle ; +fill Main withcolor \MPcolor{inner} ; +StopPage ; +\stopuniqueMPgraphic + +\startuseMPgraphic{Bottomone} +StartPage +picture Left, Right ; +%defaultfont := "texnansi-myros-MyriadProBold" ; +%defaultfont := "texnansi-lmssbx10" ; +%Left := Right := thelabel("\folio",origin) ysized 5cm ; +if PageNumber < 10: + Left := \sometxt{\framed[width=1cm,offset=0pt,align=middle,frame=off]{\color[outer]{\NumberFont \folio}}} ysized 6cm; + Right := \sometxt{\framed[width=1cm,offset=0pt,align=middle,frame=off]{\color[inner]{\NumberFont \folio}}} ysized 6cm; + clip Right to boundingbox Right xyscaled(0,3cm) shifted (bbwidth(Right)/2,0) ; + draw Left shifted (16.34cm,-.3cm) ; + draw Right shifted (16.34cm,-.3cm) ; +fi; +StopPage +\stopuseMPgraphic + + +\startuseMPgraphic{Bottomten} +StartPage +picture Left, Right ; +%defaultfont := "texnansi-myros-MyriadProBold" ; +%defaultfont := "texnansi-lmssbx10" ; +%Left := Right := thelabel("\folio",origin) ysized 5cm ; +if PageNumber >= 10: + Left := \sometxt{\framed[width=1.7cm,offset=0pt,align=middle,frame=off]{\color[outer]{\NumberFont \folio}}} ysized 6cm ; + Right := \sometxt{\framed[width=1.7cm,offset=0pt,align=middle,frame=off]{\color[inner]{\NumberFont \folio}}} ysized 6cm ; + clip Right to boundingbox Right xyscaled(0,3cm) shifted (bbwidth(Right)/1.5,0) ; + draw Left shifted (12.61cm,-.3cm) withcolor \MPcolor{outer} ; + draw Right shifted (12.61cm,-.3cm) withcolor \MPcolor{inner} ; +fi ; +StopPage +\stopuseMPgraphic +\endLUATEX + +%D We define these backgrounds as overlays: + +\defineoverlay +[lecbackground] +[\useMPgraphic{textslide}] + +\defineoverlay +[picbackground] +[\useMPgraphic{vertpic}] + +\defineoverlay +[bottomone] +[\useMPgraphic{Bottomone}] + +\defineoverlay +[bottomten] +[\useMPgraphic{Bottomten}] + +%D These are shortcuts to switch backgrounds: + +\define\lecback{\setuplayout[header=18mm]\setupbackgrounds[page][background={lecbackground,bottomone,bottomten,slidetitle}]} +\define\titback{\setupbackgrounds[page][background=lecbackground]} +\define\picback{\setuplayout[header=0mm]\setupbackgrounds[page][background={picbackground,bottomone,bottom,bottomten,slidetitle}]} +\define\noback{\setupbackgrounds[page][background=nobackground]} + +%D We use combinations for placing vertical pictures and text side by side, and +%D we want a distance of 1.1 cm between both. + +\setupcombinations[distance=1.1cm] + +%D The symbol for the first level of itemizations. + +\definesymbol[1][$\square$] +\setupitemize[1][inmargin] +%\setupitemize[each][joinedup,unpacked] + +\protect +\stopmodule + +\endinput + diff --git a/obsolete/macros/context/contrib/context-taspresent/tex/context/third/taspresent/t-bluestripe.tex b/obsolete/macros/context/contrib/context-taspresent/tex/context/third/taspresent/t-bluestripe.tex new file mode 100644 index 0000000000..ef61796d38 --- /dev/null +++ b/obsolete/macros/context/contrib/context-taspresent/tex/context/third/taspresent/t-bluestripe.tex @@ -0,0 +1,160 @@ +%D \module +%D [ file=t-bluestripe, +%D version=2007.07.17, +%D title=\CONTEXT\ Style File, +%D subtitle=Presentation Module bluestripe, +%D author=Thomas A. Schmitz, +%D date=\currentdate, +%D copyright={Thomas A. Schmitz}] +%C +%C Copyright 2007 Thomas A. Schmitz. +%C This file may be distributed under the GNU General Public License v. 2.0. + +%D This file provides the \quotation{bluestripe} style for the presentation +%D module. It is loaded at runtime. The theme for this style is inspired by the +%D \quotation{Berkeley} theme of the \LaTeX\ Beamer package. + +\writestatus{loading}{module bluestripe} + +\startmodule[bluestripe] + +\unprotect + +%D The taspresentation module provides a skeleton into which different styles +%D can be hooked. It uses a number of variables and macros which have to be set +%D beforehand. Some parts are optional. We begin with the necessary definitions: + +%D We start colors; textcolor is white: + +\setupcolors[state=start] + +%D These macros are used for placing figures/pictures: + +\define\NormalHeight{\textheight} +\define\NormalWidth{.476\textwidth} +\define\PictureFrameHeight{\textheight} +\define\PictureFrameWidth{.476\textwidth} + +%D The page layout: + +\setuplayout [width=fit, + leftmargin=1.5cm, + rightmargin=0cm, + leftmargindistance=.9cm, + rightmargindistance=0pt, + height=fit, + header=2.5cm, + footer=0cm, + topspace=.4cm, + backspace=2.9cm, + cutspace=2.8cm, + bottomspace=0cm, + bottom=0pt, + location=singlesided] + +%D The macro for typesetting the Slidetitle; this is adapted from a sample +%D document that Brooks Moses published on the wiki: + +\definelayer[slidetitle] + [width=\paperwidth, + height=\paperheight, + x=29mm] + +\define[1]\Slidetitle{\page\setlayer[slidetitle]% + {\framed[frame=off,height=2.5cm,offset=0pt,top=\vss,bottom=\vss]{\switchtobodyfont[\Titlesize]\color[a]{#1}}}} + +%D The macro \tex{Maketitle} produces a default title page with the author, the +%D title of the presentation, and the date. Using it is not mandatory. + +\define\Maketitle{% +\titback +\null +\vfill +\midaligned{\switchtobodyfont[\Titlesize]\color[b]{\getvariable{taspresent}{title}}} +\blank[2*line] +\midaligned{\color[b]{\getvariable{taspresent}{author}}} +\blank[3*line] +\midaligned{\color[b]{\currentdate}} +\vfill +\null} + +%D The following parts are optional; if you don't use backgrounds and are +%D content with CONTEXT's default itemization, you don't have to set these +%D macros. + +%D We define our colors: + +\definecolor [Item] [s=.9] +\definecolor [a] [s=.9] +\definecolor [c] [r=.15,g=.15,b=.525] +\definecolor [b] [r=.2,g=.2,b=.7] +\definecolor [d] [s=.4] + +%D We let Metapost calculate the background: + +\startuseMPgraphic{stripe} +StartPage ; +numeric a, dur, now, before, proa, prob ; +pair k[], F[] ; +a = 2.5cm ; +dur = 1.5cm ; +k[1] = ulcorner Page shifted (a,0) ; +k[2] = llcorner Page shifted (a,0) ; +k[3] = ulcorner Page shifted (0,-a) ; +k[4] = urcorner Page shifted (0,-a) ; +k[5] = ulcorner Page shifted (a,-a) ; +path p[] ; +p[1] = ulcorner Page -- k[1] -- k[2] -- llcorner Page -- cycle ; +p[2] = ulcorner Page -- urcorner Page -- k[4] -- k[3] -- cycle ; +p[3] = ulcorner Page -- k[1] -- k[5] -- k[3] -- cycle ; +fill Page withcolor \MPcolor{a} ; +fill p[1] withcolor \MPcolor{b} ; +fill p[2] withcolor \MPcolor{b} ; +fill p[3] withcolor \MPcolor{c} ; +pickup pencircle scaled 5pt ; +if \realfolio > 1: + before = PageNumber - 1 ; + now = NOfPages - 1 ; + prob = before/now ; + p[4] = unitcircle scaled dur rotated 90 shifted (dur + ((a-dur)/2),(a-dur)/2) ; + fill p[4] withcolor \MPcolor{a} ; + F[0] = center p[4] ; + F[1] = point 1 along p[4] ; + F[2] = point -prob along p[4] ; + F[3] = point -prob/2 along p[4] ; + p[5] = F[0] -- F[1] .. F[3] .. F[2] -- cycle ; + fill p[5] withcolor \MPcolor{d} ; +fi ; +StopPage ; +\stopuseMPgraphic + +%D We define these backgrounds as overlays: + +\defineoverlay +[lecbackground] +[\useMPgraphic{stripe}] + +%D We use combinations for placing vertical pictures and text side by side, and +%D we want a distance of 1.1 cm between both. + +\setupcombinations[distance=1.1cm] + +%D These are shortcuts to switch backgrounds: + +\define\lecback{\setupbackgrounds[page][background={lecbackground,slidetitle}]} +\define\titback{\setupbackgrounds[page][background=lecbackground]} +\define\picback{\setupbackgrounds[page][background={lecbackground,slidetitle}]} +\define\noback{\setupbackgrounds[page][background=nobackground]} + +\setupbackgrounds[page][background=lecbackground] + +%D The symbol for the first level of itemizations. + +\definesymbol[1][\useMPgraphic{ItTriangle}] +\setupitemize[1][inmargin][color=a] + +\protect +\stopmodule + +\endinput + diff --git a/obsolete/macros/context/contrib/context-taspresent/tex/context/third/taspresent/t-darkshade.tex b/obsolete/macros/context/contrib/context-taspresent/tex/context/third/taspresent/t-darkshade.tex new file mode 100644 index 0000000000..e85473a068 --- /dev/null +++ b/obsolete/macros/context/contrib/context-taspresent/tex/context/third/taspresent/t-darkshade.tex @@ -0,0 +1,165 @@ +%D \module +%D [ file=t-darkshade, +%D version=2007.07.17, +%D title=\CONTEXT\ Style File, +%D subtitle=Presentation Module darkshade, +%D author=Thomas A. Schmitz, +%D date=\currentdate, +%D copyright={Thomas A. Schmitz}] +%C +%C Copyright 2007 Thomas A. Schmitz. +%C This file may be distributed under the GNU General Public License v. 2.0. + +%D This file provides the \quotation{darkshade} style for the presentation +%D module. It is loaded at runtime. + +\writestatus{loading}{module darkshade} + +\startmodule[darkshade] + +\unprotect + +%D The taspresentation module provides a skeleton into which different styles +%D can be hooked. It uses a number of variables and macros which have to be set +%D beforehand. Some parts are optional. We begin with the necessary definitions: + +%D We start colors; textcolor is white: + +\setupcolors[state=start,textcolor=white] + +%D The darkshade module has parameters of its own; we set them up and use +%D them: + +\setupmodule[color=blue] + +\processaction[\currentmoduleparameter{color}] + [ blue=>\def\colormode{bluemode}, + green=>\def\colormode{greenmode}, + bluered=>\def\colormode{blueredmode}, + \v!unknown=>\def\colormode{bluemode}, + \v!default=>\def\colormode{bluemode}] + +\enablemode[\colormode] + +%D These macros are used for placing figures/pictures: + +\define\NormalHeight{.83\textheight} +\define\NormalWidth{.476\textwidth} +\define\PictureFrameHeight{.83\textheight} +\define\PictureFrameWidth{.476\textwidth} + +%D The page layout: + +\setuplayout [width=fit, + margin=1.5cm, + leftmargindistance=0pt, + rightmargindistance=0pt, + height=fit, + header=0pt, + footer=5pt, + topspace=.8cm, + backspace=1.5cm, + bottomspace=.8cm, + bottom=12pt, + location=singlesided] + +%D The macro for typesetting the Slidetitle: + +\define[1]\Slidetitle{\page\midaligned{\switchtobodyfont[\Titlesize]#1}\blank[0.75cm]} + +%D The macro \tex{Maketitle} produces a default title page with the author, the +%D title of the presentation, and the date. Using it is not mandatory. + +\define\Maketitle{% +\titback +\null +\vfill +\midaligned{\switchtobodyfont[\Titlesize]\getvariable{taspresent}{title}} +\blank[2*line] +\midaligned{\getvariable{taspresent}{author}} +\blank[3*line] +\midaligned{\currentdate} +\vfill +\null} + +%D The following parts are optional; if you don't use backgrounds and are +%D content with CONTEXT's default itemization, you don't have to set these +%D macros. + +%D We define our colors: + +\startmode[blueredmode] +\definecolor [InteractionColor] [b=.2] +\definecolor [ContrastColor] [b=.8] +\definecolor [One] [s=.6] +\definecolor [Item] [s=1] +\definecolor [a] [r=0.5,g=0,b=0] +\definecolor [b] [r=0,g=0,b=0.5] +\stopmode + + +\startmode[bluemode] +\definecolor [InteractionColor] [b=.2] +\definecolor [ContrastColor] [b=.8] +\definecolor [One] [s=.6] +\definecolor [Item] [s=1] +\definecolor [a] [r=0,g=0,b=1] +\definecolor [b] [r=0,g=0,b=0.05] +\stopmode + +\startmode[greenmode] +\definecolor [InteractionColor] [s=.2] +\definecolor [ContrastColor] [s=.5] +\definecolor [One] [s=.6] +\definecolor [Item] [s=1] +\definecolor [a] [r=0,g=.8,b=0] +\definecolor [b] [r=0,g=0.05,b=0] +\stopmode + +%D We let Metapost calculate the background: + +\startuniqueMPgraphic{LinearShade} +path p ; +p := unitsquare xscaled \overlaywidth yscaled \overlayheight ; +linear_shade(p,6,\MPcolor{a},\MPcolor{b}) ; +\stopuniqueMPgraphic + +%D We define these backgrounds as overlays: + +\defineoverlay +[lecbackground] +[\useMPgraphic{LinearShade}] + +%D These are shortcuts to switch backgrounds: + +\define\lecback{\setupbackgrounds[page][background=lecbackground]\setupinteractionbar[state=start]} +\define\titback{\setupbackgrounds[page][background=lecbackground]\setupinteractionbar[state=stop]} +\define\picback{\setupbackgrounds[page][background=lecbackground]\setupinteractionbar[state=start]} +\define\noback{\setupbackgrounds[page][background=lecbackground]} + +\setupbackgrounds[page][background=lecbackground] + +%D The symbol for the first level of itemizations. + +\definesymbol[1][\useMPgraphic{ItSquare}] + +%D The \quotation{darkshade} style uses \CONTEXT's interactionbar: + +\setupsubpagenumber[way=bytext,state=start] + +\setupinteraction + [page=yes, + color=InteractionColor, + contrastcolor=ContrastColor, + menu=on, + state=start] + +\startinteractionmenu[bottom] +{\interactionbar[alternative=f,width=\makeupwidth,height=1ex]} +\stopinteractionmenu + +\protect +\stopmodule + +\endinput + diff --git a/obsolete/macros/context/contrib/context-taspresent/tex/context/third/taspresent/t-doubleframe.tex b/obsolete/macros/context/contrib/context-taspresent/tex/context/third/taspresent/t-doubleframe.tex new file mode 100644 index 0000000000..9dc579d0a6 --- /dev/null +++ b/obsolete/macros/context/contrib/context-taspresent/tex/context/third/taspresent/t-doubleframe.tex @@ -0,0 +1,278 @@ +%D \module +%D [ file=t-doubleframe, +%D version=2007.07.17, +%D title=\CONTEXT\ Style File, +%D subtitle=Presentation Module doubleframe, +%D author=Thomas A. Schmitz, +%D date=\currentdate, +%D copyright={Thomas A. Schmitz}] +%C +%C Copyright 2007 Thomas A. Schmitz. +%C This file may be distributed under the GNU General Public License v. 2.0. + +%D This file provides the \quotation{doubleframe} style for the presentation +%D module. It is loaded at runtime. + +\writestatus{loading}{module doubleframe} + +\startmodule[doubleframe] + +\unprotect + +%D The taspresentation module provides a skeleton into which different styles +%D can be hooked. It uses a number of variables and macros which have to be set +%D beforehand. Some parts are optional. We begin with the necessary definitions: + +%D We start colors: + +\setupcolors[state=start] + +%D The doubleframe module has parameters of its own; we set them up and use +%D them: + +\setupmodule[bottom=square] + +\processaction[\currentmoduleparameter{bottom}] + [ square=>\def\bottommode{squaremode}, + stripe=>\def\bottommode{stripemode}, + \v!unknown=>\def\bottommode{squaremode}, + \v!default=>\def\bottommode{squaremode}] + +\enablemode[\bottommode] + +%D These macros are used for placing figures/pictures: + +\define\NormalHeight{.98\textheight} +\define\NormalWidth{.485\textwidth} +\define\PictureFrameHeight{.98\textheight} +\define\PictureFrameWidth{.485\textwidth} + +%D The page layout: + +\setuplayout [width=fit, + margin=0.6cm, + height=fit, + header=2.1cm, + footer=1.35cm, + footerdistance=0.5cm, + topspace=0.5cm, + backspace=1cm, + location=singlesided] + +%D The macro for typesetting the Slidetitle; this is adapted from a sample +%D document that Brooks Moses published on the wiki: + +\definelayer[slidetitle] + [width=\paperwidth, + height=\paperheight, + x=10mm, + y=3mm] + +\define[1]\Slidetitle{\page\setlayer[slidetitle]% + {\framed[frame=off,width=\textwidth,height=2.1cm,offset=0pt,top=\vss,bottom=\vss]{\switchtobodyfont[\Titlesize]\color[One]{#1}}}} + +%D The macro \tex{Maketitle} produces a default title page with the author, the +%D title of the presentation, and the date. Using it is not mandatory. + +\define\Maketitle{% +\titback +%\switchtobodyfont[\Titlesize] +\null +\vfill +\midaligned{\color[One]{\tfc\getvariable{taspresent}{title}}} +\blank[3*line] +\midaligned{\tfa\getvariable{taspresent}{author}} +\blank[2*line] +\midaligned{\tfa\currentdate} +\vfill +\null\switchtobodyfont[\Normalsize]} + +%D The following parts are optional; if you don't use backgrounds and are +%D content with CONTEXT's default itemization, you don't have to set these +%D macros. + +%D We define our colors: + +\definecolor [BackgroundColor] [r=.85, g=.85, b=.85] +\definecolor [MyFrameColor] [r=.42, g=.42, b=.7] +\definecolor [Dark] [r=.9, g=.9, b=.9] +\definecolor [One] [r=0, g=0, b=.5] +\definecolor [Two] [r=0, g=0, b=.55] +\definecolor [Three] [r=0, g=0, b=.6] +\definecolor [Four] [r=0, g=0, b=.65] +\definecolor [Five] [r=0, g=0, b=.7] +\definecolor [Six] [r=0, g=0, b=.75] +\definecolor [Seven] [r=0, g=0, b=.8] +\definecolor [Eight] [r=0, g=0, b=.85] +\definecolor [Nine] [r=0, g=0, b=.9] +\definecolor [Ten] [r=0, g=0, b=.95] +\definecolor [Eleven] [r=0, g=0, b=1] +\definecolor [Item] [One] + +%D We let Metapost calculate the background: + +\startmode[squaremode] +\startuseMPgraphic{Bottom09} +StartPage +numeric a; a = 0.955cm ; +numeric b; b = 0.52cm ; +numeric c; c = 0.8cm ; +path p[] ; +p[2] = unitsquare xyscaled (a,a) shifted (b, c) ; +p[3] = unitsquare xyscaled (a,a) shifted (b+2*a, c) ; +p[4] = unitsquare xyscaled (a,a) shifted (b+4*a, c) ; +p[5] = unitsquare xyscaled (a,a) shifted (b+6*a, c) ; +p[6] = unitsquare xyscaled (a,a) shifted (b+8*a, c) ; +p[7] = unitsquare xyscaled (a,a) shifted (b+10*a, c) ; +p[8] = unitsquare xyscaled (a,a) shifted (b+12*a, c) ; +p[9] = unitsquare xyscaled (a,a) shifted (b+14*a, c) ; +p[10] = unitsquare xyscaled (a,a) shifted (b+16*a, c) ; +p[11] = unitsquare xyscaled (a,a) shifted (b+18*a, c) ; +p[12] = unitsquare xyscaled (a,a) shifted (b+20*a, c) ; +fill p[2] withcolor \MPcolor{One} ; +fill p[3] withcolor \MPcolor{Two} ; +fill p[4] withcolor \MPcolor{Three} ; +fill p[5] withcolor \MPcolor{Four} ; +fill p[6] withcolor \MPcolor{Five} ; +fill p[7] withcolor \MPcolor{Six} ; +fill p[8] withcolor \MPcolor{Seven} ; +fill p[9] withcolor \MPcolor{Eight} ; +fill p[10] withcolor \MPcolor{Nine} ; +fill p[11] withcolor \MPcolor{Ten} ; +fill p[12] withcolor \MPcolor{Eleven} ; +pickup pencircle scaled 2pt ; +if NOfPages = 12: + for j=2 upto 12: + if PageNumber=(j): + draw llcorner p[j] --urcorner p[j] withcolor \MPcolor{BackgroundColor} ; + fi ; + endfor ; +fi ; +numeric o; o = NOfPages - 1 ; +numeric i; i = PageNumber - 1 ; +numeric k; k = i/o ; +if NOfPages > 12: + if i = 1: + draw llcorner p[2] -- urcorner p[2] withcolor \MPcolor{BackgroundColor} ; + elseif (k>0.01) and (k<=2/11): + draw llcorner p[3] -- urcorner p[3] withcolor \MPcolor{BackgroundColor} ; + elseif (k>2/11) and (k<=3/11): + draw llcorner p[4] -- urcorner p[4] withcolor \MPcolor{BackgroundColor} ; + elseif (k>3/11) and (k<=4/11): + draw llcorner p[5] -- urcorner p[5] withcolor \MPcolor{BackgroundColor} ; + elseif (k>4/11) and (k<=5/11): + draw llcorner p[6] -- urcorner p[6] withcolor \MPcolor{BackgroundColor} ; + elseif (k>5/111) and (k<6/11): + draw llcorner p[7] -- urcorner p[7] withcolor \MPcolor{BackgroundColor} ; + elseif (k>6/11) and (k<=7/11): + draw llcorner p[8] -- urcorner p[8] withcolor \MPcolor{BackgroundColor} ; + elseif (k>7/11) and (k<=8/11): + draw llcorner p[9] -- urcorner p[9] withcolor \MPcolor{BackgroundColor} ; + elseif (k>8/11) and (k<=9/11): + draw llcorner p[10] -- urcorner p[10] withcolor \MPcolor{BackgroundColor} ; + elseif (k>9/11) and (k<1): + draw llcorner p[11] -- urcorner p[11] withcolor \MPcolor{BackgroundColor} ; + elseif k=1: + draw llcorner p[12] -- urcorner p[12] withcolor \MPcolor{BackgroundColor} ; + fi ; +fi +StopPage +\stopuseMPgraphic +\stopmode + +\startmode[stripemode] +\startuseMPgraphic{Bottom09} +StartPage +path p[] ; +p[1] := unitsquare xyscaled(0.95*OverlayWidth,1cm) shifted (0.52cm,0.8cm) ; +linear_shade(p[1],0,\MPcolor{BackgroundColor},\MPcolor{One}) ; +numeric i; i = PageNumber/NOfPages ; +p[2] = ulcorner p[1] -- urcorner p[1] ; +p[3] = llcorner p[1] -- lrcorner p[1] ; +pair o[] ; +o[1] := point i along p[2] ; +o[2] := point i along p[3] ; +p[4] = ulcorner p[1] -- o[1] -- o[2] -- llcorner p[1] -- cycle ; +clip currentpicture to p[4] ; +StopPage +\stopuseMPgraphic +\stopmode + +\startuniqueMPgraphic{PicBackground09} +StartPage ; +fill Page withcolor \MPcolor{BackgroundColor} ; +draw unitsquare +xyscaled(OverlayWidth,OverlayHeight) +enlarged (-.2cm) +withpen pencircle scaled 4pt +withcolor \MPcolor{MyFrameColor} ; +draw unitsquare +xyscaled(0.448*OverlayWidth,0.815*OverlayHeight) +shifted (0.528*OverlayWidth, 0.15*OverlayHeight) +withpen pencircle scaled 2pt +withcolor \MPcolor{MyFrameColor} ; +StopPage ; +\stopuniqueMPgraphic + +\startuniqueMPgraphic{Background09} +fill unitsquare +xyscaled(OverlayWidth,OverlayHeight) +withcolor \MPcolor{BackgroundColor} ; +draw unitsquare +xyscaled(OverlayWidth,OverlayHeight) +enlarged (-.2cm) +withpen pencircle scaled 4pt +withcolor \MPcolor{MyFrameColor} ; +draw unitsquare +xyscaled(0.95*OverlayWidth,0.7*OverlayHeight) +shifted (0.025*OverlayWidth, 0.15*OverlayHeight) +withpen pencircle scaled 2pt +withcolor \MPcolor{MyFrameColor} ; +\stopuniqueMPgraphic + +\startuniqueMPgraphic{FancyFrame} +draw unitsquare xyscaled(OverlayWidth-2pt,OverlayHeight-2pt) +withpen pencircle scaled 2pt +withcolor \MPcolor{MyFrameColor} ; +\stopuniqueMPgraphic + +%D We define these backgrounds as overlays: + +\defineoverlay +[bottom] +[\useMPgraphic{Bottom09}] + +\defineoverlay +[lecbackground] +[\useMPgraphic{Background09}] + +\defineoverlay +[picbackground] +[\useMPgraphic{PicBackground09}] + +\defineoverlay +[FrameFrame] +[\uniqueMPgraphic{FancyFrame}] + +%D These are shortcuts to switch backgrounds: + +\define\lecback{\setupbackgrounds[page][background={lecbackground,bottom,slidetitle}]\setuplayout[backspace=1cm,header=2.1cm]} +\define\titback{\setupbackgrounds[page][background=lecbackground]\setuplayout[backspace=1cm]} +\define\picback{\setupbackgrounds[page][background={picbackground,bottom}]\setuplayout[backspace=0.5cm,header=0cm]} +\define\noback{\setupbackgrounds[page][background=nobackground]} + +%D We use combinations for placing vertical pictures and text side by side, and +%D we want a distance of 1.1 cm between both. + +\setupcombinations[distance=1.1cm] + +%D The symbol for the first level of itemizations. + +\definesymbol[1][\useMPgraphic{ItSquare}] +\setupitemize[color=One] + +\protect +\stopmodule + +\endinput + diff --git a/obsolete/macros/context/contrib/context-taspresent/tex/context/third/taspresent/t-doubleshade.tex b/obsolete/macros/context/contrib/context-taspresent/tex/context/third/taspresent/t-doubleshade.tex new file mode 100644 index 0000000000..858540e9ef --- /dev/null +++ b/obsolete/macros/context/contrib/context-taspresent/tex/context/third/taspresent/t-doubleshade.tex @@ -0,0 +1,130 @@ +%D \module +%D [ file=t-doubleshade, +%D version=2007.07.17, +%D title=\CONTEXT\ Style File, +%D subtitle=Presentation Module doubleshade, +%D author=Thomas A. Schmitz, +%D date=\currentdate, +%D copyright={Thomas A. Schmitz}] +%C +%C Copyright 2007 Thomas A. Schmitz. +%C This file may be distributed under the GNU General Public License v. 2.0. + +%D This file provides the \quotation{doubleshade} style for the presentation +%D module. It is loaded at runtime. + +\writestatus{loading}{module doubleshade} + +\startmodule[doubleshade] + +\unprotect + +%D The taspresentation module provides a skeleton into which different styles +%D can be hooked. It uses a number of variables and macros which have to be set +%D beforehand. Some parts are optional. We begin with the necessary definitions: + +%D We start colors; textcolor is white: + +\setupcolors[state=start,textcolor=white] + +%D These macros are used for placing figures/pictures: + +\define\NormalHeight{.88\textheight} +\define\NormalWidth{.476\textwidth} +\define\PictureFrameHeight{.88\textheight} +\define\PictureFrameWidth{.476\textwidth} + +%D The page layout: + +\setuplayout [width=fit, + leftmargin=1.5cm, + rightmargin=0cm, + leftmargindistance=.7cm, + rightmargindistance=0pt, + height=fit, + header=0pt, + footer=5pt, + topspace=.8cm, + backspace=3.5cm, + cutspace=2.7cm, + bottomspace=0cm, + bottom=0pt, + location=singlesided] + +%D The macro for typesetting the Slidetitle: + +\define[1]\Slidetitle{\page\framed[frame=off,offset=0pt,height=1.1cm,width=\textwidth,align=middle]{\switchtobodyfont[\Titlesize]\color[c]{#1}}\blank[0.5cm]} + +%D The macro \tex{Maketitle} produces a default title page with the author, the +%D title of the presentation, and the date. Using it is not mandatory. + +\define\Maketitle{% +\titback +\null +\vfill +\midaligned{\switchtobodyfont[\Titlesize]\color[c]{\getvariable{taspresent}{title}}} +\blank[2*line] +\midaligned{\color[c]{\getvariable{taspresent}{author}}} +\blank[3*line] +\midaligned{\color[c]{\currentdate}} +\vfill +\null} + +%D The following parts are optional; if you don't use backgrounds and are +%D content with CONTEXT's default itemization, you don't have to set these +%D macros. + +%D We define our colors: + +\definecolor [Item] [r=1,g=1,b=1] +\definecolor [a] [r=0,g=0,b=1] +\definecolor [c] [r=.63,g=.8,b=1] +\definecolor [b] [r=0,g=0,b=0.05] + +%D We let Metapost calculate the background: + +\startuseMPgraphic{LinearShade} +StartPage ; +path p[] ; +p[1] := ulcorner Page -- llcorner Page -- llcorner Page shifted (4cm,0) -- ulcorner Page shifted (4cm,0) -- cycle ; +circular_shade(p[1],0,\MPcolor{a},\MPcolor{b}) ; +numeric a; a = 2*NOfPages-1 ; +numeric c; c = PaperHeight/a ; +for i = 1 step 2 until a: + p[i] := unitsquare xyscaled (0.5cm,0.5cm) ; + fill p[i] shifted (0.75cm,c*i) withcolor \MPcolor{a} ; + if i=(2*PageNumber-3): + fill p[i] shifted (0.75cm,c*i) withcolor \MPcolor{c} ; + fi ; +endfor ; +p[3] := ulcorner Field[Text][Text] -- urcorner Page -- lrcorner Page -- llcorner Field[Text][Text] -- cycle ; +p[3] := p[3] enlarged (.4cm,.4cm) ; +linear_shade(p[3],6,\MPcolor{a},\MPcolor{b}) ; +StopPage ; +\stopuseMPgraphic + +%D We define these backgrounds as overlays: + +\defineoverlay +[lecbackground] +[\useMPgraphic{LinearShade}] + +%D These are shortcuts to switch backgrounds: + +\define\lecback{\setupbackgrounds[page][background=lecbackground]} +\define\titback{\setupbackgrounds[page][background=lecbackground]} +\define\picback{\setupbackgrounds[page][background=lecbackground]} +\define\noback{\setupbackgrounds[page][background=lecbackground]} + +\setupbackgrounds[page][background=lecbackground] + +%D The symbol for the first level of itemizations. + +\definesymbol[1][\useMPgraphic{ItSquare}] +\setupitemize[1][inmargin] + +\protect +\stopmodule + +\endinput + diff --git a/obsolete/macros/context/contrib/context-taspresent/tex/context/third/taspresent/t-embossed.tex b/obsolete/macros/context/contrib/context-taspresent/tex/context/third/taspresent/t-embossed.tex new file mode 100644 index 0000000000..efeb9aab5e --- /dev/null +++ b/obsolete/macros/context/contrib/context-taspresent/tex/context/third/taspresent/t-embossed.tex @@ -0,0 +1,154 @@ +%D \module +%D [ file=t-embossed, +%D version=2007.07.17, +%D title=\CONTEXT\ Style File, +%D subtitle=Presentation Module embossed, +%D author=Thomas A. Schmitz, +%D date=\currentdate, +%D copyright={Thomas A. Schmitz}] +%C +%C Copyright 2007 Thomas A. Schmitz. +%C This file may be distributed under the GNU General Public License v. 2.0. + +%D This file provides the \quotation{embossed} style for the presentation +%D module. It is loaded at runtime. + +\writestatus{loading}{module embossed} + +\startmodule[embossed] + +\unprotect + +%D The taspresentation module provides a skeleton into which different styles +%D can be hooked. It uses a number of variables and macros which have to be set +%D beforehand. Some parts are optional. We begin with the necessary definitions: + +%D We start colors: + +\setupcolors[state=start] + +%D These macros are used for placing figures/pictures: + +\define\NormalHeight{.94\textheight} +\define\NormalWidth{.476\textwidth} +\define\PictureFrameHeight{.94\textheight} +\define\PictureFrameWidth{.476\textwidth} + +%D The page layout: + +\setuplayout [width=fit, + margin=1.3cm, + height=fit, + header=1cm, + footer=1cm, + topspace=10mm, + backspace=2cm, + location=singlesided] + +%D The macro for typesetting the Slidetitle; this is adapted from a sample +%D document that Brooks Moses published on the wiki: + +\definelayer[slidetitle] + [width=\paperwidth, + height=\paperheight, + x=20mm, + y=2mm] + +\define[1]\Slidetitle{\page\setlayer[slidetitle]% + {\framed[frame=off,height=2cm,width=\textwidth,offset=0pt,align=middle,top=\vss,bottom=\vss]{\switchtobodyfont[\Titlesize]\color[e]{#1}}}} + +%D The macro \tex{Maketitle} produces a default title page with the author, the +%D title of the presentation, and the date. Using it is not mandatory. + +\define\Maketitle{% +\titback +\null +\vfill +\midaligned{\switchtobodyfont[\Titlesize]\color[e]{\getvariable{taspresent}{title}}} +\blank[2*line] +\midaligned{\getvariable{taspresent}{author}} +\blank[3*line] +\midaligned{\currentdate} +\vfill +\null} + +%D The following parts are optional; if you don't use backgrounds and are +%D content with CONTEXT's default itemization, you don't have to set these +%D macros. + +%D We define our colors: + +\definecolor [a] [r=1,g=1,b=.8] +\definecolor [Item] [r=.2,b=.2,b=.5] +\definecolor [b] [r=.6,g=.2,b=.2] +\definecolor [c] [r=.7,g=.2,b=.2] +\definecolor [d] [r=.4,g=.2,b=.2] +\definecolor [e] [r=.2,g=.2,b=.5] +\definecolor [f] [s=.4] + +\beginOLDTEX +\definefontsynonym [BigBoss] [uhvb8r] +\definefont[Emblem] [BigBoss at 30pt] +\endOLDTEX + +\beginLUATEX +\definefontsynonym [BigBoss] [name:TeXGyreHeros-Bold] +\definefont[Emblem] [BigBoss at 30pt] +\endLUATEX + +%D However, it seemed more portable to let Metapost calculate the background. +%D The rainbow effect takes some lines of code, but it's not too bad: + +\startuseMPgraphic{redyellow} +StartPage ; +picture boss ; +picture bboss ; +pair zf[] ; +fill Page withcolor \MPcolor{a} ; +path gr[] ; +numeric a; a = 2cm ; +numeric b; b = 0.9cm ; +z.f1 = llcorner Page shifted (0,a) ; +z.f2 = lrcorner Page shifted (0,a) ; +gr[1] = llcorner Page -- z.f1 -- z.f2 -- lrcorner Page -- cycle ; +fill gr[1] withcolor \MPcolor{b} ; +pickup pencircle scaled 6pt ; +gr[2] = ulcorner Page -- urcorner Page -- lrcorner Page -- llcorner Page -- cycle ; +gr[2] := gr[2] enlarged -2.8.pt ; +draw gr[2] withcolor \MPcolor{f} ; +draw z.f1 -- z.f2 withcolor \MPcolor{f} ; +boss := \sometxt{\framed[width=\textwidth,height=2cm,offset=0pt,align=right,top=\vss,bottom=\vss,frame=off]{\Emblem \color[c]{Made with \CONTEXT\hfill \pagenumber\ of \lastpage}}} ; +bboss := \sometxt{\framed[width=\textwidth,height=2cm,offset=0pt,align=right,top=\vss,bottom=\vss,frame=off]{\strut\Emblem \color[d]{Made with \CONTEXT\hfill \pagenumber\ of \lastpage}}} ; +draw bboss shifted (1.96cm,0.04cm) ; +draw boss shifted (2cm,0) ; +StopPage ; +\stopuseMPgraphic + + +%D We define these backgrounds as overlays: + +\defineoverlay[yellowbg] +[\useMPgraphic{redyellow}] + +%D These are shortcuts to switch backgrounds: + +\define\lecback{\setuplayout[header=10mm]\setupbackgrounds[page][background={yellowbg,slidetitle}]} +\define\titback{\setuplayout[header=0mm]\setupbackgrounds[page][background={yellowbg}]} +\define\picback{\setuplayout[header=0mm]\setupbackgrounds[page][background={yellowbg}]} +\define\noback{\setupbackgrounds[page][background=nobackground]} + +%D We use combinations for placing vertical pictures and text side by side, and +%D we want a distance of 1.1 cm between both. + +\setupcombinations[distance=1.1cm] + +%D The symbol for the first level of itemizations. + +\definesymbol[1][\useMPgraphic{ItSquare}] +\setupitemize[1][inmargin][color=e] + +\protect +\stopmodule + +\endinput + diff --git a/obsolete/macros/context/contrib/context-taspresent/tex/context/third/taspresent/t-graybeams.tex b/obsolete/macros/context/contrib/context-taspresent/tex/context/third/taspresent/t-graybeams.tex new file mode 100644 index 0000000000..1388cc9335 --- /dev/null +++ b/obsolete/macros/context/contrib/context-taspresent/tex/context/third/taspresent/t-graybeams.tex @@ -0,0 +1,172 @@ +%D \module +%D [ file=t-graybeams, +%D version=2007.07.17, +%D title=\CONTEXT\ Style File, +%D subtitle=Presentation Module graybeams, +%D author=Thomas A. Schmitz, +%D date=\currentdate, +%D copyright={Thomas A. Schmitz}] +%C +%C Copyright 2007 Thomas A. Schmitz. +%C This file may be distributed under the GNU General Public License v. 2.0. + +%D This file provides the \quotation{graybeams} style for the presentation +%D module. It is loaded at runtime. The look of this style was inspired by the +%D \quotation{Copenhagen} theme of the \LaTeX\ {\tt beamer} package. + +\writestatus{loading}{module graybeams} + +\startmodule[graybeams] + +\unprotect + +%D The taspresentation module provides a skeleton into which different styles +%D can be hooked. It uses a number of variables and macros which have to be set +%D beforehand. Some parts are optional. We begin with the necessary definitions: + +%D We start colors: + +\setupcolors[state=start] + +%D These macros are used for placing figures/pictures: + +\define\NormalHeight{.97\textheight} +\define\NormalWidth{.476\textwidth} +\define\PictureFrameHeight{.97\textheight} +\define\PictureFrameWidth{.476\textwidth} + +%D The page layout: + +\setuplayout [width=fit, + margin=0cm, + height=14.7cm, + header=1.75cm, + footer=1.5cm, + topspace=1cm, + backspace=1cm, + location=singlesided] + +%D The macro for typesetting the Slidetitle; this is adapted from a sample +%D document that Brooks Moses published on the wiki: + +\definelayer[slidetitle] + [width=\paperwidth, + height=\paperheight, + x=10mm] + +\define[1]\Slidetitle{\page\setlayer[slidetitle]% + {\framed[frame=off,width=\textwidth,height=2.25cm,offset=0pt,top=\vss,bottom=\vss]{\switchtobodyfont[\Titlesize]\color[c]{#1}}}} + +%D The macro \tex{Maketitle} produces a default title page with the author, the +%D title of the presentation, and the date. Using it is not mandatory. + +\define\Maketitle{% +\titback +\null +\vfill +\framed[frame=off,width=\textwidth,height=.75\textheight,top=\vss,bottom=\vss,align=middle]{\switchtobodyfont[\Titlesize]\color[c]{\getvariable{taspresent}{title}}\switchtobodyfont[\Normalsize]\blank[line]\color[c]{\getvariable{taspresent}{author}\blank[2*line]\currentdate}} +\vfill +\null} + +%D The following parts are optional; if you don't use backgrounds and are +%D content with CONTEXT's default itemization, you don't have to set these +%D macros. + +%D We define our colors: + +\definecolor [a] [s=.97] +\definecolor [b] [s=.88] +\definecolor [c] [r=.75] +\definecolor [Item] [r=.75] + +%D We let Metapost calculate the background: + +\startuniqueMPgraphic{beams} +StartPage ; +pair zd[] ; +path pb[] ; +numeric a; a=2.1cm ; +numeric b; b=1.5cm ; +fill Page withcolor \MPcolor{a} ; +z.d1 = llcorner Page shifted (0,2*a) ; +z.d2 = z.d1 shifted (0,2*a) ; +z.d3 = lrcorner Page shifted (0,b) ; +z.d4 = z.d3 shifted (0,b) ; +z.d5 = z.d2 shifted (0,b) ; +z.d6 = ulcorner Page shifted (.1cm,0) ; +z.d7 = z.d4 shifted (0,b/2) ; +z.d8 = z.d7 shifted (0,b) ; +z.d9 = ulcorner Page shifted (.1cm+a,0) ; +z.d10 = z.d9 shifted (3*a,0) ; +z.d11 = z.d8 shifted (0,b/2) ; +z.d12 = z.d11 shifted (0,b) ; +z.d13 = z.d10 shifted (a,0) ; +z.d14 = z.d13 shifted (3*a,0) ; +z.d15 = z.d12 shifted (0,b/2) ; +z.d16 = z.d15 shifted (0,b) ; +z.d17 = llcorner Page shifted (0,b) ; +pb[1] = z.d1 -- z.d2 -- z.d4 -- z.d3 -- cycle ; +fill pb[1] withcolor \MPcolor{b} ; +pb[2] = z.d5 -- ulcorner Page -- z.d6 -- z.d8 -- z.d7 -- cycle ; +fill pb[2] withcolor \MPcolor{b} ; +pb[3] = z.d9 -- z.d10 -- z.d12 -- z.d11 -- cycle ; +fill pb[3] withcolor \MPcolor{b} ; +pb[4] = z.d13 -- z.d14 -- z.d16 -- z.d15 -- cycle ; +fill pb[4] withcolor \MPcolor{b} ; +pb[5] = llcorner Page -- z.d17 -- z.d3 -- lrcorner Page -- cycle ; +fill pb[5] withcolor \MPcolor{c} ; +StopPage ; +\stopuniqueMPgraphic + +\startuniqueMPgraphic{redstripes} +StartPage ; +path pb[] ; +numeric b; b=1.5cm ; +z.d18 = ulcorner Page shifted (0,-1.5*b) ; +z.d19 = z.d18 shifted (0,-1pt) ; +z.d20 = urcorner Page shifted (0,-1.5*b) ; +z.d21 = z.d20 shifted (0,-1pt) ; +pb[6] = z.d18 -- z.d19 -- z.d21 -- z.d20 -- cycle ; +linear_shade(pb[6],0,\MPcolor{c},\MPcolor{a}) ; +pb[7] = pb[6] shifted (0,-3pt) ; +linear_shade(pb[7],0,\MPcolor{c},\MPcolor{a}) ; +StopPage ; +\stopuniqueMPgraphic + +%D We define these backgrounds as overlays: + +\defineoverlay +[lecbackground] +[\useMPgraphic{redstripes}] + +\defineoverlay +[picbackground] +[\useMPgraphic{beams}] + +%D We define the footer + +\setupfooter[color=a,style={\switchtobodyfont[10pt]},strut=yes] +\setupfootertexts[{\framed[frame=off,height=1cm,width=\textwidth]{\getvariable{taspresent}{title}\hfill \pagenumber\ of \lastpage}}] + +%D These are shortcuts to switch backgrounds: + +\define\lecback{\setuplayout[header=1.75cm]\setupfooter[state=start]\setupbackgrounds[page][background={picbackground,lecbackground,slidetitle}]} +\define\titback{\setuplayout[header=1.75cm]\setupfooter[state=stop]\setupbackgrounds[page][background={picbackground,lecbackground}]} +\define\picback{\setuplayout[header=0cm]\setupfooter[state=start]\setupbackgrounds[page][background={picbackground}]} +\define\noback{\setupbackgrounds[page][background=nobackground]} + +%D We use combinations for placing vertical pictures and text side by side, and +%D we want a distance of 1.1 cm between both. + +\setupcombinations[distance=1.1cm] + +%D The symbol for the first level of itemizations. + +\definesymbol[1][\useMPgraphic{ItSquare}] +\setupitemize[1][color=c] + +\protect +\stopmodule + +\endinput + diff --git a/obsolete/macros/context/contrib/context-taspresent/tex/context/third/taspresent/t-graysquare.tex b/obsolete/macros/context/contrib/context-taspresent/tex/context/third/taspresent/t-graysquare.tex new file mode 100644 index 0000000000..e02fd0a1af --- /dev/null +++ b/obsolete/macros/context/contrib/context-taspresent/tex/context/third/taspresent/t-graysquare.tex @@ -0,0 +1,145 @@ +%D \module +%D [ file=t-graysquare, +%D version=2007.07.17, +%D title=\CONTEXT\ Style File, +%D subtitle=Presentation Module graysquare, +%D author=Thomas A. Schmitz, +%D date=\currentdate, +%D copyright={Thomas A. Schmitz}] +%C +%C Copyright 2007 Thomas A. Schmitz. +%C This file may be distributed under the GNU General Public License v. 2.0. + +%D This file provides the \quotation{graysquare} style for the presentation +%D module. It is loaded at runtime. This minimalistic design is inspired by a +%D presentation Taco gave at EuroTeX 2006. + +\writestatus{loading}{module graysquare} + +\startmodule[graysquare] + +\unprotect + +%D The taspresentation module provides a skeleton into which different styles +%D can be hooked. It uses a number of variables and macros which have to be set +%D beforehand. Some parts are optional. We begin with the necessary definitions: + +%D We define our colors: + +\definecolor [a] [r=.95,g=.95,b=.95] +\definecolor [b] [r=.7,g=.1,b=.3] +\definecolor [c] [s=.3] +\definecolor [Item] [r=.7,g=.1,b=.3] + +%D We start colors: + +\setupcolors[state=start] + +%D These macros are used for placing figures/pictures: + +\define\NormalHeight{\textheight} +\define\NormalWidth{.5\textwidth} +\define\PictureFrameHeight{\textheight} +\define\PictureFrameWidth{.5\textwidth} + +%D The page layout: + +\setuplayout [width=fit, + height=middle, + margin=0cm, + height=fit, + margindistance=0cm, + header=0cm, + footer=0cm, + topspace=2cm, + backspace=1.5cm, + location=singlesided] + +%D The macro for typesetting the Slidetitle; this is adapted from a sample +%D document that Brooks Moses published on the wiki: + +\definelayer[slidetitle] + [width=\paperwidth, + height=\paperheight, + x=15mm] + +\define[1]\Slidetitle{\page\setlayer[slidetitle]% + {\framed[framecolor=red,frame=off,width=\textwidth,height=3cm,offset=0pt,top=\vss,bottom=\vss,align=left]{\switchtobodyfont[\Titlesize]\color[b]{#1}}}} + +%D The macro \tex{Maketitle} produces a default title page with the author, the +%D title of the presentation, and the date. Using it is not mandatory. + +\define\Maketitle{% +\titback +\null +\vfill +\midaligned{\switchtobodyfont[\Titlesize]\color[b]{\getvariable{taspresent}{title}}} +\blank[2*line] +\midaligned{\color[b]{\getvariable{taspresent}{author}}} +\blank[3*line] +\midaligned{\color[b]{\currentdate}} +\vfill +\null} + +%D The following parts are optional; if you don't use backgrounds and are +%D content with CONTEXT's default itemization, you don't have to set these +%D macros. + +%D We let Metapost calculate the background: + +\startuseMPgraphic{bottom} +StartPage ; +fill Page withcolor \MPcolor{a} ; +z.b1 = llcorner Field[Text][Text] ; +z.b2 = lrcorner Field[Text][Text] ; +path wdt ; +wdt = z.b1 -- z.b2 ; +numeric diff; diff = .3cm ; +numeric arc; arc = arclength (wdt) - diff ; +numeric pages; pages = NOfPages - 1 ; +numeric factor; factor = arc/pages ; +path m[] ; +m[0] = unitsquare xyscaled (diff,diff) shifted (x.b1,0.85cm) ; +fill m[0] withcolor \MPcolor{c} ; +if PageNumber = 1: + fill m[0] xyscaled (0,2) shifted (0,-diff-.85cm) withcolor \MPcolor{b} ; +fi ; +for i = 1 upto pages: + m[i] = m[0] shifted (i*factor,0) ; + fill m[i] withcolor \MPcolor{c} ; + if i+1 = PageNumber: +% fill m[i] withcolor \MPcolor{b} ; + fill m[i] xyscaled (0,2) shifted (0,-diff-.85cm) withcolor \MPcolor{b} ; + fi ; +endfor ; +StopPage ; +\stopuseMPgraphic + +%D We define these backgrounds as overlays: + +\defineoverlay +[lecbackground] +[\useMPgraphic{bottom}] + +%D These are shortcuts to switch backgrounds: + +\define\lecback{\setuplayout[header=1cm]\setupbackgrounds[page][background={lecbackground,slidetitle}]} +\define\titback{\setuplayout[header=0cm]\setupbackgrounds[page][background=lecbackground]} +\define\picback{\setuplayout[header=0cm]\setupbackgrounds[page][background={lecbackground,slidetitle}]} +\define\noback{\setupbackgrounds[page][background=nobackground]} + +%D We use combinations for placing vertical pictures and text side by side, and +%D we want a distance of 1.1 cm between both. + +\setupcombinations[distance=0cm] + +%D The symbol for the first level of itemizations. + +\definesymbol[1][\useMPgraphic{ItSquare}] +\setupitemize[1][color=b] + +\protect +\stopmodule + +\endinput + diff --git a/obsolete/macros/context/contrib/context-taspresent/tex/context/third/taspresent/t-greenblue.tex b/obsolete/macros/context/contrib/context-taspresent/tex/context/third/taspresent/t-greenblue.tex new file mode 100644 index 0000000000..311fe74d71 --- /dev/null +++ b/obsolete/macros/context/contrib/context-taspresent/tex/context/third/taspresent/t-greenblue.tex @@ -0,0 +1,209 @@ +%D \module +%D [ file=t-greenblue, +%D version=2007.07.25, +%D title=\CONTEXT\ Style File, +%D subtitle=Presentation Module greenblue, +%D author=Thomas A. Schmitz, +%D date=\currentdate, +%D copyright={Thomas A. Schmitz}] +%C +%C Copyright 2007 Thomas A. Schmitz. +%C This file may be distributed under the GNU General Public License v. 2.0. + +%D This file provides the \quotation{greenblue} style for the presentation +%D module. It is loaded at runtime. The theme for this style is inspired by the +%D \quotation{Berkeley} theme of the \LaTeX\ Beamer package. + +\writestatus{loading}{module greenblue} + +\startmodule[greenblue] + +\unprotect + +%D The taspresentation module provides a skeleton into which different styles +%D can be hooked. It uses a number of variables and macros which have to be set +%D beforehand. Some parts are optional. We begin with the necessary definitions: + +%D We define our colors: + +\definecolor [Item] [r=.09,g=.2,b=.41] +\definecolor [a] [s=.95] +\definecolor [b] [r=.58,g=.81,b=.58] +\definecolor [c] [r=.09,g=.2,b=.41] +\definecolor [d] [r=.04,g=.4,b=.4] + +%D We start colors; textcolor is white: + +\setupcolors[state=start,textcolor=c] + +%D These macros are used for placing figures/pictures: + +\define\NormalHeight{\textheight} +\define\NormalWidth{.476\textwidth} +\define\PictureFrameHeight{\textheight} +\define\PictureFrameWidth{.476\textwidth} + +%D The page layout: + +\setuplayout [width=fit, + leftmargin=1.5cm, + rightmargin=0cm, + leftmargindistance=1.2cm, + rightmargindistance=0pt, + height=fit, + header=5.3cm, + footer=0cm, + topspace=.4cm, + backspace=2.5cm, + cutspace=3.2cm, + bottomspace=0cm, + bottom=0pt, + location=singlesided] + +%D The macro for typesetting the Slidetitle; this is adapted from a sample +%D document that Brooks Moses published on the wiki: + +\definelayer[slidetitle] + [width=\paperwidth, + height=\paperheight, + x=25mm, + y=25mm] + +\define[1]\Slidetitle{\page\setlayer[slidetitle]% + {\framed[frame=off,width=\textwidth,height=2cm,offset=0pt,align=right,top=\vss,bottom=\vss]{\switchtobodyfont[\Titlesize]\color[d]{\bf #1}}}} + +%D The macro \tex{Maketitle} produces a default title page with the author, the +%D title of the presentation, and the date. Using it is not mandatory. + +\definelayer[prestitle] + [width=\paperwidth, + height=\paperheight, + y=30mm] + +\definelayer[presauthor] + [width=.5\paperwidth, + height=.5\paperheight, + x=104mm, + y=118mm] + +\define\Maketitle{% +\titback\null +\setlayer[prestitle]% +{\framed[frame=off,width=\paperwidth,height=4cm,offset=0pt,align=middle,top=\vss,bottom=\vss]{\switchtobodyfont[\Titlesize]\color[c]{\bf \getvariable{taspresent}{title}}}} +\setlayer[presauthor]% +{\framed[frame=off,width=.5\paperwidth,height=4cm,offset=0pt,align=middle,top=\vss,bottom=\vss]{\switchtobodyfont[\Normalsize]\color[c]{\getvariable{taspresent}{author}}}}} + +%D The following parts are optional; if you don't use backgrounds and are +%D content with CONTEXT's default itemization, you don't have to set these +%D macros. + +%D We let Metapost calculate the background: + +\startuseMPgraphic{greenframe} +StartPage ; +fill Page withcolor \MPcolor{a} ; +numeric a ; a = 2cm ; +numeric b ; b = 0.7cm ; +numeric c ; c = 6cm ; +numeric d ; d = .7cm ; +pair zc[] ; +zc1 = llcorner Page shifted (a,0) ; +zc2 = ulcorner Page shifted (a,-a-b) ; +zc3 = ulcorner Page shifted (a+b/4,-a-b/4) ; +zc4 = ulcorner Page shifted (a+b,-a) ; +zc5 = urcorner Page shifted (0,-a) ; +zc6 = ulcorner Page shifted (c,0) ; +zc7 = ulcorner Page shifted (c,-a) ; +path pa[] ; +pa[1] = llcorner Page -- zc1 -- zc2 .. zc3 .. zc4 -- zc7 -- zc6 -- ulcorner Page -- cycle ; +fill pa[1] withcolor \MPcolor{b} ; +draw \sometxt{\framed[frame=off,width=2cm,height=2cm]{\color[a]{\pagenumber}}} ; +StopPage ; +\stopuseMPgraphic + +\startuniqueMPgraphic{bluebeam} +StartPage ; +numeric a ; a = 2cm ; +numeric b ; b = 0.7cm ; +numeric c ; c = 6cm ; +numeric d ; d = .7cm ; +pair zc[] ; +zc8 = ulcorner Page shifted (a/2,-2.2*a) ; +zc9 = zc8 shifted (0,-d) ; +zc10 = urcorner Page shifted (-a,-2.2*a-d) ; +zc11 = zc10 shifted (0,d) ; +zc12 = zc8 shifted (-d/2,-d/2) ; +path pa[] ; +pa[3] = zc8 .. zc12 .. zc9 -- zc10 -- zc11 -- cycle ; +fill pa[3] withcolor \MPcolor{c} ; +StopPage ; +\stopuniqueMPgraphic + +\startuniqueMPgraphic{Titlebg} +StartPage ; +numeric a ; a = 4cm ; +numeric b ; b = 3cm ; +numeric c ; c = 8cm ; +numeric d ; d = .7cm ; +path pa[] ; +pair zc [] ; +fill Page withcolor \MPcolor{a} ; +pa[1] = ulcorner Page -- ulcorner Page shifted (PaperWidth/2,0) -- llcorner Page shifted (PaperWidth/2,0) -- llcorner Page -- cycle ; +fill pa[1] withcolor \MPcolor{b} ; +zc1 = ulcorner Page shifted (PaperWidth/2,-b) ; +zc2 = zc1 shifted (-c,0) ; +zc3 = zc2 shifted (0,-a) ; +zc4 = zc3 shifted (c,0) ; +zc5 = zc2 shifted (-1.5cm,-a/2) ; +pa[2] = zc1 -- zc2 .. zc5 .. zc3 -- zc4 -- cycle ; +fill pa[2] withcolor \MPcolor{a} ; +zc6 = llcorner Page shifted (PaperWidth/2,0) ; +zc7 = 1/2[zc6,zc4] ; +zc8 = zc7 shifted (-.75*b,d/2) ; +zc9 = zc8 shifted (0,-d) ; +zc10 = zc9 shifted (1.3*c,0) ; +zc11 = zc10 shifted (0,d) ; +zc12 = zc10 shifted (d/2,d/2) ; +pa[3] = zc8 -- zc9 -- zc10 .. zc12 .. zc11 -- cycle ; +fill pa[3] withcolor \MPcolor{c} ; +StopPage ; +\stopuniqueMPgraphic + +%D We define these backgrounds as overlays: + +\defineoverlay +[picbackground] +[\useMPgraphic{greenframe}] + +\defineoverlay +[lecbackground] +[\useMPgraphic{bluebeam}] + +\defineoverlay +[titlebackground] +[\useMPgraphic{Titlebg}] + +%D We use combinations for placing vertical pictures and text side by side, and +%D we want a distance of 1.1 cm between both. + +\setupcombinations[distance=1.1cm] + +%D These are shortcuts to switch backgrounds: + +\define\lecback{\setuplayout[header=5.3cm]\setupbackgrounds[page][background={picbackground,lecbackground,slidetitle}]} +\define\titback{\setuplayout[header=2.3cm]\setupbackgrounds[page][background={titlebackground,prestitle,presauthor}]} +\define\picback{\setuplayout[header=2.3cm]\setupbackgrounds[page][background=picbackground]} +\define\noback{\setupbackgrounds[page][background=nobackground]} + +\setupbackgrounds[page][background=lecbackground] + +%D The symbol for the first level of itemizations. + +\definesymbol[1][\useMPgraphic{ItSquare}] +\setupitemize[1][inmargin][color=c] + +\protect +\stopmodule + +\endinput + diff --git a/obsolete/macros/context/contrib/context-taspresent/tex/context/third/taspresent/t-horizontalblue.tex b/obsolete/macros/context/contrib/context-taspresent/tex/context/third/taspresent/t-horizontalblue.tex new file mode 100644 index 0000000000..f586e05829 --- /dev/null +++ b/obsolete/macros/context/contrib/context-taspresent/tex/context/third/taspresent/t-horizontalblue.tex @@ -0,0 +1,150 @@ +%D \module +%D [ file=t-horizontalblue, +%D version=2007.07.17, +%D title=\CONTEXT\ Style File, +%D subtitle=Presentation Module horizontalblue, +%D author=Thomas A. Schmitz, +%D date=\currentdate, +%D copyright={Thomas A. Schmitz}] +%C +%C Copyright 2007 Thomas A. Schmitz. +%C This file may be distributed under the GNU General Public License v. 2.0. + +%D This file provides the \quotation{horizontalblue} style for the presentation +%D module. It is loaded at runtime. The look of this style was inspired by the +%D \quotation{Copenhagen} theme of the \LaTeX\ {\tt beamer} package. + +\writestatus{loading}{module horizontalblue} + +\startmodule[horizontalblue] + +\unprotect + +%D The taspresentation module provides a skeleton into which different styles +%D can be hooked. It uses a number of variables and macros which have to be set +%D beforehand. Some parts are optional. We begin with the necessary definitions: + +%D We start colors: + +\setupcolors[state=start] + +%D These macros are used for placing figures/pictures: + +\define\NormalHeight{.97\textheight} +\define\NormalWidth{.476\textwidth} +\define\PictureFrameHeight{.97\textheight} +\define\PictureFrameWidth{.476\textwidth} + +%D The page layout: + +\setuplayout [width=fit, + margin=0cm, + height=14.7cm, + header=1.75cm, + footer=1.2cm, + topspace=1cm, + backspace=1cm, + location=singlesided] + +%D The macro for typesetting the Slidetitle; this is adapted from a sample +%D document that Brooks Moses published on the wiki: + +\definelayer[slidetitle] + [width=\paperwidth, + height=\paperheight, + x=10mm] + +\define[1]\Slidetitle{\page\setlayer[slidetitle]% + {\framed[frame=off,width=\textwidth,height=2.2cm,offset=0pt,top=\vss,bottom=\vss]{\switchtobodyfont[\Titlesize]\color[c]{#1}}}} + +%D The macro \tex{Maketitle} produces a default title page with the author, the +%D title of the presentation, and the date. Using it is not mandatory. + +\define\Maketitle{% +\titback +\null +\vfill +\framed[frame=off,width=\textwidth,height=.75\textheight,top=\vss,bottom=\vss,align=middle]{\switchtobodyfont[\Titlesize]\color[c]{\bf \getvariable{taspresent}{title}}\switchtobodyfont[\Normalsize]\blank[line]\getvariable{taspresent}{author}\blank[2*line]\currentdate} +\vfill +\null} + +%D The following parts are optional; if you don't use backgrounds and are +%D content with CONTEXT's default itemization, you don't have to set these +%D macros. + +%D We define our colors: + +\definecolor [a] [s=.95] +\definecolor [b] [r=.58,g=.58,b=.82] +\definecolor [c] [r=.2,g=.2,b=.73] +\definecolor [Item] [r=.2,g=.2,b=.73] + +%D We let Metapost calculate the background: + +\startuniqueMPgraphic{vertical} +StartPage ; +pair zd[] ; +path pb[] ; +fill Page withcolor \MPcolor{a} ; +z.d1 = ulcorner Page shifted (0,-5pt) ; +z.d2 = urcorner Page shifted (0,-5pt) ; +pb[1] = ulcorner Page -- z.d1 -- z.d2 -- urcorner Page -- cycle ; +z.d3 = llcorner Page shifted (0,5pt) ; +z.d4 = lrcorner Page shifted (0,5pt) ; +pb[3] = llcorner Page -- z.d3 -- z.d4 -- lrcorner Page -- cycle ; +pb[4] = pb[3] shifted (0,.75cm) ; +fill pb[1] withcolor \MPcolor{b} ; +fill pb[3] withcolor \MPcolor{b} ; +fill pb[4] withcolor \MPcolor{b} ; +StopPage ; +\stopuniqueMPgraphic + +\startuniqueMPgraphic{horizontal} +StartPage ; +pair zd[] ; +path pb[] ; +z.d1 = ulcorner Page shifted (0,-5pt) ; +z.d2 = urcorner Page shifted (0,-5pt) ; +pb[1] = ulcorner Page -- z.d1 -- z.d2 -- urcorner Page -- cycle ; +pb[2] = pb[1] shifted (0,-2cm) ; +fill pb[2] withcolor \MPcolor{b} ; +StopPage ; +\stopuniqueMPgraphic + +%D We define these backgrounds as overlays: + +\defineoverlay +[lecbackground] +[\useMPgraphic{horizontal}] + +\defineoverlay +[picbackground] +[\useMPgraphic{vertical}] + +%D We define the footer + +\setupfooter[color=c,style={\switchtobodyfont[10pt]},strut=yes] +\setupfootertexts[{\framed[frame=off,height=.45cm,width=\textwidth]{\getvariable{taspresent}{title}\hfill \pagenumber \ of \lastpage}}] + +%D These are shortcuts to switch backgrounds: + +\define\lecback{\setuplayout[header=1.75cm]\setupfooter[state=start]\setupbackgrounds[page][background={picbackground,lecbackground,slidetitle}]} +\define\titback{\setuplayout[header=1.75cm]\setupfooter[state=stop]\setupbackgrounds[page][background={picbackground,lecbackground}]} +\define\picback{\setuplayout[header=0cm]\setupfooter[state=start]\setupbackgrounds[page][background={picbackground}]} +\define\noback{\setupbackgrounds[page][background=nobackground]} + +%D We use combinations for placing vertical pictures and text side by side, and +%D we want a distance of 1.1 cm between both. + +\setupcombinations[distance=1.1cm] + +%D The symbol for the first level of itemizations. + +\definesymbol[1][\useMPgraphic{ItSquare}] +\setupitemize[1][color=c] + +\protect +\stopmodule + +\endinput + diff --git a/obsolete/macros/context/contrib/context-taspresent/tex/context/third/taspresent/t-lightblue.tex b/obsolete/macros/context/contrib/context-taspresent/tex/context/third/taspresent/t-lightblue.tex new file mode 100644 index 0000000000..2a5499a413 --- /dev/null +++ b/obsolete/macros/context/contrib/context-taspresent/tex/context/third/taspresent/t-lightblue.tex @@ -0,0 +1,162 @@ +%D \module +%D [ file=t-lightblue, +%D version=2007.07.17, +%D title=\CONTEXT\ Style File, +%D subtitle=Presentation Module lightblue, +%D author=Thomas A. Schmitz, +%D date=\currentdate, +%D copyright={Thomas A. Schmitz}] +%C +%C Copyright 2007 Thomas A. Schmitz. +%C This file may be distributed under the GNU General Public License v. 2.0. + +%D This file provides the \quotation{lightblue} style for the presentation +%D module. It is loaded at runtime. + +\writestatus{loading}{module lightblue} + +\startmodule[lightblue] + +\unprotect + +%D The taspresentation module provides a skeleton into which different styles +%D can be hooked. It uses a number of variables and macros which have to be set +%D beforehand. Some parts are optional. We begin with the necessary definitions: + +%D We start colors; textcolor is white: + +\setupcolors[state=start] + +%D These macros are used for placing figures/pictures: + +\define\NormalHeight{\textheight} +\define\NormalWidth{.476\textwidth} +\define\PictureFrameHeight{\textheight} +\define\PictureFrameWidth{.476\textwidth} + +%D The page layout: + +\setuplayout [width=fit, + leftmargin=.5cm, + rightmargin=0cm, + leftmargindistance=1.5cm, + rightmargindistance=0pt, + height=fit, + header=2.5cm, + footer=0cm, + topspace=.2cm, + backspace=2.6cm, + cutspace=2.9cm, + bottomspace=.2cm, + bottomdistance=1.2cm, + bottom=1.2cm, + location=singlesided] + +%D We define our colors: + +\definecolor [Item] [r=0,g=.2,b=.4] +\definecolor [a] [r=.58,g=.84,b=.97] +\definecolor [b] [r=1,g=1,b=1] +\definecolor [c] [r=0,g=.2,b=.4] +\definecolor [d] [r=1,g=.6,b=0] + +%D The macro for typesetting the Slidetitle; this is adapted from a sample +%D document that Brooks Moses published on the wiki: + +\definelayer[slidetitle] + [width=\paperwidth, + height=\paperheight, + x=2mm, + y=2mm] + +\define[1]\Slidetitle{% +\page\setupheadertexts[{\framed[frame=off,background=color,backgroundcolor=c,height=1.2cm,offset=3pt,top=\vss,bottom=\vss]{\switchtobodyfont[\Titlesize]\color[d]{#1}}}]\setupheader[state=start]} + +\setupbottomtexts[{\framed[frame=off,background=color,backgroundcolor=c,height=1.2cm,offset=3pt,top=\vss,bottom=\vss]{\color[d]{\pagenumber}}}] + +\setupbottom[state=start] + +%D The macro \tex{Maketitle} produces a default title page with the author, the +%D title of the presentation, and the date. Using it is not mandatory. + +\define\Maketitle{% +\titback +\null +\vfill +\midaligned{\framed[frame=off,background=color,backgroundcolor=c,height=1.2cm,offset=3pt,top=\vss,bottom=\vss]{\switchtobodyfont[\Titlesize]\color[d]{\getvariable{taspresent}{title}}}} +\blank[2*line] +\midaligned{\color[c]{\getvariable{taspresent}{author}}} +\blank[3*line] +\midaligned{\color[c]{\currentdate}} +\vfill +\null} + +%D The following parts are optional; if you don't use backgrounds and are +%D content with CONTEXT's default itemization, you don't have to set these +%D macros. + +%D We let Metapost calculate the background: + +\startuniqueMPgraphic{blue1} +StartPage ; +numeric a ; +numeric b ; +numeric c ; +pair zk[] ; +path bl[] ; +a = 2cm ; +b = .7cm ; +c = .2 cm ; +z.k1 = ulcorner Page shifted (a,-a) ; +z.k2 = urcorner Page shifted (0,-a) ; +z.k3 = llcorner Page shifted (a,a) ; +z.k4 = lrcorner Page shifted (0,a) ; +z.k5 = z.k1 shifted (c,-c) ; +z.k6 = z.k2 shifted (0,-c) ; +z.k7 = z.k6 shifted (0,b) ; +z.k8 = z.k5 shifted (-b,b) ; +z.k9 = z.k3 shifted (c,c) ; +z.k10 = z.k4 shifted (0,c) ; +z.k11 = z.k10 shifted (0,-b) ; +z.k12 = z.k9 shifted (-b,-b) ; +bl[1] = urcorner Page -- ulcorner Page -- llcorner Page -- lrcorner Page -- z.k4 -- z.k3 -- z.k1 -- z.k2 -- cycle ; +bl[2] = z.k5 -- z.k6 -- z.k7 -- z.k8 -- cycle ; +bl[3] = z.k9 -- z.k10 -- z.k11 -- z.k12 -- cycle ; +bl[4] = z.k5 -- z.k9 -- z.k12 -- z.k8 --cycle ; +fill bl[1] withcolor \MPcolor{a} ; +linear_shade(bl[2],8,\MPcolor{a},\MPcolor{b}) ; +linear_shade(bl[3],6,\MPcolor{a},\MPcolor{b}) ; +linear_shade(bl[4],5,\MPcolor{a},\MPcolor{b}) ; +StopPage ; +\stopuniqueMPgraphic + +%D We define these backgrounds as overlays: + +\defineoverlay +[lecbackground] +[\useMPgraphic{blue1}] + +%D We use combinations for placing vertical pictures and text side by side, and +%D we want a distance of 1.1 cm between both. + +\setupcombinations[distance=1.1cm] + +%D These are shortcuts to switch backgrounds: + +\define\lecback{\setupbackgrounds[page][background={lecbackground,slidetitle}]} +\define\titback{\setupheader[state=stop]\setupbackgrounds[page][background=lecbackground]} +\define\picback{\setupheader[state=stop]\setupbackgrounds[page][background={lecbackground,slidetitle}]} +\define\noback{\setupbackgrounds[page][background=nobackground]} + +\setupbackgrounds[page][background=lecbackground] + +%D The symbol for the first level of itemizations. + +\definesymbol[1][\useMPgraphic{ItSquare}] +\setupitemize[1][inmargin][color=c] + +\protect +\stopmodule + +\endinput + diff --git a/obsolete/macros/context/contrib/context-taspresent/tex/context/third/taspresent/t-narrowstripe.tex b/obsolete/macros/context/contrib/context-taspresent/tex/context/third/taspresent/t-narrowstripe.tex new file mode 100644 index 0000000000..52ca9d8b41 --- /dev/null +++ b/obsolete/macros/context/contrib/context-taspresent/tex/context/third/taspresent/t-narrowstripe.tex @@ -0,0 +1,188 @@ +%D \module +%D [ file=t-narrowstripe, +%D version=2007.07.25, +%D title=\CONTEXT\ Style File, +%D subtitle=Presentation Module narrowstripe, +%D author=Thomas A. Schmitz, +%D date=\currentdate, +%D copyright={Thomas A. Schmitz}] +%C +%C Copyright 2007 Thomas A. Schmitz. +%C This file may be distributed under the GNU General Public License v. 2.0. + +%D This file provides the \quotation{narrowstripe} style for the presentation +%D module. It is loaded at runtime. The theme for this style is inspired by the +%D \quotation{Berkeley} theme of the \LaTeX\ Beamer package. + +\writestatus{loading}{module narrowstripe} + +\startmodule[narrowstripe] + +\unprotect + +%D The taspresentation module provides a skeleton into which different styles +%D can be hooked. It uses a number of variables and macros which have to be set +%D beforehand. Some parts are optional. We begin with the necessary definitions: + +%D We start colors: + +\setupcolors[state=start] + +%D The narrowframe module has parameters of its own; we set them up and use +%D them: + +\setupmodule[color=blue] + +\processaction[\currentmoduleparameter{color}] + [ red=>\def\colormode{redmode}, + blue=>\def\colormode{bluemode}, + green=>\def\colormode{greenmode}, + \v!unknown=>\def\colormode{bluemode}, + \v!default=>\def\colormode{bluemode}] + +\enablemode[\colormode] + +%D These macros are used for placing figures/pictures: + +\define\NormalHeight{\textheight} +\define\NormalWidth{.476\textwidth} +\define\PictureFrameHeight{\textheight} +\define\PictureFrameWidth{.476\textwidth} + +%D The page layout: + +\setuplayout [width=fit, + leftmargin=1.5cm, + rightmargin=0cm, + leftmargindistance=1.8cm, + rightmargindistance=0pt, + height=fit, + header=2.5cm, + footer=0cm, + topspace=.4cm, + backspace=3.2cm, + cutspace=3.7cm, + bottomspace=0cm, + bottom=0pt, + location=singlesided] + +%D The macro for typesetting the Slidetitle; this is adapted from a sample +%D document that Brooks Moses published on the wiki: + +\definelayer[slidetitle] + [width=\paperwidth, + height=\paperheight, + x=32mm] + +\define[1]\Slidetitle{\page\setlayer[slidetitle]% + {\framed[framecolor=red,frame=off,width=\textwidth,height=2.25cm,offset=0pt,align=middle,top=\vss,bottom=\vss]{\switchtobodyfont[\Titlesize]\color[d]{#1}}}} + +%D The macro \tex{Maketitle} produces a default title page with the author, the +%D title of the presentation, and the date. Using it is not mandatory. + +\define\Maketitle{% +\titback +\null +\vfill +\midaligned{\switchtobodyfont[\Titlesize]\color[d]{\getvariable{taspresent}{title}}} +\blank[2*line] +\midaligned{\color[d]{\getvariable{taspresent}{author}}} +\blank[3*line] +\midaligned{\color[d]{\currentdate}} +\vfill +\null} + +%D The following parts are optional; if you don't use backgrounds and are +%D content with CONTEXT's default itemization, you don't have to set these +%D macros. + +%D We define our colors, depending on the mode: + +\startmode[bluemode] +\definecolor [Item] [b=.8] +\definecolor [a] [s=.95] +\definecolor [b] [r=0,g=0,b=1] +\definecolor [c] [r=.69,g=.69,b=.97] +\definecolor [d] [b=.8] +\stopmode + +\startmode[redmode] +\definecolor [Item] [r=.8] +\definecolor [a] [s=.95] +\definecolor [b] [r=1] +\definecolor [c] [b=.69,g=.69,r=.97] +\definecolor [d] [r=.8] +\stopmode + +\startmode[greenmode] +\definecolor [Item] [g=.4] +\definecolor [a] [s=.95] +\definecolor [b] [g=.4] +\definecolor [c] [b=.68,r=.68,g=.79] +\definecolor [d] [g=.4] +\stopmode + +%D We let Metapost calculate the background: + +\startuseMPgraphic{narrow} +StartPage ; +numeric a ; +numeric b ; +numeric c ; +c = PaperHeight - a/2 ; +pair za[] ; +path p[] ; +a = 2.25cm ; +b = 0.4 cm ; +za1 = ulcorner Page shifted (0,-a) ; +za2 = ulcorner Page shifted (0,-a-b) ; +za3 = urcorner Page shifted (0,-a-b) ; +za4 = urcorner Page shifted (0,-a) ; +za5 = ulcorner Page shifted (a,0) ; +za6 = ulcorner Page shifted (a+b,0) ; +za7 = llcorner Page shifted (a+b,0) ; +za8 = llcorner Page shifted (a,0) ; +za9 = ulcorner Page shifted (a,-a) ; +za10 = ulcorner Page shifted (a+b,-a) ; +za11 = ulcorner Page shifted (a+b,-a-b) ; +za12 = ulcorner Page shifted (a,-a-b) ; +p[1] = za1 -- za2 -- za3 -- za4 -- cycle ; +p[2] = za5 -- za6 -- za7 -- za8 -- cycle ; +p[3] = za9 -- za10 --za11 -- za12 -- cycle ; +linear_shade(p[1],1,\MPcolor{a},\MPcolor{b}) ; +linear_shade(p[2],2,\MPcolor{b},\MPcolor{a}) ; +fill p[3] withcolor \MPcolor{c} ; +draw \sometxt{\framed[frame=off,width=2.25cm,height=2.25cm]{\color[d]{\tfx \folio}}} shifted (0,PaperHeight-a) ; +StopPage ; +\stopuseMPgraphic + +%D We define these backgrounds as overlays: + +\defineoverlay +[lecbackground] +[\useMPgraphic{narrow}] + +%D We use combinations for placing vertical pictures and text side by side, and +%D we want a distance of 1.1 cm between both. + +\setupcombinations[distance=1.1cm] + +%D These are shortcuts to switch backgrounds: + +\define\lecback{\setupbackgrounds[page][background={lecbackground,slidetitle}]} +\define\titback{\setupbackgrounds[page][background=lecbackground]} +\define\picback{\setupbackgrounds[page][background={lecbackground,slidetitle}]} +\define\noback{\setupbackgrounds[page][background=nobackground]} + +\setupbackgrounds[page][background=lecbackground] + +%D The symbol for the first level of itemizations. + +\definesymbol[1][\useMPgraphic{ItSquare}] +\setupitemize[1][inmargin][color=d] + +\protect +\stopmodule + +\endinput + diff --git a/obsolete/macros/context/contrib/context-taspresent/tex/context/third/taspresent/t-quadblue.tex b/obsolete/macros/context/contrib/context-taspresent/tex/context/third/taspresent/t-quadblue.tex new file mode 100644 index 0000000000..4b79b79eb5 --- /dev/null +++ b/obsolete/macros/context/contrib/context-taspresent/tex/context/third/taspresent/t-quadblue.tex @@ -0,0 +1,163 @@ +%D \module +%D [ file=t-quadblue, +%D version=2007.07.17, +%D title=\CONTEXT\ Style File, +%D subtitle=Presentation Module quadblue, +%D author=Thomas A. Schmitz, +%D date=\currentdate, +%D copyright={Thomas A. Schmitz}] +%C +%C Copyright 2007 Thomas A. Schmitz. +%C This file may be distributed under the GNU General Public License v. 2.0. + +%D This file provides the \quotation{quadblue} style for the presentation +%D module. It is loaded at runtime. + +\writestatus{loading}{module quadblue} + +\startmodule[quadblue] + +\unprotect + +%D The taspresentation module provides a skeleton into which different styles +%D can be hooked. It uses a number of variables and macros which have to be set +%D beforehand. Some parts are optional. We begin with the necessary definitions: + +%D We define our colors: + +\definecolor[outer][r=0,g=0,b=.92] +\definecolor[current][r=0,g=0,b=.4] +\definecolor[inner][s=.98] + +%D We start colors: + +\setupcolors[state=start] + +%D These macros are used for placing figures/pictures: + +\define\NormalHeight{\textheight} +\define\NormalWidth{.5\textwidth} +\define\PictureFrameHeight{\textheight} +\define\PictureFrameWidth{.5\textwidth} + +%D The page layout: + +\setuplayout [width=fit, + height=middle, + margin=1.5cm, + height=fit, + leftmargindistance=.4cm, + rightmargindistance=0cm, + header=1.5cm, + footer=0cm, + topspace=1cm, + backspace=2.5cm, + cutspace=1.5cm, + location=singlesided] + +%D The macro for typesetting the Slidetitle; this is adapted from a sample +%D document that Brooks Moses published on the wiki: + +\definelayer[slidetitle] + [width=\paperwidth, + height=\paperheight, + x=25mm] + +\define[1]\Slidetitle{\page\setlayer[slidetitle]% + {\framed[frame=off,width=\textwidth,height=2.5cm,offset=0pt,top=\vss,bottom=\vss]{\switchtobodyfont[\Titlesize]\color[outer]{#1}}}} + +%D The macro \tex{Maketitle} produces a default title page with the author, the +%D title of the presentation, and the date. Using it is not mandatory. + +\define\Maketitle{% +\titback +\null +\vfill +\midaligned{\switchtobodyfont[\Titlesize]\color[outer]{\getvariable{taspresent}{title}}} +\blank[2*line] +\midaligned{\color[outer]{\getvariable{taspresent}{author}}} +\blank[3*line] +\midaligned{\color[outer]{\currentdate}} +\vfill +\null} + +%D The following parts are optional; if you don't use backgrounds and are +%D content with CONTEXT's default itemization, you don't have to set these +%D macros. + +%D We let Metapost calculate the background: + +\startuseMPgraphic{left} +StartPage ; +fill Page withcolor \MPcolor{inner} ; +z1 = ulcorner Page ; +z5 = llcorner Page ; +path q ; +q = z1 -- z5 ; +t := arclength (q) ; +u := t/15 ; +v := (PageNumber/NOfPages) ; +z4 = (x1+1cm, y1-1cm) ; +z3 = (x4, y1) ; +z2 = (x1, y4) ; +path m[] ; +m[1] = z1 -- z2 -- z4 -- z3 -- cycle ; +m[2] = m[1] shifted (0, -2*u) ; +m[3] = m[1] shifted (0, -4*u) ; +m[4] = m[1] shifted (0, -6*u) ; +m[5] = m[1] shifted (0, -8*u) ; +m[6] = m[1] shifted (0, -10*u) ; +m[7] = m[1] shifted (0, -12*u) ; +m[8] = m[1] shifted (0, (-14*u-0.5mm)) ; +for i=1 upto 8: + fill m[i] withcolor\MPcolor{outer} ; +endfor; +if PageNumber=1: + fill m[1] withcolor \MPcolor{current} ; +elseif (v>.001) and (v<.167) : + fill m[2] withcolor \MPcolor{current} ; +elseif (v>.166) and (v<.334): + fill m[3] withcolor \MPcolor{current} ; +elseif (v>.333) and (v<.501): + fill m[4] withcolor \MPcolor{current} ; +elseif (v>.5) and (v<.667): + fill m[5] withcolor \MPcolor{current} ; +elseif (v>.666) and (v<.834): + fill m[6] withcolor \MPcolor{current} ; +elseif (v>.833) and (v<1): + fill m[7] withcolor \MPcolor{current} ; +elseif v=1: + fill m[8] withcolor \MPcolor{current} ; +fi ; +StopPage ; + +\stopuseMPgraphic + +%D We define these backgrounds as overlays: + +\defineoverlay +[lecbackground] +[\useMPgraphic{left}] + +%D These are shortcuts to switch backgrounds: + +\define\lecback{\setuplayout[header=1.5cm]\setupbackgrounds[page][background={lecbackground,slidetitle}]} +\define\titback{\setuplayout[header=0cm]\setupbackgrounds[page][background=lecbackground]} +\define\picback{\setuplayout[header=0cm]\setupbackgrounds[page][background={lecbackground,slidetitle}]} +\define\noback{\setupbackgrounds[page][background=nobackground]} + +%D We use combinations for placing vertical pictures and text side by side, and +%D we want a distance of 1.1 cm between both. + +\setupcombinations[distance=0cm] + +%D The symbol for the first level of itemizations. + +\definesymbol[1][$\square$] +\setupitemize[1][inmargin][color=outer] + +\protect +\stopmodule + +\endinput + diff --git a/obsolete/macros/context/contrib/context-taspresent/tex/context/third/taspresent/t-rainbowstripe.tex b/obsolete/macros/context/contrib/context-taspresent/tex/context/third/taspresent/t-rainbowstripe.tex new file mode 100644 index 0000000000..a139438c9e --- /dev/null +++ b/obsolete/macros/context/contrib/context-taspresent/tex/context/third/taspresent/t-rainbowstripe.tex @@ -0,0 +1,243 @@ +%D \module +%D [ file=t-bluegray, +%D version=2007.07.17, +%D title=\CONTEXT\ Style File, +%D subtitle=Presentation Module bluegray, +%D author=Thomas A. Schmitz, +%D date=\currentdate, +%D copyright={Thomas A. Schmitz}] +%C +%C Copyright 2007 Thomas A. Schmitz. +%C This file may be distributed under the GNU General Public License v. 2.0. + +%D This file provides the \quotation{bluegray} style for the presentation +%D module. It is loaded at runtime. + +\writestatus{loading}{module bluegray} + +\startmodule[bluegray] + +\unprotect + +%D The taspresentation module provides a skeleton into which different styles +%D can be hooked. It uses a number of variables and macros which have to be set +%D beforehand. Some parts are optional. We begin with the necessary definitions: + +%D We start colors: + +\setupcolors[state=start] + +%D These macros are used for placing figures/pictures: + +\define\NormalHeight{\textheight} +\define\NormalWidth{.476\textwidth} +\define\PictureFrameHeight{\textheight} +\define\PictureFrameWidth{.476\textwidth} + +%D The page layout: + +\setuplayout [width=fit, + margin=1.5cm, + height=fit, + header=11mm, + footer=0cm, + topspace=15mm, + backspace=2cm, + location=singlesided] + +%D The macro for typesetting the Slidetitle; this is adapted from a sample +%D document that Brooks Moses published on the wiki: + +\definelayer[slidetitle] + [width=\paperwidth, + height=\paperheight, + x=20mm, + y=12mm] + +\define[1]\Slidetitle{\page\setlayer[slidetitle]% + {\framed[frame=off,height=1.5cm,width=\textwidth,offset=0pt,align=middle,top=\vss,bottom=\vss]{\switchtobodyfont[\Titlesize]#1}}} + +%D The macro \tex{Maketitle} produces a default title page with the author, the +%D title of the presentation, and the date. Using it is not mandatory. + +\define\Maketitle{% +\titback +\null +\vfill +\midaligned{\switchtobodyfont[\Titlesize]\getvariable{taspresent}{title}} +\blank[2*line] +\midaligned{\getvariable{taspresent}{author}} +\blank[3*line] +\midaligned{\currentdate} +\vfill +\null} + +%D The following parts are optional; if you don't use backgrounds and are +%D content with CONTEXT's default itemization, you don't have to set these +%D macros. + +%D We define our colors: + +\definecolor [a] [s=.88] +\definecolor [Item] [s=0] +\definecolor [One] [r=.5,g=0,b=.5] +\definecolor [Two] [b=1] +\definecolor [Three] [g=1,b=1] +\definecolor [Four] [g=1] +\definecolor [Five] [r=1,g=1] +\definecolor [Six] [r=1] + +%D In a first attempt to avhieve the rainbow effect, I produced the rainbow +%D background with asymptote and then converted it to a pdf file which was then +%D used as a background. In that case, it was necessary to instruct \CONTEXT\ +%D to look in the default \TeX\ input paths for figures. The background spans +%D the entire height of the page and the width of the text area; the gray +%D background was then calculated so that the two stripes at the top and at the +%D bottom were left unfilled so the rainbow background would then be visible. +%D Here is the code: + +%\setupexternalfigures[location={global}] + +%\defineoverlay[rainb][{\externalfigure[rainbow.pdf][width=1.05\textwidth,height=1.4\textheight]}] + +% \startuniqueMPgraphic{gray} +% StartPage ; +% pair zf[] ; +% path gr[] ; +% numeric a; a = 2cm ; +% numeric b; b = 0.8cm ; +% z.f1 = ulcorner Page shifted (a,0) ; +% z.f2 = urcorner Page shifted (-a,0) ; +% z.f3 = lrcorner Page shifted (-a,0) ; +% z.f4 = llcorner Page shifted (a,0) ; +% z.f5 = z.f1 shifted (0,-b) ; +% z.f6 = z.f2 shifted (0,-b) ; +% z.f7 = z.f3 shifted (0,b) ; +% z.f8 = z.f4 shifted (0,b) ; +% z.f9 = z.f5 shifted (0,-b) ; +% z.f10 = z.f6 shifted (0,-b) ; +% z.f11 = z.f7 shifted (0,b) ; +% z.f12 = z.f8 shifted (0,b) ; +% gr[1] = ulcorner Page -- urcorner Page -- lrcorner Page -- llcorner Page -- z.f8 -- z.f7 -- z.f6 -- z.f5 -- z.f4 -- llcorner Page -- cycle ; +% gr[2] = z.f9 -- z.f10 -- z.f11 -- z.f12 -- cycle ; +% gr[2] := gr[2] enlarged (.5cm,0cm) ; +% fill gr[1] withcolor \MPcolor{a} ; +% fill gr[2] withcolor \MPcolor{a} ; +% StopPage ; +% \stopuniqueMPgraphic + +%D However, it seemed more portable to let Metapost calculate the background. +%D The rainbow effect takes some lines of code, but it's not too bad: + +\startuniqueMPgraphic{gray} +StartPage ; +pair zf[] ; +fill Page withcolor \MPcolor{a} ; +path gr[] ; +numeric a; a = 2cm ; +numeric b; b = 0.4cm ; +numeric c; c = 0.7cm ; +z.f1 = ulcorner Page shifted (a,-c) ; +z.f2 = urcorner Page shifted (-a,-c) ; +z.f3 = z.f2 shifted (0,-b) ; +z.f4 = z.f1 shifted (0,-b) ; +gr[1] = z.f1 -- z.f2 ; +gr[2] = z.f4 -- z.f3 ; +z.f5 = point .2 along gr[1] ; +z.f6 = point .2 along gr[2] ; +z.f7 = point .4 along gr[1] ; +z.f8 = point .4 along gr[2] ; +z.f9 = point .6 along gr[1] ; +z.f10 = point .6 along gr[2] ; +z.f11 = point .8 along gr[1] ; +z.f12 = point .8 along gr[2] ; +gr[3] = z.f1 -- z.f5 -- z.f6 -- z.f4 -- cycle ; +gr[4] = z.f7 -- z.f5 -- z.f6 -- z.f8 -- cycle ; +gr[4] := gr[4] enlarged (.02cm,0) ; +gr[5] = z.f9 -- z.f7 -- z.f8 -- z.f10 -- cycle ; +gr[5] := gr[5] enlarged (.02cm,0) ; +gr[6] = z.f11 -- z.f9 -- z.f10 -- z.f12 -- cycle ; +gr[6] := gr[6] enlarged (.02cm,0) ; +gr[7] = z.f11 -- z.f2 -- z.f3 -- z.f12 -- cycle ; +linear_shade(gr[3],0,\MPcolor{One},\MPcolor{Two}) ; +linear_shade(gr[4],0,\MPcolor{Two},\MPcolor{Three}) ; +linear_shade(gr[5],0,\MPcolor{Three},\MPcolor{Four}) ; +linear_shade(gr[6],0,\MPcolor{Four},\MPcolor{Five}) ; +linear_shade(gr[7],0,\MPcolor{Five},\MPcolor{Six}) ; +z.f21 = llcorner Page shifted (a,c) ; +z.f22 = lrcorner Page shifted (-a,c) ; +z.f23 = z.f22 shifted (0,b) ; +z.f24 = z.f21 shifted (0,b) ; +gr[21] = z.f21 -- z.f22 ; +gr[22] = z.f24 -- z.f23 ; +z.f25 = point .2 along gr[21] ; +z.f26 = point .2 along gr[22] ; +z.f27 = point .4 along gr[21] ; +z.f28 = point .4 along gr[22] ; +z.f29 = point .6 along gr[21] ; +z.f30 = point .6 along gr[22] ; +z.f31 = point .8 along gr[21] ; +z.f32 = point .8 along gr[22] ; +gr[23] = z.f21 -- z.f25 -- z.f26 -- z.f24 -- cycle ; +gr[24] = z.f27 -- z.f25 -- z.f26 -- z.f28 -- cycle ; +gr[24] := gr[24] enlarged (.02cm,0) ; +gr[25] = z.f29 -- z.f27 -- z.f28 -- z.f30 -- cycle ; +gr[25] := gr[25] enlarged (.02cm,0) ; +gr[26] = z.f31 -- z.f29 -- z.f30 -- z.f32 -- cycle ; +gr[26] := gr[26] enlarged (.02cm,0) ; +gr[27] = z.f31 -- z.f22 -- z.f23 -- z.f32 -- cycle ; +linear_shade(gr[23],0,\MPcolor{One},\MPcolor{Two}) ; +linear_shade(gr[24],0,\MPcolor{Two},\MPcolor{Three}) ; +linear_shade(gr[25],0,\MPcolor{Three},\MPcolor{Four}) ; +linear_shade(gr[26],0,\MPcolor{Four},\MPcolor{Five}) ; +linear_shade(gr[27],0,\MPcolor{Five},\MPcolor{Six}) ; +StopPage ; +\stopuniqueMPgraphic + +\startuseMPgraphic{progress} +StartPage +path p[] ; +p[1] := unitsquare xyscaled(MakeupWidth,.4cm) shifted (2cm,0.7cm) ; +numeric i; i = (PageNumber - 1)/(NOfPages - 1) ; +p[2] = ulcorner p[1] -- urcorner p[1] ; +p[3] = llcorner p[1] -- lrcorner p[1] ; +pair o[] ; +o[1] := point i along p[2] ; +o[2] := point i along p[3] ; +p[4] = o[1] -- o[2] ; +p[4] := p[4] enlarged (0,-1pt) ; +pickup pensquare scaled 2pt ; +draw p[4] ; +StopPage +\stopuseMPgraphic + +%D We define these backgrounds as overlays: + +\defineoverlay[graybg] +[\useMPgraphic{gray}] + +\defineoverlay[bar] +[\useMPgraphic{progress}] + +%D These are shortcuts to switch backgrounds: + +\define\lecback{\setuplayout[header=11mm]\setupbackgrounds[page][background={graybg,bar,slidetitle}]} +\define\titback{\setuplayout[header=0mm]\setupbackgrounds[page][background={graybg}]} +\define\picback{\setuplayout[header=0mm]\setupbackgrounds[page][background={graybg,bar}]} +\define\noback{\setupbackgrounds[page][background=nobackground]} + +%D We use combinations for placing vertical pictures and text side by side, and +%D we want a distance of 1.1 cm between both. + +\setupcombinations[distance=1.1cm] + +%D The symbol for the first level of itemizations. + +\definesymbol[1][\useMPgraphic{ItSquare}] +\setupitemize[1][inmargin] + +\protect +\stopmodule + +\endinput + diff --git a/obsolete/macros/context/contrib/context-taspresent/tex/context/third/taspresent/t-redframe.tex b/obsolete/macros/context/contrib/context-taspresent/tex/context/third/taspresent/t-redframe.tex new file mode 100644 index 0000000000..9538360af8 --- /dev/null +++ b/obsolete/macros/context/contrib/context-taspresent/tex/context/third/taspresent/t-redframe.tex @@ -0,0 +1,187 @@ +%D \module +%D [ file=t-redframe, +%D version=2007.07.17, +%D title=\CONTEXT\ Style File, +%D subtitle=Presentation Module redframe, +%D author=Thomas A. Schmitz, +%D date=\currentdate, +%D copyright={Thomas A. Schmitz}] +%C +%C Copyright 2007 Thomas A. Schmitz. +%C This file may be distributed under the GNU General Public License v. 2.0. + +%D This file provides the \quotation{redframe} style for the presentation +%D module. It is loaded at runtime. The look of this style was inspired by the +%D screen version of the Metafun manual. + +\writestatus{loading}{module redframe} + +\startmodule[redframe] + +\unprotect + +%D The taspresentation module provides a skeleton into which different styles +%D can be hooked. It uses a number of variables and macros which have to be set +%D beforehand. Some parts are optional. We begin with the necessary definitions: + +%D We start colors: + +\setupcolors[state=start] + +%D These macros are used for placing figures/pictures: + +\define\NormalHeight{.95\textheight} +\define\NormalWidth{.476\textwidth} +\define\PictureFrameHeight{.95\textheight} +\define\PictureFrameWidth{.476\textwidth} + +%D The page layout: + +\setuplayout [width=fit, + margin=2cm, + height=fit, + leftmargindistance=1cm, + rightmargindistance=0cm, + header=2.8cm, + footer=1cm, + topspace=.7cm, + backspace=2cm, + location=singlesided] + +%D The macro for typesetting the Slidetitle; this is adapted from a sample +%D document that Brooks Moses published on the wiki: + +\definelayer[slidetitle] + [width=\paperwidth, + height=\paperheight, + x=20mm, + y=16mm] + +\define[1]\Slidetitle{\page\setlayer[slidetitle]% + {\framed[frame=off,width=\textwidth,height=2.3cm,offset=0pt,top=\vss,bottom=\vss]{\switchtobodyfont[\Titlesize]\color[FrameColor]{#1}}}} + +%D The macro \tex{Maketitle} produces a default title page with the author, the +%D title of the presentation, and the date. Using it is not mandatory. + +\define\Maketitle{% +\titback +\null +\vfill +\midaligned{\switchtobodyfont[\Titlesize]\color[FrameColor]{\getvariable{taspresent}{title}}} +\blank[2*line] +\midaligned{\color[FrameColor]{\getvariable{taspresent}{author}}} +\blank[3*line] +\midaligned{\color[FrameColor]{\currentdate}} +\vfill +\null} + +%D The following parts are optional; if you don't use backgrounds and are +%D content with CONTEXT's default itemization, you don't have to set these +%D macros. + +%D We define our colors: + +\definecolor [lightb] [s=.75] +\definecolor [darkb] [s=.2] +\definecolor [BackgroundColor] [s=.6] +\definecolor [FrameColor] [r=.55, g=0, b=.04] +\definecolor [Item] [r=.55, g=0, b=.04] +\definecolor [DarkYellow] [s=.6]%[r=.73, g=.61, b=.25] % gray looks better? + +%D We let Metapost calculate the background: + +\startuniqueMPgraphic{slide} +StartPage ; +path p[] ; +a=1.5cm ; +fill Page withcolor \MPcolor{lightb} ; +path Main ; +z1 = ulcorner Page shifted (a,0) ; +z2 = urcorner Page shifted (-a,0) ; +z3 = urcorner Page shifted (0,-a) ; +z4 = lrcorner Page shifted (0,a) ; +z5 = (x2,0) ; +z6 = (x1,0) ; +z7 = (0,y4) ; +z8 = (0,y3) ; +z9 = (x1,y3) ; +z10 = (x2,y3) ; +z11 = (x2,y4) ; +z12 = (x1,y4) ; +p[1] = z9 -- z12 -- z7 -- z8 -- cycle ; +p[2] = z10 -- z3 -- z4 -- z11 --cycle ; +p[3] = z12 -- z11 -- z5 -- z6 --cycle ; +p[4] = z9 -- z10 -- z2 -- z1 -- cycle ; +fill p[1] withcolor \MPcolor{darkb} ; +fill p[2] withcolor \MPcolor{darkb} ; +fill p[3] withcolor \MPcolor{darkb} ; +fill p[4] withcolor \MPcolor{darkb} ; +pickup pencircle scaled 8 pt ; +draw z1 -- z6 withcolor \MPcolor{FrameColor} ; +draw z2 -- z5 withcolor \MPcolor{FrameColor} ; +draw z7 -- z4 withcolor \MPcolor{FrameColor} ; +draw z8 -- z3 withcolor \MPcolor{FrameColor} ; +StopPage ; +\stopuniqueMPgraphic + +\startuseMPgraphic{Bottombg} +StartPage +path Q[] ; +path R[] ; +z4 = llcorner Page shifted (2cm,0.75cm) ; +z5 = lrcorner Page shifted (-2cm,0.75cm) ; +Q[1] = z4 -- z[5] ; +oa = NOfPages - 2 ; +ob = PageNumber - 2 ; +oc = arclength(Q[1]) ; +od = oc/oa ; +oe = oc/oa ; +Q[2] = fullcircle scaled .4 cm shifted (2cm,0.65cm) ; +fill Q[2] withcolor \MPcolor{DarkYellow} ; +for i = 1 upto NOfPages-2: + R[i] = Q[2] shifted (i*od,0) ; + fill R[i] withcolor \MPcolor{DarkYellow} ; +endfor ; +if PageNumber > 1 : + Q[2] := Q[2] shifted (od*ob,0) ; + fill Q[2] withcolor yellow ; +fi ; +StopPage +\stopuseMPgraphic + +%D We define these backgrounds as overlays: + +\defineoverlay +[lecbackground] +[\useMPgraphic{slide}] + +\defineoverlay +[picbackground] +[\useMPgraphic{slide}] + +\defineoverlay +[bottom] +[\useMPgraphic{Bottombg}] + +%D These are shortcuts to switch backgrounds: + +\define\lecback{\setuplayout[header=2.8cm]\setupbackgrounds[page][background={lecbackground,bottom,slidetitle}]} +\define\titback{\setuplayout[header=1cm]\setupbackgrounds[page][background=lecbackground]} +\define\picback{\setuplayout[header=1cm]\setupbackgrounds[page][background={lecbackground,bottom}]} +\define\noback{\setupbackgrounds[page][background=nobackground]} + +%D We use combinations for placing vertical pictures and text side by side, and +%D we want a distance of 1.1 cm between both. + +\setupcombinations[distance=1.1cm] + +%D The symbol for the first level of itemizations. + +\definesymbol[1][\useMPgraphic{ItSquare}] +\setupitemize[1][inmargin][color=FrameColor] + +\protect +\stopmodule + +\endinput + diff --git a/obsolete/macros/context/contrib/context-taspresent/tex/context/third/taspresent/t-superellipse.tex b/obsolete/macros/context/contrib/context-taspresent/tex/context/third/taspresent/t-superellipse.tex new file mode 100644 index 0000000000..ad4e93c1ab --- /dev/null +++ b/obsolete/macros/context/contrib/context-taspresent/tex/context/third/taspresent/t-superellipse.tex @@ -0,0 +1,139 @@ +%D \module +%D [ file=t-superellipse, +%D version=2007.12.20, +%D title=\CONTEXT\ Style File, +%D subtitle=Presentation Module quadblue, +%D author=Thomas A. Schmitz, +%D date=\currentdate, +%D copyright={Thomas A. Schmitz}] +%C +%C Copyright 2007 Thomas A. Schmitz. +%C This file may be distributed under the GNU General Public License v. 2.0. + +%D This file provides the \quotation{superellipse} style for the presentation +%D module. The design is inspired by Hans's "funny" presentation module +%D (s-pre-03). It is loaded at runtime. + +\writestatus{loading}{module superellipse} + +\startmodule[superellipse] + +\unprotect + +%D The taspresentation module provides a skeleton into which different styles +%D can be hooked. It uses a number of variables and macros which have to be set +%D beforehand. Some parts are optional. We begin with the necessary definitions: + +%D We define our colors: + +\definecolor[outer][s=0] +\definecolor[inner][s=.8] +\definecolor[ellipse][r=.5,g=0,b=0] +\definecolor[contrast][r=.9,g=0,b=0] +\definecolor[Item] [r=.5] + +%D We start colors: + +\setupcolors[state=start] + +%D These macros are used for placing figures/pictures: + +\define\NormalHeight{\textheight} +\define\NormalWidth{.5\textwidth} +\define\PictureFrameHeight{\textheight} +\define\PictureFrameWidth{.5\textwidth} + +%D The page layout: + +\setuplayout [width=fit, + height=fit, + margin=0cm, + header=1.2cm, + footer=0cm, + topspace=1.8cm, + backspace=1.5cm, + location=singlesided] + +%D The macro for typesetting the Slidetitle; this is adapted from a sample +%D document that Brooks Moses published on the wiki: + +\definelayer[slidetitle] + [width=\paperwidth, + height=\paperheight, + y=10mm, + x=15mm] + +\define[1]\Slidetitle{\page\setlayer[slidetitle]% + {\framed[frame=off,width=\textwidth,height=2.5cm,offset=0pt,top=\vss,bottom=\vss]{\switchtobodyfont[\Titlesize]\color[ellipse]{#1}}}} + +%D The macro \tex{Maketitle} produces a default title page with the author, the +%D title of the presentation, and the date. Using it is not mandatory. + +\define\Maketitle{% +\titback +\null +\vfill +\midaligned{\switchtobodyfont[\Titlesize]\color[ellipse]{\getvariable{taspresent}{title}}} +\blank[2*line] +\midaligned{\color[ellipse]{\getvariable{taspresent}{author}}} +\blank[3*line] +\midaligned{\color[ellipse]{\currentdate}} +\vfill +\null} + +%D The following parts are optional; if you don't use backgrounds and are +%D content with CONTEXT's default itemization, you don't have to set these +%D macros. + +%D We let Metapost calculate the background: + +\startuseMPgraphic{left} +StartPage ; + fill Page withcolor \MPcolor{outer} ; + path p ; pair pa ; pair pb ; + p := Page enlarged (-15pt,-15pt) superellipsed .9 ; + fill p withcolor \MPcolor{inner} ; + pickup pencircle scaled 20pt ; + draw p withcolor \MPcolor{ellipse} ; + if PageNumber>1: + pa := point (3 + (6*PageNumber) / NOfPages) of p ; + pb := point (3 + (6*(PageNumber-1)) / NOfPages) of p ; + draw (p cutafter pa) cutbefore pb withcolor \MPcolor{contrast} ; + fi ; +% draw point 1 of p withcolor \MPcolor{contrast} ; +% draw point 8 of p withcolor blue ; +% draw point 4 of p withcolor green ; +% draw point 3 of p withcolor yellow ; +% draw point 2 of p withcolor cyan ; +% draw point 7 of p withcolor white ; +StopPage ; +\stopuseMPgraphic + +%D We define these backgrounds as overlays: + +\defineoverlay +[lecbackground] +[\useMPgraphic{left}] + +%D These are shortcuts to switch backgrounds: + +\define\lecback{\setuplayout[header=1.5cm]\setupbackgrounds[page][background={lecbackground,slidetitle}]} +\define\titback{\setuplayout[header=0cm]\setupbackgrounds[page][background=lecbackground]} +\define\picback{\setuplayout[header=0cm]\setupbackgrounds[page][background={lecbackground,slidetitle}]} +\define\noback{\setupbackgrounds[page][background=nobackground]} + +%D We use combinations for placing vertical pictures and text side by side, and +%D we want a distance of 1.1 cm between both. + +\setupcombinations[distance=0cm] + +%D The symbol for the first level of itemizations. + +\definesymbol[1][\useMPgraphic{ItSquare}] +\setupitemize[1][color=ellipse] + +\protect +\stopmodule + +\endinput + diff --git a/obsolete/macros/context/contrib/context-taspresent/tex/context/third/taspresent/t-taspresent.tex b/obsolete/macros/context/contrib/context-taspresent/tex/context/third/taspresent/t-taspresent.tex new file mode 100644 index 0000000000..5b3f51e95d --- /dev/null +++ b/obsolete/macros/context/contrib/context-taspresent/tex/context/third/taspresent/t-taspresent.tex @@ -0,0 +1,684 @@ +%D \module +%D [ file=t-taspresent, +%D version=2007.07.15, +%D title=\CONTEXT\ Style File, +%D subtitle=Presentation Module taspresent, +%D author=Thomas A. Schmitz, +%D date=\currentdate, +%D copyright={Thomas A. Schmitz}] +%C +%C Copyright 2007 Thomas A. Schmitz. +%C This file may be distributed under the GNU General Public License v. 2.0. + +%D This module is meant to facilitate writing presentations in \CONTEXT. It +%D provides a consistent interface and macros; there are different styles +%D which give different output. The module has been written for +%D projector||based presentations, so elements which are typical for screen +%D presentations (such as interactive hyperlinks or tables of contents) are not +%D included. The module is meant for an academic environment, specifically in +%D the humanities. Hence, it has the following characteristics: +%D +%D \startitemize +%D +%D \item The look is rather sober. In academia, presentations are not meant to +%D showcase fancy \TeX\ effects; nothing should divert the audience's attention +%D from the content. +%D +%D \item The module is written for slides which exhibit text and/or images. +%D From my own experience with \TeX||based presentations, I have provided a +%D setup for horizontal (landscape) pictures and for vertical (portrait) +%D pictures, which are accompanied by an area for explanatory text. +%D +%D \item A simple switch in the module setup command will produce different +%D output. +%D +%D \item It is easy to customize the module or to add more styles. +%D +%D \stopitemize +%D +%D The macros are commented rather extensively to give users (especially users +%D relatively new to \CONTEXT) the chance to unserstand the mechanisms and +%D create their own styles. Of course, I did not invent this code on my own. My +%D thanks are due, as always, to Hans Hagen, whose presentation modules in the +%D \CONTEXT\ core have been a wonderful source of inspiration, and to Mojca +%D Miklavec, who provided help with Metapost. + +\writestatus{loading}{module taspresent} + +\startmodule[taspresent] + +\unprotect + +%D First, we provide default setups for the module. These setups will be used +%D to choose the different styles; user input will overwrite the defaults. The +%D different styles are defined in additional modules which will be called in +%D turn. + +\setupmodule[style=doubleframe,font=LatinModernSans,size=17pt,stylecolor=blue,stylebottom=square] + +%D We collect author and title of the presentation in variables in the +%D namespace {\tt taspresent}; they will be used to typeset the title page and +%D in some headers and footers. The defaults are empty. + +\setvariables [taspresent] [ author=] +\setvariables [taspresent] [ title=] + +%D The fontsize is set via the \type{size}||key; it will be used in +%D numerous setup||commands. We use the \tex{processaction} mechanism to define +%D our \tex{Normalsize} and \tex{Titlesize}. + + +\processaction[\currentmoduleparameter{size}] + [ 16pt=>\def\Normalsize{16pt}\def\Titlesize{25pt}, + 17pt=>\def\Normalsize{17pt}\def\Titlesize{27pt}, + 18pt=>\def\Normalsize{18pt}\def\Titlesize{28pt}, + 19pt=>\def\Normalsize{19pt}\def\Titlesize{30pt}, + 20pt=>\def\Normalsize{20pt}\def\Titlesize{30pt}, + 21pt=>\def\Normalsize{21pt}\def\Titlesize{30pt}, + \v!unknown=>\def\Normalsize{17pt}\def\Titlesize{27pt}, + \v!default=>\def\Normalsize{17pt}\def\Titlesize{27pt}] + +%D Next, we define the different styles. The fallback is a style without +%D background which is defined in the module itself; it is included as a +%D \type{mode}. All other styles are defined in external files which are +%D called in turn. + +\beginOLDTEX +\setupencoding[default=ec] +\endOLDTEX + +\def\DefMode{\enablemode[defaultmode]} + +\processaction[\currentmoduleparameter{stylebottom}] + [ square=>\def\modbottom{square}, + stripe=>\def\modbottom{stripe}, + \v!unknown=>\def\modbottom{square}, + \v!default=>\def\modbottom{square}] + +\processaction[\currentmoduleparameter{stylecolor}] + [ red=>\def\modcolor{red}, + blue=>\def\modcolor{blue}, + green=>\def\modcolor{green}, + bluered=>\def\modcolor{bluered}, + \v!unknown=>\def\modcolor{blue}, + \v!default=>\def\modcolor{blue}] + +\processaction[\currentmoduleparameter{style}] + [ blackblue=>{\usemodule[blackblue]}, + bonn=>{\usemodule[bonn]}, + bluegray=>{\usemodule[bluegray][color=\modcolor]}, + bluestripe=>{\usemodule[bluestripe]}, + bluewhite=>{\usemodule[bluewhite]}, + darkshade=>{\usemodule[darkshade][color=\modcolor]}, + doubleframe=>{\usemodule[doubleframe][bottom=\modbottom]}, + doubleshade=>{\usemodule[doubleshade]}, + embossed=>{\usemodule[embossed]}, + graybeams=>{\usemodule[graybeams]}, + graysquare=>{\usemodule[graysquare]}, + greenblue=>{\usemodule[greenblue]}, + horizontalblue=>{\usemodule[horizontalblue]}, + lightblue=>{\usemodule[lightblue]}, + quadblue=>{\usemodule[quadblue]}, + rainbowstripe=>{\usemodule[rainbowstripe]}, + superellipse=>{\usemodule[superellipse]}, + titleframe=>{\usemodule[titleframe]}, + narrowstripe=>{\usemodule[narrowstripe][color=\modcolor]}, + redframe=>{\usemodule[redframe]}, + \v!unknown=>\doiffileelse{\currentmoduleparameter{style}}{\input \currentmoduleparameter{style}}{\DefMode}, + \v!default=>\DefMode] + +%D We set up the bodyfont + +\processaction[\currentmoduleparameter{font}] + [ LatinModern=>\def\fontmode{latinmodern}, + LatinModernSans=>\def\fontmode{latinmodernsans}, + Pagella=>\def\fontmode{pagella}, + Times=>\def\fontmode{times}, + MyriadPro=>\def\fontmode{myriadpro}, + Helvetica=>\def\fontmode{helvetica}, + User=>\def\fontmode{}, + \v!unknown=>\def\fontmode{latinmodernsans}, + \v!default=>\def\fontmode{latinmodernsans}] + +\enablemode[\fontmode] + +%D We begin by setting up the tolerance. Presentations have relatively dense +%D lines, we do not care about underfull lines, but allow emergeny stretch. + +\setuptolerance[verytolerant,stretch] + +\setupbodyfontenvironment[default][em=italic] + +%D Next, the page layout. S6 has the ratio of a usual computer screen. We do +%D not want page numbers, but we sometimes want to use the pagenumbering +%D mechanism, so we make sure pages are counted, but the numbers are not +%D displayed. As for the page layout: most of the numbers have been reached by +%D trial and error; I have just taken what seemed to produce the best output. + +\setuppapersize[S6][S6] + +\setuppagenumbering[location=] + +\startmode[defaultmode] +\setupcolors[state=start] +\stopmode + +\startmode[defaultmode] +\setuplayout [width=fit, + margin=0.6cm, + height=fit, + header=0.15cm, + footer=1.35cm, + footerdistance=0.5cm, + topspace=0.5cm, + backspace=1cm, + location=singlesided] +\stopmode + +%D The bodyfont needs to be defined so \CONTEXT\ can calculate size switches, +%D math formulas, etc. + +\starttypescript [serif] [default] [size] +\definebodyfont [14pt,15pt,16pt,17pt,20pt,25pt,\Normalsize,\Titlesize] [rm] [default] +\stoptypescript + +\starttypescript [sans] [default] [size] +\definebodyfont [14pt,15pt,16pt,17pt,20pt,25pt,\Normalsize,\Titlesize] [ss] [default] +\stoptypescript + +%D Modes define which font will be used. + +\definebodyfontenvironment[\Normalsize] +\definebodyfontenvironment[\Titlesize] + +\startmode[latinmodern] +\setupbodyfont[\Normalsize] +\stopmode + +\startmode[latinmodernsans] +\setupbodyfont[ss,\Normalsize] +\stopmode + +\beginLUATEX +\usetypescriptfile[type-otf] + +\startmode[helvetica] +\usetypescript[times] +\setupbodyfont[times,ss,\Normalsize] +\stopmode + +\startmode[pagella] +\usetypescript[palatino] +\setupbodyfont[palatino,\Normalsize] +\stopmode + +\startmode[times] +\usetypescript[times] +\setupbodyfont[times,\Normalsize] +\stopmode +\endLUATEX + +\beginOLDTEX +\startmode[helvetica] +\definetypeface [SlideFace] [rm] [serif] [times] [default] +\definetypeface [SlideFace] [ss] [sans] [helvetica] [default] [rscale=.9] +\definetypeface [SlideFace] [tt] [mono] [courier] [default] [rscale=1.1] +\setupbodyfont[SlideFace,ss,\Normalsize] +\stopmode + +\startmode[times] +\definetypeface [SlideFace] [rm] [serif] [times] [default] +\definetypeface [SlideFace] [ss] [sans] [helvetica] [default] [rscale=.9] +\definetypeface [SlideFace] [tt] [mono] [courier] [default] [rscale=1.1] +\setupbodyfont[SlideFace,\Normalsize] +\stopmode + +\startmode[pagella] +\definebodyfontenvironment[\Normalsize] +\usetypescriptfile[type-gyr] +\definetypeface [SlideFace] [rm] [serif] [palatino] [default] [encoding=texnansi] +\definetypeface [SlideFace] [tt] [mono] [modern] [default] [encoding=texnansi] +\setupbodyfont[SlideFace,\Normalsize] +\stopmode + +\startmode[myriadpro] +\usetypescriptfile[type-myriadpro] +\usetypescript[MyriadPro] [texnansi] +\setupbodyfont[MyMyriadPro,ss,\Normalsize] +\stopmode +\endOLDTEX + +\beginXETEX +\startmode[times] +\starttypescript [serif] [sliter] + \definefontsynonym [Termes-Roman] [file:texgyretermes-regular] + \definefontsynonym [Termes-Bold] [file:texgyretermes-bold] + \definefontsynonym [Termes-Italic] [file:texgyretermes-italic] + \definefontsynonym [Termes-Bold-Italic] [file:texgyretermes-bolditalic] + \stoptypescript + +\starttypescript [serif] [sliter] [name] + \definefontsynonym [Serif] [Termes-Roman] [features=default] + \definefontsynonym [SerifItalic] [Termes-Italic] [features=default] + \definefontsynonym [SerifBold] [Termes-Bold] [features=default] + \definefontsynonym [SerifBoldItalic] [Termes-Bold-Italic] [features=default] + \definefontsynonym [SerifCaps] [Serif] + \definefontsynonym [OldStyle] [Serif] +\stoptypescript +\definetypeface [SlideFace] [rm] [serif] [sliter] [default] +\setupbodyfont[SlideFace,\Normalsize] +\stopmode + +\startmode[helvetica] +\starttypescript [sans] [slihe] + \definefontsynonym [Helvetica-Roman] [file:texgyreheros-regular] + \definefontsynonym [Helvetica-Bold] [file:texgyreheros-bold] + \definefontsynonym [Helvetica-Italic] [file:texgyreheros-italic] + \definefontsynonym [Helvetica-Bold-Italic] [file:texgyreheros-bolditalic] + \stoptypescript + +\starttypescript [sans] [slihe] [name] + \definefontsynonym [Sans] [Helvetica-Roman] [features=default] + \definefontsynonym [SansItalic] [Helvetica-Italic] [features=default] + \definefontsynonym [SansBold] [Helvetica-Bold] [features=default] + \definefontsynonym [SansBoldItalic] [Helvetica-Bold-Italic] [features=default] + \definefontsynonym [SansCaps] [Sans] + \definefontsynonym [OldStyle] [Sans] +\stoptypescript +\definetypeface [SlideFace] [rm] [sans] [slihe] [default] +\setupbodyfont[SlideFace,ss,\Normalsize] +\stopmode + +\startmode[pagella] +\definebodyfontenvironment[\Normalsize] +\starttypescript [serif] [slipa] + \definefontsynonym [Pagella-Roman] [file:texgyrepagella-regular] + \definefontsynonym [Pagella-Bold] [file:texgyrepagella-bold] + \definefontsynonym [Pagella-Italic] [file:texgyrepagella-italic] + \definefontsynonym [Pagella-Bold-Italic] [file:texgyrepagella-bolditalic] + \stoptypescript + +\starttypescript [serif] [slipa] [name] + \definefontsynonym [Serif] [Pagella-Roman] [features=default] + \definefontsynonym [SerifItalic] [Pagella-Italic] [features=default] + \definefontsynonym [SerifBold] [Pagella-Bold] [features=default] + \definefontsynonym [SerifBoldItalic] [Pagella-Bold-Italic] [features=default] + \definefontsynonym [SerifCaps] [Serif] + \definefontsynonym [OldStyle] [Serif] +\stoptypescript +\definetypeface [SlideFace] [rm] [serif] [slipa] [default] +\setupbodyfont[SlideFace,\Normalsize] +\stopmode + +\startmode[myriadpro] +\usetypescriptfile[type-myriadpro] +\usetypescript[MyriadPro] +\setupbodyfont[MyMyriadPro,\Normalsize] + +\endXETEX + +%D This is a definition for Metapost pictures and \tex{sometxt} which I use in +%D my own presentations. + +\def\MyFramedText#1% +{\framed[offset=.5ex,frame=off,width=0.5cm]{#1}} +\definetextext[MF]{\MyFramedText} + +%D For code snippets, we want colored output. + +\definetype[typeTEX][option=color] + +%D We define a \quotation{normal} height and width for images. + +\startmode[defaultmode] +\define\NormalHeight{.83\textheight} +\define\NormalWidth{.476\textwidth} +\define\PictureFrameHeight{.83\textheight} +\define\PictureFrameWidth{.476\textwidth} +\stopmode + +%D This is a small square which will be used for \tex{itemize}; it will be +%D placed in the margin. + +\startuniqueMPgraphic{ItTriangle} +fill (0,0) -- (0,0.4cm) -- (0.6cm,0.2cm) -- cycle withcolor \MPcolor{Item} ; +\stopuniqueMPgraphic + +\startuniqueMPgraphic{ItSquare} +fill unitsquare xyscaled(0.4cm,0.4cm) withcolor \MPcolor{Item} ; +\stopuniqueMPgraphic + +%D I had thought about this method for including pictures, but in the end +%D decided against it. + +\definefloat[MyMargin] + [figure] + +\setupfloat[MyMargin] + [leftmargindistance=-0.5cm, + default={left,none,high}] + +\defineparagraphs[ShowPictures][n=2,distance=1cm] +\setupparagraphs[ShowPictures][1][width=.5\textwidth] + +%D The code for red circles and arrows which can be placed on top of a picture. +%D I use them quite often in my presentations. Again, they are Metapost +%D graphics which are then used as overlays. + +\setupMPvariables[CircleSomething][scale=20,x=3,y=3] +\startuseMPgraphic{CircleSomething}{scale,x,y} +picture bboxpicture ; +draw unitsquare xyscaled (OverlayWidth,OverlayHeight) ; +bboxpicture := currentpicture ; +currentpicture := nullpicture ; +for i=1 upto 18: + pickup pencircle scaled (i*0.333pt) ; + draw fullcircle scaled \MPvar{scale}mm shifted (\MPvar{x}mm + 1.5mm,\MPvar{y}mm - 1.5mm) withcolor transparent (1,0.025,black) ; + endfor ; +pickup pencircle scaled 5pt ; +draw fullcircle scaled \MPvar{scale}mm shifted (\MPvar{x}mm,\MPvar{y}mm) withcolor red ; +setbounds currentpicture to boundingbox bboxpicture; +\stopuseMPgraphic + +%D This code has been contributed by Wolfgang Schuster and Peter Rolf. It puts +%D a transparent gray layer over the picture, with one round area being +%D completely transparent. This looks very neat for emphasizing areas of a +%D picture. + +\setupMPvariables[GraySomething][opacity=30,scale=20,x=10,y=10] +\startuseMPgraphic{GraySomething}{opacity,scale,x,y} +op := \MPvar{opacity}/100 ; +path p, q ; +p := unitsquare xyscaled(OverlayWidth,OverlayHeight) ; +q := fullcircle scaled \MPvar{scale}mm shifted (\MPvar{x}mm,\MPvar{y}mm) ; +fill p--reverse q--cycle withcolor transparent (1,op,black) ; +\stopuseMPgraphic + +%D The next macro allows users a simple interface for placing an image with a +%D red circle on top. The macro \tex{CircHoriz} takes three arguments: the size +%D and placement of the red circle, which are given as variables in the form +%D \type{[scale=,xshift,yshift]}, the name of the picture, and the size for the +%D picture. + +\def\CircHoriz{\dotripleargument\doCircHoriz} +\def\doCircHoriz[#1][#2][#3]{% +\defineoverlay[Red_Circle][\useMPgraphic{CircleSomething}{#1}] +\midaligned{\framed[frame=off,width=\textwidth,height=\PictureFrameHeight,align=middle,top=\vss,bottom=\vss,strut=no,offset=0pt,background={foreground,Red_Circle}]{\externalfigure[#2][#3]}}} + +%D This macro makes use of the gray layer; again, it takes three arguments: +%D opacity, scale and placement of the transparent circle (the rest of the +%D image is transparent gray), name of the picture, size of picture. + +\def\GrayHoriz{\dotripleargument\doGrayHoriz} +\def\doGrayHoriz[#1][#2][#3]{% +\defineoverlay[Gray_Background][\useMPgraphic{GraySomething}{#1}] +\framed[frame=off,width=\textwidth,height=\textheight,align=middle,top=\vss,bottom=\vss,strut=no,offset=0pt]{\framed[frame=off,width=fit,height=fit,strut=no,offset=0pt,background={foreground,Gray_Background}]{\externalfigure[#2][#3]}}} + + +\def\CircVert{\dotripleargument\doCircVert} +\def\doCircVert[#1][#2][#3]#4{% +\defineoverlay[Red_Circle][\useMPgraphic{CircleSomething}{#1}]% +\startcombination% +\framed[frame=off,height=\textheight,width=\PictureFrameWidth,top=\vss,bottom=\vss,align=middle,strut=no,offset=0pt,background={foreground,Red_Circle}]{\externalfigure[#2][#3]}{}% +\framed[frame=off,height=\textheight,width=\PictureFrameWidth,top=\vss,bottom=\vss,align=middle,strut=no]{#4}{}% +\stopcombination% +} + +\setupMPvariables[ArrowSomething][direction=45,x=20,y=20] +\startuseMPgraphic{ArrowSomething}{direction,x,y} +picture bboxpicture ; +draw unitsquare xyscaled (OverlayWidth,OverlayHeight) withcolor blue ; +z1 = (\MPvar{x}mm,\MPvar{y}mm) ; +z2 = z1 + 2.5cm*dir(\MPvar{direction}) ; +z3 = z1 shifted (1.5mm,-1.5mm) ; +z4 = z2 shifted (1.5mm,-1.5mm) ; +bboxpicture := currentpicture ; +currentpicture := nullpicture ; +for i=1 upto 18: + ahlength := (i*0.833pt) ; + pickup pencircle scaled (i*0.277pt) ; + drawarrow z4--z3 withcolor transparent (1,0.025,black) ; +endfor ; +ahlength := 15pt ; +pickup pencircle scaled 5pt ; +drawarrow z2--z1 withcolor red; +setbounds currentpicture to boundingbox bboxpicture; +\stopuseMPgraphic + +%D The code for inclusion of a red arrow is similar: again, it takes three +%D arguments: the placement and direction of the arrow given in the form +%D \type{[direction=45,x=20,y=20]}, the name of the picture, and the size of +%D the picture. + +\def\ArrowHoriz{\dotripleargument\doArrowHoriz} +\def\doArrowHoriz[#1][#2][#3]{% +\defineoverlay[Red_Arrow][\useMPgraphic{ArrowSomething}{#1}] +\midaligned{\framed[frame=off,width=\textwidth,height=\PictureFrameHeight,align=middle,top=\vss,bottom=\vss,strut=no,offset=0pt,background={foreground,Red_Arrow}]{\externalfigure[#2][#3]}}} + +\def\ArrowVert{\dotripleargument\doArrowVert} +\def\doArrowVert[#1][#2][#3]#4{% +\defineoverlay[Red_Arrow][\useMPgraphic{ArrowSomething}{#1}]% +\startcombination% +\framed[frame=off,height=\textheight,width=\PictureFrameWidth,top=\vss,bottom=\vss,align=middle,strut=no,offset=0pt,background={foreground,Red_Arrow}]{\externalfigure[#2][#3]}{}% +\framed[frame=off,height=\textheight,width=\PictureFrameWidth,top=\vss,bottom=\vss,align=middle,strut=no]{#4}{}% +\stopcombination% +} + +\beginLUATEX +\define{\married}% +{\getglyph{name:TeXGyreHeros-Regular}{\char"26AD}} + +\define{\hanky}% +{\getglyph{name:TeXGyreHeros-Regular}{\char"26AE}} +\endLUATEX + +\beginOLDTEX +\loadmapfile[ts1-lm.map] + +\startencoding[comp] +\definecharacter textmarried 109 +\definecharacter texthanky 126 +\stopencoding + +\definefontsynonym[l@tinss][ts1-lmss10][encoding=comp] +\definefont[tsf@nt][l@tinss sa 1.4] + +\def\married{\begingroup\tsf@nt\textmarried\endgroup} +\def\hanky{\begingroup\tsf@nt\texthanky\endgroup} +\endOLDTEX + +%D Now the real user macros. \tex{Slidetitle}: well, the name says it all. Ths +%D argument is typeset as the title, but the implementation and the result +%D (alignment, size, distance to text, color etc.) vary from module to module. + +\startmode[defaultmode] +\define[1]\Slidetitle{\page\midaligned{\switchtobodyfont[\Titlesize]#1}\blank[0.75cm]} +\stopmode + +%D The macro \tex{Maketitle} produces a default title page with the author, the +%D title of the presentation, and the date. Using it is not mandatory. + +\startmode[defaultmode] +\define\Maketitle{% +\titback +\null +\vfill +\midaligned{\switchtobodyfont[\Titlesize]\getvariable{taspresent}{title}} +\blank[2*line] +\midaligned{\getvariable{taspresent}{author}} +\blank[3*line] +\midaligned{\currentdate} +\vfill +\null} +\stopmode + +%D The macros for placing horizontal and vertical pictures. They take a similar +%D form to the inclusion of arrows and circles. The macro for horizontal +%D pictures \tex{PicHoriz} takes two arguments: the name of the picture and its +%D size in the form \type{height=} or \type{width=}; the macro for vertical +%D pictures \tex{PicVert} takes three arguments: the name of the picture, its +%D size, and the text which will be placed opposite the picture. + +\def\PicHoriz{\dodoubleargument\doPicHoriz} +\def\doPicHoriz[#1][#2]{% +\framed[frame=off,width=\textwidth,height=\PictureFrameHeight,align=middle,top=\vss,bottom=\vss,strut=no,offset=0pt]{\externalfigure[#1][#2]}} + +\def\PicVert{\dodoubleargument\doPicVert} +\def\doPicVert[#1][#2]#3{\startcombination% +\framed[frame=off,height=\textheight,width=\PictureFrameWidth,top=\vss,bottom=\vss,align=middle,strut=no,offset=0pt]{\externalfigure[#1][#2]}{}% +\framed[frame=off,height=\textheight,width=\PictureFrameWidth,top=\vss,bottom=\vss,align=middle,strut=no]{#3}{}% +\stopcombination} + +%D finally, a few macros for switching the background. + +\startmode[defaultmode] +\define\lecback{\relax} +\define\titback{\relax} +\define\picback{\relax} +\define\noback{\relax} +\stopmode + +%D The rest is the demo section. + +\protect +\stopmodule + +\doifnotmode{demo}{\endinput} + +\setvariables [taspresent] + [author={Groucho Marx}, + title={Marriage the Chief Cause of Divorce}] + +\starttext + +\Maketitle + +\Slidetitle{Text} + +\lecback + +Thus, I came to the conclusion that the designer of a new +system must not only be the implementer and first +large||scale user; the designer should also write the first +user manual. + +The separation of any of these four components would have +hurt \TeX\ significantly. If I had not participated fully in +all these activities, literally hundreds of improvements +would never have been made, because I would never have +thought of them or perceived why they were important. + +But a system cannot be successful if it is too strongly +influenced by a single person. Once the initial design is +complete and fairly robust, the real test begins as people +with many different viewpoints undertake their own +experiments. + +\Slidetitle{Itemization} + +\startitemize[1] +\item Thus, I came to the conclusion that the designer of a new + system +\item must not only be the implementer and first + large||scale user; +\item the designer should also write the first + user manual. +\item The separation of any of these four components would have + hurt \TeX\ significantly. +\stopitemize + +\Slidetitle{Numbered Itemization} + +\startitemize[n] +\item Thus, I came to the conclusion that the designer of a new + system +\item must not only be the implementer and first + large||scale user; +\item the designer should also write the first + user manual. +\item The separation of any of these four components would have + hurt \TeX\ significantly. +\stopitemize + +\Slidetitle{Picture in Horizontal Mode} + +\PicHoriz[hor][height=\NormalHeight] + +\page + +\picback + +\PicVert[vert][width=\NormalWidth]{Picture in \\ Vertical Mode} + +\page + +\CircVert[scale=22,x=23,y=25][vert][width=\NormalWidth]{Circle in \\ Vertical Mode} + +\page + +\ArrowVert[direction=90,x=7,y=23][vert][width=\NormalWidth]{Arrow in \\ Vertical Mode} + +\Slidetitle{Red Circle} + +\lecback + +\CircHoriz[scale=40,x=120,y=80][hor][height=\NormalHeight] + +\Slidetitle{Red Arrow} + +\ArrowHoriz[direction=135,x=105,y=15][hor][height=\NormalHeight] + +\Slidetitle{A MetaFun graphic} + +\placefigure[here]{none}{% +\startMPcode +pickup pencircle scaled 4pt ; +draw unitsquare xyscaled (5cm,5cm) withcolor red ; +\stopMPcode +} + +\Slidetitle{Some Code Snippets} + +To set up a horizontal picture, simply type: + +\startTEX +\PicHoriz[hor][height=\Normalheight] +\stopTEX + +\blank[line] + +For vertical pictures: + +\startTEX +\PicVert[vert][width=\NormalWidth]% +{Text placed \\ opposite picture} +\stopTEX + +\Slidetitle{Math} + +Since I know nothing about math, this example is copied from the wiki: + +\startformula + f(x) = \startmathcases + \NC x, \NC if $0 \le x \le \frac12$ \NR + \NC 1-x ,\NC if $\frac12 \le x \le 1$ \NR +\stopmathcases +\stopformula + +\Slidetitle{Your Own Ideas?} + +\null + +\vfill + +\midaligned{\tfd Go \color[red]{here!}} + +\vfill + +\null + +\page + +\null + +\stoptext diff --git a/obsolete/macros/context/contrib/context-taspresent/tex/context/third/taspresent/t-titleframe.tex b/obsolete/macros/context/contrib/context-taspresent/tex/context/third/taspresent/t-titleframe.tex new file mode 100644 index 0000000000..b3df934da7 --- /dev/null +++ b/obsolete/macros/context/contrib/context-taspresent/tex/context/third/taspresent/t-titleframe.tex @@ -0,0 +1,158 @@ +%D \module +%D [ file=t-titleframe, +%D version=2007.12.20, +%D title=\CONTEXT\ Style File, +%D subtitle=Presentation Module blackblue, +%D author=Thomas A. Schmitz, +%D date=\currentdate, +%D copyright={Thomas A. Schmitz}] +%C +%C Copyright 2007 Thomas A. Schmitz. +%C This file may be distributed under the GNU General Public License v. 2.0. + +%D This file provides the \quotation{titleframe} style for the presentation +%D module. It is loaded at runtime. The most interesting part is the scratch +%D counter at the bottom of the page, which is explained in the metafun manual. + +\writestatus{loading}{module titleframe} + +\startmodule[titleframe] + +\unprotect + +%D The taspresentation module provides a skeleton into which different styles +%D can be hooked. It uses a number of variables and macros which have to be set +%D beforehand. Some parts are optional. We begin with the necessary definitions: + +%D We start colors: + +\setupcolors[state=start] + +%D These macros are used for placing figures/pictures: + +\define\NormalHeight{\textheight} +\define\NormalWidth{.476\textwidth} +\define\PictureFrameHeight{\textheight} +\define\PictureFrameWidth{.476\textwidth} + +%D The page layout: + +\setuplayout [width=fit, + margin=0cm, + height=fit, + header=2.2cm, + footer=1cm, + topspace=.6cm, + backspace=1cm, + location=singlesided] + +%D The macro for typesetting the Slidetitle; this is adapted from a sample +%D document that Brooks Moses published on the wiki: + +\definelayer[slidetitle] + [width=\paperwidth, + height=\paperheight, + x=10mm, + y=2mm] + +\define[1]\Slidetitle{\page\setlayer[slidetitle]% + {\framed[corner=round,background=color,backgroundcolor=myred,frame=off,width=\textwidth,height=2.1cm,offset=0pt,top=\vss,bottom=\vss]{\switchtobodyfont[\Titlesize]\color[background]{#1}}}} + +%D The macro \tex{Maketitle} produces a default title page with the author, the +%D title of the presentation, and the date. Using it is not mandatory. + +\define\Maketitle{% +\titback +\null +\vfill +\framed[corner=round,background=color,backgroundcolor=myred,frame=off,width=\textwidth,height=.75\textheight,top=\vss,bottom=\vss,align=middle]{\switchtobodyfont[\Titlesize]\color[background]{\getvariable{taspresent}{title}}\switchtobodyfont[\Normalsize]\blank[line]\color[background]{\getvariable{taspresent}{author}\blank[2*line]\currentdate}} +\vfill +\null} + +%D The following parts are optional; if you don't use backgrounds and are +%D content with CONTEXT's default itemization, you don't have to set these +%D macros. + +%D We define our colors: + +\definecolor [background] [s=.9] +\definecolor [darkgray] [s=.3] +\definecolor [lightgray] [s=.7] +\definecolor [myred] [r=.5] +\definecolor [Item] [r=.5] + +%D We let Metapost calculate the background: + +\startuniqueMPgraphic{slide} +StartPage ; +fill Page withcolor \MPcolor{background} ; +StopPage ; +\stopuniqueMPgraphic + +\startuseMPgraphic{counter} +StartPage ; +numeric a ; +numeric b ; +b = PaperWidth/2 - NOfPages * 2.5pt ; +a = 7mm ; +% z1 = (0,0) ; +% z2 = (x1+2pt,y1+a) ; +% numeric a; a=.5cm ; +pickup pencircle scaled 3pt ; +for i := 1 upto NOfPages: + path p ; + path q ; + p = (0,5mm) -- (1mm,11mm) ; + p := p shifted (b,0) ; + q = (-8mm,5mm) -- (0,11mm) ; + q := q shifted (b,0) ; + if (i mod 5<>0): + draw p shifted (i*5pt,0pt) withcolor \MPcolor{lightgray} ; + if (i <= PageNumber): + draw p shifted (i*5pt,0pt) ; + fi ; + else: + draw q shifted (i*5pt,0pt) withcolor \MPcolor{lightgray} ; + if (i <= PageNumber): + draw q shifted (i*5pt,0pt) ; + fi ; + fi ; +endfor ; +StopPage ; +\stopuseMPgraphic + +%\setupfootertexts[{\framed[frame=on,framecolor=red,height=9mm,width=\textwidth]{\useMPgraphic{counter}}}] +%\setupfootertexts[some random text] + +%D We define these backgrounds as overlays: + +\defineoverlay +[lecbackground] +[\useMPgraphic{slide}] + +\defineoverlay +[scratchcounter] +[\useMPgraphic{counter}] + +%D These are shortcuts to switch backgrounds: + +\define\lecback{\setuplayout[header=2.2cm]\setupbackgrounds[page][background={lecbackground,scratchcounter,slidetitle}]} +\define\titback{\setuplayout[header=.5cm]\setupbackgrounds[page][background=lecbackground]} +\define\picback{\setuplayout[header=.5cm]\setupbackgrounds[page][background={lecbackground,scratchcounter}]} +\define\noback{\setupbackgrounds[page][background=nobackground]} + +%D We use combinations for placing vertical pictures and text side by side, and +%D we want a distance of 1.1 cm between both. + +\setupcombinations[distance=1.1cm] + +%D The symbol for the first level of itemizations. + +\definesymbol[1][\useMPgraphic{ItSquare}] +\setupitemize[1][color=myred] + +\protect +\stopmodule + +\endinput + diff --git a/obsolete/macros/context/contrib/context-taspresent/tpm/t-taspresent.tpm b/obsolete/macros/context/contrib/context-taspresent/tpm/t-taspresent.tpm new file mode 100644 index 0000000000..e6acc63a87 --- /dev/null +++ b/obsolete/macros/context/contrib/context-taspresent/tpm/t-taspresent.tpm @@ -0,0 +1,54 @@ +<!DOCTYPE rdf:RDF SYSTEM "tpm.dtd"> +<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" + xmlns:TPM="http://texlive/dante.de/"> + <rdf:Description + about="http://dl.contextgarden.net/modules/taspresent-2008-08-11.zip"> + <TPM:Name>t-taspresent</TPM:Name> + <TPM:Type>Package</TPM:Type> + <TPM:Date>2008/08/11 21:00:00</TPM:Date> + <TPM:Version>2008.08.11</TPM:Version> + <TPM:Creator>Thomas A. Schmitz</TPM:Creator> + <TPM:Title>taspresent</TPM:Title> + <TPM:Description> + taspresentation is a module to prepare projector-based presentations + with ConTeXt + </TPM:Description> + <TPM:Author>Thomas A. Schmitz</TPM:Author> + <TPM:Size>2255176</TPM:Size> + <TPM:Build/> + <TPM:RunFiles size="125944"> + tex/context/third/taspresent/t-blackblue.tex + tex/context/third/taspresent/t-bluegray.tex + tex/context/third/taspresent/t-bluestripe.tex + tex/context/third/taspresent/t-darkshade.tex + tex/context/third/taspresent/t-doubleframe.tex + tex/context/third/taspresent/t-doubleshade.tex + tex/context/third/taspresent/t-embossed.tex + tex/context/third/taspresent/t-graybeams.tex + tex/context/third/taspresent/t-graysquare.tex + tex/context/third/taspresent/t-greenblue.tex + tex/context/third/taspresent/t-horizontalblue.tex + tex/context/third/taspresent/t-lightblue.tex + tex/context/third/taspresent/t-narrowstripe.tex + tex/context/third/taspresent/t-quadblue.tex + tex/context/third/taspresent/t-rainbowstripe.tex + tex/context/third/taspresent/t-redframe.tex + tex/context/third/taspresent/t-superellipse.tex + tex/context/third/taspresent/t-taspresent.tex + tex/context/third/taspresent/t-titleframe.tex + tpm/t-taspresent.tpm + </TPM:RunFiles> + <TPM:DocFiles size="2129232"> + doc/context/third/taspresent/readme + doc/context/third/taspresent/taspresent-manual.tex + doc/context/third/taspresent/taspresent-manual.pdf + doc/context/third/taspresent/hor.jpg + doc/context/third/taspresent/vert.jpg + doc/context/third/taspresent/demo.tex + </TPM:DocFiles> + <TPM:Requires> + <TPM:Package name="context"/> + </TPM:Requires> + <TPM:Provides>Package/taspresent</TPM:Provides> + </rdf:Description> +</rdf:RDF> |