\dorecurse{10}{\input zapf\par}
}
\stopcolor
\stopoutputstream
\synchronizestreams[one,two]
\setbox\scratchboxone\outputstreambox[one]
\setbox\scratchboxtwo\outputstreambox[two]
\doloop
{\ifvoid\scratchboxone
\exitloop
\else
\setbox\scratchboxfour\vsplit\scratchboxone to \textheight
\vbox to \vsize{\bo
treams[one,two]
\setbox\scratchboxone\outputstreambox[one]
\setbox\scratchboxtwo\outputstreambox[two]
\doloop
{\ifvoid\scratchboxone
\exitloop
\else
\setbox\scratchboxfour\vsplit\scratchboxone to \textheight
\vbox to \vsize{\box\scratchboxfour\vss}%
\setbox\scratchboxfive\vsplit\scratchboxtwo to \te
}
}
\stopcolor
\stopoutputstream
\synchronizestreams[one,two]
\setbox\scratchboxone\outputstreambox[one]
\setbox\scratchboxtwo\outputstreambox[two]
\doloop
{\ifvoid\scratchboxone
\exitloop
\else
\setbox\scratchboxfour\vsplit\scratchboxone to \textheight
\vbox to \vsize{\box
}
\stopcolor
\stopoutputstream
\startoutputstream[two]
\startcolor[green]
\dorecurse{5}{\chapter{Stream Two}
\dorecurse{10}{\input zapf\par}
}
\stopcolor
\stopoutputstream
\synchronizestreams[one,two]
\setbox\scratchboxone\outputstreambox[one]
\setbox\scratchboxtwo\outputstrea
\stopoutputstream
\synchronizestreams[one,two]
\setbox\scratchboxone\outputstreambox[one]
\setbox\scratchboxtwo\outputstreambox[two]
\doloop
{\ifvoid\scratchboxone
\exitloop
\else
\setbox\scratchboxfour\vsplit\scratchboxone to\textheight
\vbox to\vsize{\box\scratchboxfour\vss}%
\setbox
color
\stopoutputstream
\synchronizestreams[one,two]
\setbox\scratchboxone\outputstreambox[one]
\setbox\scratchboxtwo\outputstreambox[two]
\doloop
{\ifvoid\scratchboxone
\exitloop
\else
\setbox\scratchboxfour\vsplit\scratchboxone to \textheight
\vbox to \vsize{\box\scratchboxfour\vss}%
\s
}}
\stoptext
You can of course adapt the font size instead but as it's just stickers
the above is probably good enough, but you can do this:
\begingroup
\doloop {
\setbox\scratchbox\hbox\bgroup\framed
[align={flushleft},strut=no]
{\startlines[before=,after=]
\getbuffer
}\input zapf\footnote{note}\par\pushoutputstream}
\stopcolor
\stopoutputstream
\synchronizestreams[one,two]
\setbox\scratchboxone\outputstreambox[one]
\setbox\scratchboxtwo\outputstreambox[two]
\input zapf\page
\doloop
{\ifvoid\scratchboxone
\exitloop
\else
typeset each time. When we're okay
with the fit (naturalwidth == less than max width) we quit. We can
assume that spaces have enough stretch to deal with the close fit.
\protected\def\makeitfit#1#2#3%
{\begingroup
\hsize#1\relax
\setbox\scratchboxone\hbox\bgroup#3\egroup
\doloop
put this on cont-new.mkxl as test:
\unprotect
\defcsname\??xtableflushsplit\v!repeat\endcsname
{\doloop
{\clf_x_table_flush
method {\v!split}%
height
\ifdim\pagegoal=\maxdimen\textheight\else\dimexpr\pagegoal-\pagetotal\relax\fi
\relax
\ifcase\c_tabl_x_state
\??xtableflushsplit\v!repeat\endcsname
{\doloop
{\clf_x_table_flush
method {\v!split}%
height
\ifdim\pagegoal=\maxdimen\textheight\else\dimexpr\pagegoal-\pagetotal\relax\fi
\relax
\ifcase\c_tabl_x_state
\exitloop
\else
\page
\fi
put this on cont-new.mkxl as test:
\unprotect
\defcsname\??xtableflushsplit\v!repeat\endcsname
{\doloop
{\clf_x_table_flush
method {\v!split}%
height
\ifdim\pagegoal=\maxdimen\textheight\else\dimexpr\pagegoal-\pagetotal\relax\fi
\relax
\ifcase\c_tabl_x_state
can put this on cont-new.mkxl as test:
\unprotect
\defcsname\??xtableflushsplit\v!repeat\endcsname
{\doloop
{\clf_x_table_flush
method {\v!split}%
height
\ifdim\pagegoal=\maxdimen\textheight\else\dimexpr\pagegoal-\pagetotal\relax\fi
\relax
\ifcase\c_tabl_x_sta
Hi,
I tried to make a table using \dorecurse or \doloop as in the example.
There is no error but \recurselevel is not increased, all are 0 in the first
example and only two rows are created with the \recurselevel 0 and 2 only in
the second example.
Does the tabulate cause the error?
What
On Mon, 21 Sep 2020, Wolfgang Schuster wrote:
> Aditya Mahajan schrieb am 21.09.2020 um 16:35:
> > On Mon, 21 Sep 2020, Jeong Dal wrote:
> >
> > > Hi,
> > >
> > > I tried to make a table using \dorecurse or \doloop as in the example.
> > > T
\dorecurse{8}
{\startxrow\startxcell \recurselevel \stopxcell\stopxrow}
\stopxtable
\stoptext
Best regards: Otared K.
> On 21 Sep 2020, at 16:07, Jeong Dal wrote:
>
> Hi,
>
> I tried to make a table using \dorecurse or \doloop as in the example.
> There is no error
Aditya Mahajan schrieb am 21.09.2020 um 16:35:
On Mon, 21 Sep 2020, Jeong Dal wrote:
Hi,
I tried to make a table using \dorecurse or \doloop as in the example.
There is no error but \recurselevel is not increased, all are 0 in the first
example and only two rows are created
2020 a la(s) 09:16, Jeong Dal (hak...@me.com)
escribió:
> Hi,
>
> I tried to make a table using \dorecurse or \doloop as in the example.
> There is no error but \recurselevel is not increased, all are 0 in the
> first example and only two rows are created with the \recurselevel
On Mon, 21 Sep 2020, Jeong Dal wrote:
> Hi,
>
> I tried to make a table using \dorecurse or \doloop as in the example.
> There is no error but \recurselevel is not increased, all are 0 in the first
> example and only two rows are created with the \recurselevel 0 and 2 only i
NoteOverflow\box\scratchbox
\setbox\scratchbox\vsplit \MyNoteOverflow to \scratchdimen
\fi
\vbox
\bgroup
\topskipcorrection
\unvbox\scratchbox
\vfilll
\egroup
\stopsetups
\startsetups notaflus
low to \scratchdimen
\fi
\vbox\bgroup
\topskipcorrection
\unvbox\scratchbox
\vfilll
\egroup
\stopsetups
\startsetups notaflush
\doloop {
\page
\ifvoid\MyNoteOverflow
\exitloop
\else
\null \page
\dorecurse{10}{\input zapf\par}
\stopcolor
\stopoutputstream
\synchronizestreams[one,two]
\setbox\scratchboxone\outputstreambox[one]
\setbox\scratchboxtwo\outputstreambox[two]
\doloop
{\ifvoid\scratchboxone
\exitloop
\else
\setbox\scratchboxfour\vsplit\scratchbox
[green]
\dorecurse{10}{\input zapf\par}
\stopcolor
\stopoutputstream
\synchronizestreams[one,two]
\setbox\scratchboxone\outputstreambox[one]
\setbox\scratchboxtwo\outputstreambox[two]
\doloop
{\ifvoid\scratchboxone
\exitloop
\else
\setbox\scratchboxfour\vsplit\scratch
{mail.csv}
\doloop{\ifnotEOF\getbuffer[text-content]\nextrow\else\exitloop\fi} %OK
\stoptext
Contents of mail.csv:
ME;11/10/14
You;05/02/14
She;03/03/12
It;03/03/14
t-scancsv.lua can be found at
http://public.hajtmar.com/files/TeX/context/t-scancsv_ConTeXt_module/t-scancsv.lua
]
\dorecurse{17}{\input zapf\par}
\cA\hfill
\cB
\page
\stopbuffer
\opencsvfile{mail.csv}
\doloop{\ifnotEOF\getbuffer[text-content]\nextrow\else\exitloop\fi} %OK
\stoptext
Contents of mail.csv:
ME;11/10/14
You;05/02/14
She;03/03/12
It;03/03/14
t-scancsv.lua can be found
]
\dorecurse{17}{\input zapf\par}
\cA\hfill
\cB
\page
\stopbuffer
\opencsvfile{mail.csv}
\doloop{\ifnotEOF\getbuffer[text-content]\nextrow\else\exitloop\fi} %OK
\stoptext
Contents of mail.csv:
ME;11/10/14
You;05/02/14
She;03/03/12
It;03/03/14
t-scancsv.lua can be found at
http
Do \luaexpr{1/3.8} and \ctxcommand{format(@0.3f,1/3.8)} return numbers or
strings? That is, I would like to use these results in a \if or \ifnum
command to exit a \doloop.
Troy
___
If your question is of interest
Le 20 déc. 12 à 05:43, Troy Henderson a écrit :
Do \luaexpr{1/3.8} and \ctxcommand{format(@0.3f,1/3.8)} return
numbers or strings? That is, I would like to use these results in a
\if or \ifnum command to exit a \doloop.
Troy
Bonjour,
\ctxlua{context(type(\luaexpr{1/3.8}))} gives
On 12/19/2012 7:43 PM, Troy Henderson wrote:
Do \luaexpr{1/3.8} and \ctxcommand{format(@0.3f,1/3.8)} return numbers
or strings? That is, I would like to use these results in a \if or
\ifnum command to exit a \doloop.
they return tokens i.e.
\ifnum\luaexpr{math.round(1/3.8)}1\relax
should
On 12/19/2012 8:19 PM, Roland Thiers wrote:
Le 20 déc. 12 à 05:43, Troy Henderson a écrit :
Do \luaexpr{1/3.8} and \ctxcommand{format(@0.3f,1/3.8)} return
numbers or strings? That is, I would like to use these results in a
\if or \ifnum command to exit a \doloop.
Troy
Bonjour,
\ctxlua
···date: 2012-12-19, Wednesday···from: Troy Henderson···
Do \luaexpr{1/3.8} and \ctxcommand{format(@0.3f,1/3.8)} return numbers or
strings? That is, I would like to use these results in a \if or \ifnum
command to exit a \doloop.
Fwiw there are Lua-side conditionals available as well:
http
On 12/19/2012 9:13 PM, Troy Henderson wrote:
I got this to work. There's probably a better method though ;)
\edef\r{\luaexpr{1/3.8}}
\edef\q{1}\doloop{\ctxlua{commands.doifelse(math.abs(\q*\r -
math.floor(\q*\r+0.5))0.01)}{\exitloop}{\edef\q{\luaexpr{\q+1
Yes, you need to think more
)
\edef\N{10} % Number of frames in animation per hypocycloid branch
\edef\K{1}\doloop{\ctxlua{commands.doifelse(math.abs(\K*\r -
math.floor(\K*\r+0.5))0.01)}{\exitloop}{\edef\K{\luaexpr{\K+1
\startMPinclusions[+]
r:=\r; % Radius of smaller circle (larger circle has radius 1)
u:=70
this?
\starttext
\setbox0\vbox{\input ward\par}
\doloop
{\setupinterlinespace[line=2.8ex]
\ifdim\ht0\lineheight
\setupinterlinespace[line=4.2ex]
\box0
\exitloop
\else
\setbox2\vsplit0 to \baselineskip
\box2
\fi}
\stoptext
Wolfgang
, the TOC is 4.2ex,
but when a long title is on multiple lines it should stick together (2.8ex).
You want something like this?
\starttext
\setbox0\vbox{\input ward\par}
\doloop {\setupinterlinespace[line=2.8ex] \ifdim\ht0\lineheight
\setupinterlinespace[line=4.2ex] \box0 \exitloop \else
% Or loop cycle
\opencsvfile{file2.csv}
\doloop{\ifnotEOF\getbuffer[myletter]\nextrow\else\exitloop\fi} %OK
\stoptext
Dne 29.8.2010 2:34, Jaroslav Hajtmar napsal(a):
Hello,
Can be deployed print letters due t-letter module in the cycle?
When I use recursion, then an error occurs.
I note that I
that this will
have any side effects.
no, it's just the last value; of course i can set it to zero
recurselevel is also known inside \doloop so there it makes sense to
have it afterrwards (or when using \exitloop in any case)
Hans
\fastrecursecounter rather than 0. I don't think that this will have
any side effects.
no, it's just the last value; of course i can set it to zero
recurselevel is also known inside \doloop so there it makes sense to have it
afterrwards (or when using \exitloop in any case)
Both \dorecurse and \doloop
\dosetfilterlevel\normaldosetfilterlevel
\global\let\glocalpublist\empty
\doloop
{\doifdefinedelse
{\r!cross cite-\jobname-\recurselevel}
{\doifreferencefoundelse
{cite-\jobname-\recurselevel}
{...@ea\doifreglevelelse\@EA[\currentlocationreference
\else \repeat
I think the loop structure should be:
\loop ... \if... ... \repeat
just use:
\doloop {
\ifwhateveryoulike
\exitloop
\fi
}
-
Hans Hagen | PRAGMA ADE
...\expandafter \@@plniterate \else
\fi
\myloop ...by 1 \ifnum \tempcnta #1\else \repeat
I think the loop structure should be:
\loop ... \if... ... \repeat
just use:
\doloop {
\ifwhateveryoulike
\exitloop
\fi
Hans,
Thanks, that works. But shouldn't the other one work
.
\@@plniterate ...\expandafter \@@plniterate \else
\fi
\myloop ...by 1 \ifnum \tempcnta #1\else \repeat
I think the loop structure should be:
\loop ... \if... ... \repeat
just use:
\doloop {
\ifwhateveryoulike
\exitloop
\fi
Hans,
Thanks, that works. But shouldn't the other one work as well
doloop. Documentations from syst-ext.tex
%D \macros
%D {doloop,exitloop}
%D
%D Sometimes loops are not determined by counters, but by
%D (a combinations of) conditions. We therefore implement a
%D straightforward loop, which can only be left when we
%D explictly exit it. Nesting is supported
, no. The backreferences are in saved in the tuo file, but
I never got around to writing the integration code for it.
In case someone is interested in writing that, it needs a loop like
this one:
\unprotect
\def\getpagelist#1%
{\let\pagelist \empty
\def\currentbibitem{#1}%
\doloop
{\setbox\cover\vbox
{\hsize\coverwidth
\definedfont[Serif at \the\coverfont]\setupinterlinespace
\setupalign[nothyphenated]
\emergencystretch\maxdimen
\getbuffer[cover]}}
\def\covertext
{\boxsize\doloop
{\boxsize
\ifdim\ht\cover\coverheight
\global
# \doifXMLop
# \doifXMLparelse
# \doloop
# \donothing
# \dontleavehmode
\donttest
# \dorecurse
# \dostepwiserecurse
# \dowithnextbox
# \dowithnextboxcontent
# \empty
\emptylines[number]
# \emptytoks
# \enablemode
# \endstrut
\enumeration
# \environment
# \EQ
# \eTABLE
# \eTABLEbody
# \eTABLEfoot
\tsplitinbetweenheight{\the\htdp\scratchbox}% etex
\!!doneafalse
\doloop
{\ifinsidecolumns
% brrr, assumes empty columns
\global\setfalse\tsplitfirstdone
\splitrotation
\!!donectrue
\else
\ifconditional\tsplitfirstdone
\splitrotation
\newdimen\CellHeightOne \CellHeightOne=\lineheight %% synch with grid
\newdimen\TestDim
\long\def\CellContent#1{%
\setbox100=\vbox{\hsize=\CellWidth%
#1}
\dp100=0pt%
\TestDim=\CellHeightOne
\doloop{%30
\ifdim\ht100\TestDim%
\setbox100=\vbox to \TestDim{\hsize=\CellWidth \recurselevel #1}\exitloop\fi
horizontal\docombinepagesvertical#1 % watch the #1 ;-) \@@ipafter \egroup}
% we work from left to right and from top to bottom
\def\docombinepageshorizontal#1 {\if!!donea \doloop {\vbox to \textheight {\hsize\textwidth % ? ? \scratchdimen\@@ipdistance \!!widtha \dimexpr(\hsize-\@@ipnx\scratchdimen+\sc
doneafalse\!!doneatrue
\if!!donea \doifelse\@@ipdirection\v!horizontal % added % loop for left to right and top to bottom combination {\doloop {\vbox to \textheight {\hsize\textwidth % ? ?
\scratchdimen\@@ipdistance \!!widtha \dimexpr(\hsize-\@@ipnx\scratchdimen+\scratchdimen)/\@@ipnx\relax \!!heigh
$,$\ast$]
\defineconversion[def][m,o,j,c,a]
\doloop
{\doifelseconversionnumber{abc}{\recurselevel}
{[abc \recurselevel\space defined]}
{\exitloop}}
\doloop
{\doifelseconversionnumber{def}{\recurselevel}
{[def \recurselevel\space defined]}
{\exitloop
can still hardcode 25 and wait
until someone complains that that is not enough to satisfy his/her
needs.)
\unprotect
\def\doifelseconversionnumber#1#2%
{\doifdefinedelse{\??cv#1#2}}
\protect
\defineconversion[abc][$\star$,$\bullet$,$\ast$]
\defineconversion[def][m,o,j,c,a]
\doloop
might be different
if necessary) to
\reuseMPgraphic{gpg:name:1}
\reuseMPgraphic{gpg:name:3}
(with proper scaling if possible).
you want all graphics?
\def\usemygraphic#1%
{\doloop
{\doifMPgraphicelse{gpg:#1:\recurselevel}
{\reuseMPgraphic{gpg:name:\recurselevel
}}
and \usemygraphic[name][n={1,3},width=8cm] (syntax might be different
if necessary) to
\reuseMPgraphic{gpg:name:1}
\reuseMPgraphic{gpg:name:3}
(with proper scaling if possible).
you want all graphics?
\def\usemygraphic#1%
{\doloop
{\doifMPgraphicelse{gpg:#1:\recurselevel
}{\useMPgraphic{gpg:othername:\recurselevel}}
and \usemygraphic[name][n={1,3},width=8cm] (syntax might be different
if necessary) to
\reuseMPgraphic{gpg:name:1}
\reuseMPgraphic{gpg:name:3}
(with proper scaling if possible).
you want all graphics?
\def\usemygraphic#1%
{\doloop
{\forgetall
\dontcomplain
\doloop
{\setbox2\vsplit\nextbox to \lineheight
\setbox2\vbox{\unvbox2}
\ifdim\ht2\lineheight
\incrementnumber[\??si]%
\ifcase\rawnumber[\??si]\or \ifdim\nextboxht=\zeropoint
\let
becomes \goodbreak
\dowithnextbox
{\forgetall
\dontcomplain
\doloop
{\setbox2\vsplit\nextbox to \lineheight
\setbox2\vbox{\unvbox2}
\ifdim\ht2\lineheight
\incrementnumber[\??si]%
\ifcase\rawnumber[\??si]\or \ifdim
]%
\resetnumber[\??si]%
\def\floatcaptionsuffix{\convertednumber[\??si]}%
\TABLEcaptionheight\@@silines\lineheight % brrr
\simplifypagebreak % \page becomes \goodbreak
\dowithnextbox
{\forgetall
\dontcomplain
\doloop
{\setbox2\vsplit\nextbox to \lineheight
\dontcomplain
\doloop
{\setbox2\vsplit\nextbox to \lineheight
\setbox2\vbox{\unvbox2}
\ifdim\ht2\lineheight
\incrementnumber[\??si]%
\ifcase\rawnumber[\??si]\or \ifdim\nextboxht=\zeropoint
\let\floatcaptionsuffix\empty
\dowithnextbox
{\forgetall
\dontcomplain
\doloop
{\setbox2\vsplit\nextbox to \lineheight
\setbox2\vbox{\unvbox2}
\ifdim\ht2\lineheight
\incrementnumber[\??si]%
\ifcase\rawnumber[\??si]\or \ifdim\nextboxht
\dontcomplain
\doloop
{\setbox2\vsplit\nextbox to \lineheight
\setbox2\vbox{\unvbox2}
\ifdim\ht2\lineheight
\incrementnumber[\??si]%
\ifcase\rawnumber[\??si]\or \ifdim\nextboxht=\zeropoint
\let\floatcaptionsuffix\empty
Hans Hagen wrote:
Vit Zyka wrote:
Hans Hagen wrote:
Vit Zyka wrote:
ah ... your persistent ...
yes, slow but persistent (hopefully not annoying...)
you can try this:
\OTRSEToutput
{\dontcomplain % new, get rid of overfull message (to be sorted out)
\doloop
Vit Zyka wrote:
Hans Hagen wrote:
Vit Zyka wrote:
ah ... your persistent ...
you can try this:
\OTRSEToutput
{\dontcomplain % new, get rid of overfull message (to be sorted out)
\doloop
{\OTRSETnaturalflush
%\OTRSETstartnextpage % no
\OTRSETdoflushfloats
from 1 to 9, step 1
\setvalue{PREFIX\recurselevel}{\recurselevel}
}
% or all by hand (not useful for simple loops)
\newcounter\Row % Row=0
\increment\Row % Row+=1
\doloop{%
\setvariables[PREFIX\Row][foo=foo\Row]
\increment\Row
\ifnum\Row9 \exitloop\fi
}
% reset to one by hand
\newcounter
depends a bit it); think
of something
\doloop{
\setbox\scratchbox=\vbox
{the content of the label}
\ifx\ht\scratchbox10cm
\switchtobodyfont[small]
\else
\unvbox\scratchbox
\exitloop
\fi
}
Hans
___
ntg-context mailing list
as fast as normal
how does your current code look? (the solution depends a bit it);
think of something
\doloop{
\setbox\scratchbox=\vbox
{the content of the label}
\ifx\ht\scratchbox10cm
\switchtobodyfont[small] \else
\unvbox\scratchbox
\exitloop
\fi
}
Hans
of manual
trial and error.
this is something tex is pretty good at and it runs as fast as normal
how does your current code look? (the solution depends a bit it);
think of something
\doloop{
\setbox\scratchbox=\vbox
{the content of the label}
\ifx\ht\scratchbox10cm
!!
\def\AutoSize#1#2#3{%
% #1=string #2=horiz.limit #3=initial font size
\newdimen\Limit \Limit=#2
\newdimen\FontSize \FontSize=#3
\doloop{%
\setbox800=\hbox{#1}%
\ifdim\wd800 \Limit\exitloop
\else
% WARNING: eat memory , 1bp is bad step,
% force ss it's wrong
\advance\FontSize by -1bp
% AutoSize seem better, but
% I must setup ss and tfb inside body
% (I need these) so it's no a general macros
% Same problems of previous version.
%
\def\AutoSize#1#2#3{% #1=string #2=horiz.limit #3=startfont
\newdimen\Limit \Limit=#2 %
\newdimen\FontSize \FontSize=#3 %
\doloop{%
\setbox800=\hbox
\synchronizeoutput % fails on example
% \allowbreak % hm
\fi
\synchronizenotes
\fi}
\def\OTRSETdoflushfloats
{\bgroup
\def\OTRSETsavebox##1{\!!doneafalse}%
\doloop
{\ifsomefloatwaiting
\OTRSETskipstart
\dogetfloat
\ifdim\wd\floatbox\zeropoint
from \@@ipstart\space to \@@ipstop}%
\let\currentip\@@ipstart%
\decrement\currentip
\doloop
{\increment\currentip\relax
% \write16{Inserting page \currentip}%
\dofilterpage{#1}\currentip
\doifinset\currentip{#2}{\null\page}%
\ifnum\currentip=\@@ipstop\exitloop \fi
}[fig:exceptionhierarchy] shows the
hierarchy for ...
The following error trace occurs (TeXShop):
floatblocks: 1 placed
! Undefined control sequence.
\doloop ...ndcsname \recurselevel \let \endofloop
\dodoloop \dodoloop 1
\removeunwantedspaces ...kip \else \exitloop \fi }
\fi
argument> ...\ignorespa
\fi
\doloop ...@@arecurse \recursedepth \endcsname {#1
}\global [EMAIL PROTECTED] \let
\csname...
\removeunwantedspaces ...kip \else \exitloop \fi }
\fi
\endstrut ...trut \fi \else
73 matches
Mail list logo