https://wiki.contextgarden.net/api.php?action=feedcontributions&user=Kurds&feedformat=atomWiki - User contributions [en]2024-03-29T09:10:35ZUser contributionsMediaWiki 1.34.1https://wiki.contextgarden.net/index.php?title=Description&diff=7445Description2007-03-03T01:34:40Z<p>Kurds: </p>
<hr />
<div>LATEX DIAPER</div>Kurdshttps://wiki.contextgarden.net/index.php?title=System_Macros&diff=7444System Macros2007-03-03T01:34:22Z<p>Kurds: </p>
<hr />
<div>WEED WHACKER</div>Kurdshttps://wiki.contextgarden.net/index.php?title=System_Macros/Loops_and_Recursion&diff=7443System Macros/Loops and Recursion2007-03-03T01:33:58Z<p>Kurds: </p>
<hr />
<div>< '''Prev:''' [[System Macros/Branches and Decisions|Brances & Decisions]] | '''Top:''' [[System Macros]] | '''Next:''' [[System Macros/Action Processing|Action Processing]] ><br />
<br />
PLAY WITH AN XBOX<br />
=== <cmd>dorecurse</cmd> ===<br />
<texcode><br />
\dorecurse {n} {whatever we want}<br />
</texcode><br />
<br />
This macro can be nested without problems and therefore be<br />
used in situations where Plain TeX's <code>\loop</code> macro<br />
ungracefully fails. The current value of the counter is<br />
available in <code>\recurselevel</code>, before as well as after<br />
the <code>whatever we want</code> stuff.<br />
<br />
<context source="yes"><br />
\dorecurse % inner loop<br />
{10}<br />
{\recurselevel: % outer value<br />
\dorecurse % inner loop<br />
{\recurselevel} % outer value<br />
{\recurselevel} % inner value<br />
\dorecurse % inner loop<br />
{\recurselevel} % outer value<br />
{\recurselevel} % inner value<br />
\endgraf}<br />
</context><br />
<br />
In this example the first, second and fourth<br />
<code>\recurselevel</code> concern the outer loop, while the third<br />
and fifth one concern the inner loop. The depth of the<br />
nesting is available for inspection in <code>\recursedepth</code>.<br />
<br />
Both <code>\recurselevel</code> and <code>\recursedepth</code> are<br />
macros. The real conters are hidden from the user because<br />
we don't want any interference.<br />
<br />
<br />
=== <cmd>dostepwiserecurse</cmd> ===<br />
The simple command <code>\dorecurse</code> is<br />
a special case of the more general:<br />
<br />
<texcode><br />
\dostepwiserecurse {from} {to} {step} {action}<br />
</texcode><br />
<br />
This commands accepts positive and negative steps. Illegal<br />
values are handled as good as possible and the macro accepts<br />
numbers and counters.<br />
<br />
<texcode><br />
\dostepwiserecurse {1} {10} {2} {...}<br />
\dostepwiserecurse {10} {1} {-2} {...}<br />
</texcode><br />
<br />
=== <cmd>doloop</cmd> <cmd>exitloop</cmd> ===<br />
Sometimes loops are not determined by counters, but by<br />
(a combinations of) conditions. We therefore implement a<br />
straightforward loop, which can only be left when we<br />
explictly exit it. Nesting is supported. First we present<br />
a more extensive alternative.<br />
<br />
<texcode><br />
\doloop<br />
{Some kind of typesetting punishment \par<br />
\ifnum\pageno>100 \exitloop \fi}<br />
</texcode><br />
<br />
When needed, one can call for <code>\looplevel</code> and<br />
<code>\loopdepth</code>.<br />
<br />
The loop is executed at least once, so beware of situations<br />
like:<br />
<br />
<texcode><br />
\doloop {\exitloop some commands}<br />
</texcode><br />
<br />
It's just a matter of putting the text into the <code>\if</code><br />
statement that should be there anyway, like in:<br />
<br />
<texcode><br />
\doloop {\ifwhatever \exitloop \else some commands\fi}<br />
</texcode><br />
<br />
You can also quit a loop immediately, by using <code><br />
\exitloopnow</code> instead. Beware, this is more sensitive<br />
for conditional errors.<br />
<br />
< '''Prev:''' [[System Macros/Branches and Decisions|Brances & Decisions]] | '''Top:''' [[System Macros]] | '''Next:''' [[System Macros/Action Processing|Action Processing]] ><br />
<br />
[[Category:ConTeXt programming]]<br />
[[Category:Inside ConTeXt]]</div>Kurdshttps://wiki.contextgarden.net/index.php?title=Dotted_number_in_caption&diff=7440Dotted number in caption2007-03-03T01:32:48Z<p>Kurds: </p>
<hr />
<div>fdagjklhaklasjdfklasjdfklsjdaklgjfdgklnaskljfdsklafnajvklhajrtlh <(-_-)^</div>Kurdshttps://wiki.contextgarden.net/index.php?title=How_to_make_a_MyWay&diff=7439How to make a MyWay2007-03-03T01:32:00Z<p>Kurds: </p>
<hr />
<div>SMOKE<br />
<br />
<br />
<texcode><br />
\usemodule[mag-01]<br />
<br />
% Substitute the text between <+...+> <br />
\setvariables<br />
[magazine]<br />
[ title=<+Title of MyWay+>,<br />
author=<+Name of author+>,<br />
affiliation=<+Affiliation of author+>,<br />
date=<+date of publication+>,<br />
]<br />
<br />
\startbuffer[abstract]<br />
<+Abstract of MyWay+><br />
\stopbuffer<br />
<br />
\setupheadertexts[section] <br />
<br />
\starttext \setups [titlepage] \setups [title]<br />
<br />
<+ Write article here +><br />
<br />
\setups [listing] %If you want the source listing of the module to be printed<br />
\setups [lastpage] \stoptext<br />
</texcode></div>Kurdshttps://wiki.contextgarden.net/index.php?title=Debian_installation&diff=7438Debian installation2007-03-03T01:31:40Z<p>Kurds: </p>
<hr />
<div>WEED</div>Kurdshttps://wiki.contextgarden.net/index.php?title=Calendar_script&diff=7437Calendar script2007-03-03T01:31:20Z<p>Kurds: </p>
<hr />
<div>TOO BAD ITS FUCKIN GONE</div>Kurds