Changes

Jump to navigation Jump to search
1,062 bytes added ,  22:32, 30 December 2005
Added section about setups
\TextWithSpaces{A gap from here to there!}
</context>
 
 
 
== Setups ==
In ConTeXt it is easy to create local variables and grouping. Local variables can be simulated as in:
 
<texcode>
\startsetups whatever
% some useful definitions here
\stopsetups
 
\definestartstop[whatever][commands=\setups{whatever}]
 
\startwhatever
Using definitions here.
\stopwhatever
</texcode>
 
But you can place setups almost everywhere and environment will not be affected by their execution. It is useful to wrap overlay definitions and such in setups as in (copied from [[Colorful_CD_Inlay]] page):
 
<texcode>
\defineoverlay [origin] [\setups{origin}]
 
\startsetups origin
\vbox to \overlayheight {
\vfill\tfxx\setstrut
\hsize\overlaywidth
\hfill Fiona Apple\enspace EM\enspace2005\quad\strut\endgraf
\kern1ex
}
\stopsetups
</texcode>
 
You can even do things like:
 
<texcode>
\starttext
\startsetups settest
\def\command{do something with}
I want to \command{} command.
\stopsetups
 
\start
\setups{settest}
\stop
 
\command aaa % will give "undefined control sequence" error
 
\stoptext
</texcode>
[[Category:Inside ConTeXt]]
Anonymous user

Navigation menu