[NTG-context] Define a new command from the command \periods[n]
Hans Hagen
pragma at wxs.nl
Mon Jan 19 10:35:01 CET 2015
On 1/18/2015 10:01 PM, Fabrice wrote:
> Hi Hans,
> The size of the float does not center the frame unless I replace by
> \dorecurse{5}{\filler[dots]} by \dorecurse{10}{\filler[dots]}.
> Is there a better way ?
> Thanks,
> Fabrice
>
>> % macros=mkvi
>>
>> \definefiller[dots][left=\dontleavehmode,right=\hskip\zeropoint\par]
>>
>> \definefloat
>> [recipe]
>> [figure]
>>
>> \setupfloat
>> [recipe]
>> [default={right,none}]
>>
>> \defineframed
>> [myframed]
>> [width=6cm,
>> foregroundstyle={\switchtobodyfont[10pt]},
>> align={high,flushleft},
>> frame=on,
>> framecolor=red,
>> background=color,
>> backgroundcolor=lightgray]
>>
>> \definecolor[Border][c=0.00, m=0.00, y=0.00, k=0.25]
>>
>> \startuniqueMPgraphic{borderline}
>> path p ; p := unitsquare xscaled \overlaywidth yscaled \overlayheight ;
>> draw p withcolor \MPcolor{Border} dashed evenly withpen pencircle scaled
>> 1.2pt ;
>> \stopuniqueMPgraphic
>>
>> \defineoverlay[borderline][\uniqueMPgraphic{borderline}]
>>
>> \defineframedtext
>> [Myframed]
>> [width=0.6\textwidth,
>> foregroundstyle={\switchtobodyfont[10pt]},
>> align={high,flushleft},
>> frame=off,
>> framecolor=0.625white,
>> background=borderline,
>> location=middle,
>> offset=.5ex]
>>
>> \starttext
>>
>> \startbuffer
>> Ingrédients (pour 4 personnes)
>> \startitemize[1]
>> \startitem \unit{1 kg} de pommes de terre \stopitem
>> \startitem \unit{60 g} de fromage râpé \stopitem
>> \startitem \unit{25 Centiliter} de crème fraîche \stopitem
>> \stopitemize
>> \stopbuffer
>>
>> \placerecipe
>> {}
>> {\myframed{\getbuffer}}
>>
>> \startitemize[n][stopper={.},style=bold]
>> \startitem
>> \dorecurse{5}{\filler[dots]}
>> \stopitem
>> \stopitemize
>>
>> \startbuffer
>> \input ward
>> \stopbuffer
>> \startMyframed
>> \getbuffer
>> \stopMyframed
>>
>> \stoptext
\placerecipe
{}
{\myframed{\getbuffer}}
\startitemize[n][stopper={.},style=bold]
\startitem
\dorecurse{5}{\filler[dots]}
\stopitem
\stopitemize
\flushsidefloats
-----------------------------------------------------------------
Hans Hagen | PRAGMA ADE
Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
| www.pragma-pod.nl
-----------------------------------------------------------------
More information about the ntg-context
mailing list