ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Space between both environments
@ 2015-09-07 17:35 Fabrice Couvreur
  2015-09-07 18:43 ` Otared Kavian
  2015-09-07 19:02 ` Wolfgang Schuster
  0 siblings, 2 replies; 6+ messages in thread
From: Fabrice Couvreur @ 2015-09-07 17:35 UTC (permalink / raw)
  To: mailing list for ConTeXt users


[-- Attachment #1.1: Type: text/plain, Size: 2219 bytes --]

Hi,
I can not insert a space between my two environments.
Thank you.
Fabrice

% macros=mkvi

\setupcolors[state=start]


\definecolor[MyColorA][c=0.00, m=0.10, y=0.20, k=0.00]

\definecolor[MyColorB][c=0.00, m=0.62, y=1.00, k=0.00]

\definecolor[MyColorC][c=0.3, m=0.00, y=0.00, k=0.05]

\definecolor[MyColorD][c=0.6, m=0.00, y=0.00, k=0.10]


\defineframedtext
  [MyDefinition]
  [before={\blank},
   after={\blank},
   frame=off,
   background=MyFrame,
   width=\textwidth,
   height=fit,
   location=left,
   style=italic]

\defineoverlay
  [MyFrame]
  [\useMPgraphic{MyFrame}]

\definelabel
  [Définition]
  [headstyle=\bf\smallcaps]

\startuseMPgraphic{MyFrame}
    path b ;
    picture p ;
    p := textext.rt("\white\Définition") ;
    p := p shifted (2BodyFontSize,OverlayHeight-ypart center p+.25ExHeight)
;
    b := boundingbox p leftenlarged .5EmWidth rightenlarged .5EmWidth ;
    fill OverlayBox withcolor \MPcolor{MyColorA} ;
    fill b withcolor \MPcolor{MyColorB} ;
    draw p ;
\stopuseMPgraphic


\definemixedcolumns
  [myColumn]
  [n=2,
   separator=rule,
   rulecolor=MyColorC,
   rulethickness=1pt,
   balance=yes]

\setupalign[verytolerant,stretch,hanging]


\defineoverlay
  [Funny]
  [\useMPgraphic{Funny}]

\definelabel
  [MÉTHODE]
  [headstyle=\bf\smallcaps]

\startuseMPgraphic{Funny}
    interim linejoin := mitered ;
    interim linecap := squared ;
    path b ;
    picture p ;
    p := textext.rt("\white\MÉTHODE") ;
    p := p shifted (0,OverlayHeight) ;
    b := boundingbox p ;
    drawoptions (withpen pencircle scaled 3mm withcolor \MPcolor{MyColorC})
;
    draw leftboundary OverlayBox ;
    fill b withcolor \MPcolor{MyColorD} ;
    draw p ;
    setbounds currentpicture to OverlayBox ;
\stopuseMPgraphic

\defineframedtext
  [Methode]
  [before={\blank},
   after={\blank},
   frame=off,
   background=Funny,
   width=\textwidth,
   height=fit,
   ]



\starttext

\startMyDefinition
\input knuth
\stopMyDefinition

\startMethode

\startmyColumn

\input ward

\column
\input knuth
\stopmyColumn


\stopMethode
\stopsection
\stopchapter
\stoppart
\stoptext

[-- Attachment #1.2: Type: text/html, Size: 2917 bytes --]

[-- Attachment #2: Type: text/plain, Size: 485 bytes --]

___________________________________________________________________________________
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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Space between both environments
  2015-09-07 17:35 Space between both environments Fabrice Couvreur
@ 2015-09-07 18:43 ` Otared Kavian
  2015-09-07 19:02 ` Wolfgang Schuster
  1 sibling, 0 replies; 6+ messages in thread
From: Otared Kavian @ 2015-09-07 18:43 UTC (permalink / raw)
  To: mailing list for ConTeXt users


[-- Attachment #1.1: Type: text/plain, Size: 2866 bytes --]

Hi Fabrice,

You can use
	after={\strut\blank}

in your definition of MyDefinition, as in:

\defineframedtext
  [MyDefinition]
  [before={\blank},
   after={\strut\blank},
   frame=off,
   background=MyFrame,
   width=\textwidth,
   height=fit,
   location=left,
   style=italic]

Best regards: OK

> On 07 Sep 2015, at 19:35, Fabrice Couvreur <fabrice1.couvreur@gmail.com> wrote:
> 
> Hi,
> I can not insert a space between my two environments.
> Thank you.
> Fabrice
> 
> % macros=mkvi
> 
> \setupcolors[state=start]
> 
> 
> \definecolor[MyColorA][c=0.00, m=0.10, y=0.20, k=0.00]  
> 
> \definecolor[MyColorB][c=0.00, m=0.62, y=1.00, k=0.00]
> 
> \definecolor[MyColorC][c=0.3, m=0.00, y=0.00, k=0.05]
> 
> \definecolor[MyColorD][c=0.6, m=0.00, y=0.00, k=0.10]
> 
> 
> \defineframedtext
>   [MyDefinition]
>   [before={\blank},
>    after={\blank},
>    frame=off,
>    background=MyFrame,
>    width=\textwidth,
>    height=fit,
>    location=left,
>    style=italic]
> 
> \defineoverlay
>   [MyFrame]
>   [\useMPgraphic{MyFrame}]
> 
> \definelabel
>   [Définition]
>   [headstyle=\bf\smallcaps]
> 
> \startuseMPgraphic{MyFrame}
>     path b ;
>     picture p ;
>     p := textext.rt("\white\Définition") ; 
>     p := p shifted (2BodyFontSize,OverlayHeight-ypart center p+.25ExHeight) ;
>     b := boundingbox p leftenlarged .5EmWidth rightenlarged .5EmWidth ;
>     fill OverlayBox withcolor \MPcolor{MyColorA} ;
>     fill b withcolor \MPcolor{MyColorB} ;
>     draw p ;
> \stopuseMPgraphic
> 
> 
> \definemixedcolumns
>   [myColumn]
>   [n=2, 
>    separator=rule,
>    rulecolor=MyColorC,
>    rulethickness=1pt,
>    balance=yes]
> 
> \setupalign[verytolerant,stretch,hanging]
> 
> 
> \defineoverlay
>   [Funny]
>   [\useMPgraphic{Funny}]
> 
> \definelabel
>   [MÉTHODE]
>   [headstyle=\bf\smallcaps]
> 
> \startuseMPgraphic{Funny}
>     interim linejoin := mitered ;
>     interim linecap := squared ;
>     path b ;
>     picture p ;
>     p := textext.rt("\white\MÉTHODE") ; 
>     p := p shifted (0,OverlayHeight) ;
>     b := boundingbox p ;
>     drawoptions (withpen pencircle scaled 3mm withcolor \MPcolor{MyColorC}) ;
>     draw leftboundary OverlayBox ;
>     fill b withcolor \MPcolor{MyColorD} ;
>     draw p ;
>     setbounds currentpicture to OverlayBox ;
> \stopuseMPgraphic
> 
> \defineframedtext
>   [Methode]
>   [before={\blank},
>    after={\blank},
>    frame=off,
>    background=Funny,
>    width=\textwidth,
>    height=fit,
>    ]
> 
> 
> 
> \starttext
> 
> \startMyDefinition
> \input knuth
> \stopMyDefinition
> 
> \startMethode
> 
> \startmyColumn
> 
> \input ward
> 
> \column
> \input knuth
> \stopmyColumn
> 
> 
> \stopMethode
> \stopsection
> \stopchapter
> \stoppart
> \stoptext


[-- Attachment #1.2: Type: text/html, Size: 6799 bytes --]

[-- Attachment #2: Type: text/plain, Size: 485 bytes --]

___________________________________________________________________________________
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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Space between both environments
  2015-09-07 17:35 Space between both environments Fabrice Couvreur
  2015-09-07 18:43 ` Otared Kavian
@ 2015-09-07 19:02 ` Wolfgang Schuster
  2015-09-08 16:29   ` Fabrice Couvreur
  1 sibling, 1 reply; 6+ messages in thread
From: Wolfgang Schuster @ 2015-09-07 19:02 UTC (permalink / raw)
  To: mailing list for ConTeXt users


[-- Attachment #1.1: Type: text/plain, Size: 1441 bytes --]

> Fabrice Couvreur <mailto:fabrice1.couvreur@gmail.com>
> 7. September 2015 19:35
> Hi,
> I can not insert a space between my two environments.
There is a space but you can’t see it because the colored background of 
your frames is placed too low (you can see it when you use "frame=on").
> Thank you.
> Fabrice
>
> % macros=mkvi
>
> \setupcolors[state=start]
>
>
> \definecolor[MyColorA][c=0.00, m=0.10, y=0.20, k=0.00]
>
> \definecolor[MyColorB][c=0.00, m=0.62, y=1.00, k=0.00]
>
> \definecolor[MyColorC][c=0.3, m=0.00, y=0.00, k=0.05]
>
> \definecolor[MyColorD][c=0.6, m=0.00, y=0.00, k=0.10]
>
>
> \defineframedtext
>   [MyDefinition]
>   [before={\blank},
>    after={\blank},
>    frame=off,
>    background=MyFrame,
>    width=\textwidth,
>    height=fit,
>    location=left,
>    style=italic]
>
> \defineoverlay
>   [MyFrame]
>   [\useMPgraphic{MyFrame}]
>
> \definelabel
>   [Définition]
>   [headstyle=\bf\smallcaps]
>
> \startuseMPgraphic{MyFrame}
>     path b ;
>     picture p ;
>     p := textext.rt("\white\Définition") ;
>     p := p shifted (2BodyFontSize,OverlayHeight-ypart center 
> p+.25ExHeight) ;
>     b := boundingbox p leftenlarged .5EmWidth rightenlarged .5EmWidth ;
>     fill OverlayBox withcolor \MPcolor{MyColorA} ;
>     fill b withcolor \MPcolor{MyColorB} ;
>     draw p ;
     setbounds currentpicture to OverlayBox ;
> \stopuseMPgraphic
Wolfgang

[-- Attachment #1.2: Type: text/html, Size: 3641 bytes --]

[-- Attachment #2: Type: text/plain, Size: 485 bytes --]

___________________________________________________________________________________
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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Space between both environments
  2015-09-07 19:02 ` Wolfgang Schuster
@ 2015-09-08 16:29   ` Fabrice Couvreur
  2015-09-08 18:24     ` Wolfgang Schuster
  0 siblings, 1 reply; 6+ messages in thread
From: Fabrice Couvreur @ 2015-09-08 16:29 UTC (permalink / raw)
  To: mailing list for ConTeXt users


[-- Attachment #1.1: Type: text/plain, Size: 2280 bytes --]

Hi,
@Otared I accept your answer until I can not fix my code, thank you.

@Woffgang  I have to change the code (how ?) because I realize that the text of
the second environment exceeds the frame (if you draw it).

2015-09-07 21:02 GMT+02:00 Wolfgang Schuster <schuster.wolfgang@gmail.com>:

> Fabrice Couvreur <fabrice1.couvreur@gmail.com>
> 7. September 2015 19:35
> Hi,
> I can not insert a space between my two environments.
>
> There is a space but you can’t see it because the colored background of
> your frames is placed too low (you can see it when you use "frame=on").
>
> Thank you.
> Fabrice
>
> % macros=mkvi
>
> \setupcolors[state=start]
>
>
> \definecolor[MyColorA][c=0.00, m=0.10, y=0.20, k=0.00]
>
> \definecolor[MyColorB][c=0.00, m=0.62, y=1.00, k=0.00]
>
> \definecolor[MyColorC][c=0.3, m=0.00, y=0.00, k=0.05]
>
> \definecolor[MyColorD][c=0.6, m=0.00, y=0.00, k=0.10]
>
>
> \defineframedtext
>   [MyDefinition]
>   [before={\blank},
>    after={\blank},
>    frame=off,
>    background=MyFrame,
>    width=\textwidth,
>    height=fit,
>    location=left,
>    style=italic]
>
> \defineoverlay
>   [MyFrame]
>   [\useMPgraphic{MyFrame}]
>
> \definelabel
>   [Définition]
>   [headstyle=\bf\smallcaps]
>
> \startuseMPgraphic{MyFrame}
>     path b ;
>     picture p ;
>     p := textext.rt("\white\Définition") ;
>     p := p shifted (2BodyFontSize,OverlayHeight-ypart center
> p+.25ExHeight) ;
>     b := boundingbox p leftenlarged .5EmWidth rightenlarged .5EmWidth ;
>     fill OverlayBox withcolor \MPcolor{MyColorA} ;
>     fill b withcolor \MPcolor{MyColorB} ;
>     draw p ;
>
>     setbounds currentpicture to OverlayBox ;
>
> \stopuseMPgraphic
>
> Wolfgang
>
>
> ___________________________________________________________________________________
> 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
>
> ___________________________________________________________________________________
>

[-- Attachment #1.2: Type: text/html, Size: 5233 bytes --]

[-- Attachment #2: Type: text/plain, Size: 485 bytes --]

___________________________________________________________________________________
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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Space between both environments
  2015-09-08 16:29   ` Fabrice Couvreur
@ 2015-09-08 18:24     ` Wolfgang Schuster
  2015-09-12  7:47       ` Fabrice Couvreur
  0 siblings, 1 reply; 6+ messages in thread
From: Wolfgang Schuster @ 2015-09-08 18:24 UTC (permalink / raw)
  To: mailing list for ConTeXt users


[-- Attachment #1.1: Type: text/plain, Size: 627 bytes --]

> Fabrice Couvreur <mailto:fabrice1.couvreur@gmail.com>
> 8. September 2015 18:29
> Hi,
> @Otared I accept your answer until I can not fix my code, thank you.
A better solution is to increase the space before each environment 
because the part of the title which sticks out of the box does not exist 
for TeX.

Changing the before value to “before={\blank[line,halfline]}” should be 
enough.
> @Woffgang I have to change the code (how ?) because I realize that the 
> text of the second environment exceeds the frame (if you draw it).
Add

     maxwidth=\availablehsize,

to your column setup.

Wolfgang

[-- Attachment #1.2: Type: text/html, Size: 2538 bytes --]

[-- Attachment #2: Type: text/plain, Size: 485 bytes --]

___________________________________________________________________________________
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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Space between both environments
  2015-09-08 18:24     ` Wolfgang Schuster
@ 2015-09-12  7:47       ` Fabrice Couvreur
  0 siblings, 0 replies; 6+ messages in thread
From: Fabrice Couvreur @ 2015-09-12  7:47 UTC (permalink / raw)
  To: mailing list for ConTeXt users


[-- Attachment #1.1: Type: text/plain, Size: 1316 bytes --]

Hi Wolfgang,
Thank you for your help, it works fine.
Fabrice

2015-09-08 20:24 GMT+02:00 Wolfgang Schuster <schuster.wolfgang@gmail.com>:

> Fabrice Couvreur <fabrice1.couvreur@gmail.com>
> 8. September 2015 18:29
> Hi,
> @Otared I accept your answer until I can not fix my code, thank you.
>
> A better solution is to increase the space before each environment because
> the part of the title which sticks out of the box does not exist for TeX.
>
> Changing the before value to “before={\blank[line,halfline]}” should be
> enough.
>
> @Woffgang  I have to change the code (how ?) because I realize that the
> text of the second environment exceeds the frame (if you draw it).
>
> Add
>
>     maxwidth=\availablehsize,
>
> to your column setup.
>
> Wolfgang
>
>
> ___________________________________________________________________________________
> 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
>
> ___________________________________________________________________________________
>

[-- Attachment #1.2: Type: text/html, Size: 3777 bytes --]

[-- Attachment #2: Type: text/plain, Size: 485 bytes --]

___________________________________________________________________________________
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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2015-09-12  7:47 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-09-07 17:35 Space between both environments Fabrice Couvreur
2015-09-07 18:43 ` Otared Kavian
2015-09-07 19:02 ` Wolfgang Schuster
2015-09-08 16:29   ` Fabrice Couvreur
2015-09-08 18:24     ` Wolfgang Schuster
2015-09-12  7:47       ` Fabrice Couvreur

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).