ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Fabrice <couvreur.fabrice@wanadoo.fr>
To: ntg-context@ntg.nl
Subject: Re: Define a new command from the command \periods[n]
Date: Sun, 18 Jan 2015 22:01:47 +0100	[thread overview]
Message-ID: <54BC1F3B.6040700@wanadoo.fr> (raw)
In-Reply-To: <54AB06F3.9080300@wxs.nl>

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

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

  parent reply	other threads:[~2015-01-18 21:01 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-20  8:30 Fabrice Couvreur
2014-05-20  8:47 ` luigi scarso
2014-05-20 12:46   ` Wolfgang Schuster
2014-05-20 17:50     ` Fabrice
2014-05-20 18:05       ` Wolfgang Schuster
2014-05-20 20:48         ` Fabrice
2015-01-05 17:58         ` Fabrice
2015-01-05 21:49           ` Hans Hagen
2015-01-06 10:01             ` Alan BRASLAU
2015-01-18 21:01             ` Fabrice [this message]
2015-01-19  9:35               ` Hans Hagen
2015-01-19 16:13                 ` Fabrice
2015-01-06 11:28 Couvreur Fabrice
2015-01-06 11:29 Couvreur Fabrice

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=54BC1F3B.6040700@wanadoo.fr \
    --to=couvreur.fabrice@wanadoo.fr \
    --cc=ntg-context@ntg.nl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).