ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Floating Figure in framed-environment
@ 2022-10-19  9:31 Oliver Sieber via ntg-context
  2022-10-19 11:52 ` Ursula Hermann via ntg-context
  2022-10-19 16:38 ` Wolfgang Schuster via ntg-context
  0 siblings, 2 replies; 4+ messages in thread
From: Oliver Sieber via ntg-context @ 2022-10-19  9:31 UTC (permalink / raw)
  To: ntg-context; +Cc: Oliver Sieber

Dear ConTeXt Users

I am relatively new to context and I am suffering with a problem with the framed environment.

I want to use a framed textbox for Definitions in my script. I also want to use floating figures.  But this does not work and I haven’t found out why. Maybe I totally use it the wrong way. I would appreciate if someone could help me or has a tipp.

Here is an example code, where the figure does not behave as expected, i.e. the figure is behind the text:

\starttext
\framed[corner=round, rulethickness=2pt, width=\textwidth, align=flushleft, offset=1em,background=color,framecolor=black]
{{\bf Definition: Hello World} \blank[medium] 

\placefigure[right, none]{This is an example of a logo.}{\externalfigure[dummy]}

Carrot cake tiramisu lollipop dragée lollipop marshmallow carrot cake sweet pastry. Tiramisu danish jelly tootsie roll tart gummi bears. Carrot cake chupa chups cake wafer lemon drops lemon drops tiramisu. Chocolate lemon drops sugar plum cheesecake jelly beans sugar plum. Tootsie roll cupcake jujubes pie chocolate bar bear claw chupa chups shortbread. Candy candy canes jelly-o jelly beans sugar plum muffin danish donut. Bonbon lemon drops powder jujubes marshmallow biscuit halvah. Powder carrot cake caramels chocolate cake carrot cake jelly-o. Topping danish tootsie roll gummi bears oat cake jujubes. Sweet candy canes cotton candy pie topping. Jelly-o carrot cake ice cream lemon drops macaroon gummies lemon drops tiramisu chocolate cake. Cupcake sugar plum shortbread gummi bears tootsie roll. Chocolate cake sugar plum macaroon candy canes chocolate bar donut cake icing tootsie roll.
}
\stoptext


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

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : https://contextgarden.net
___________________________________________________________________________________

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

* Re: Floating Figure in framed-environment
  2022-10-19  9:31 Floating Figure in framed-environment Oliver Sieber via ntg-context
@ 2022-10-19 11:52 ` Ursula Hermann via ntg-context
  2022-10-19 15:35   ` Oliver Sieber via ntg-context
  2022-10-19 16:38 ` Wolfgang Schuster via ntg-context
  1 sibling, 1 reply; 4+ messages in thread
From: Ursula Hermann via ntg-context @ 2022-10-19 11:52 UTC (permalink / raw)
  To: mailing list for ConTeXt users; +Cc: Ursula Hermann

Dear Oliver, 

maybe something like this? 
This is my example: 
\starttext

\setuppapersize
  [A5]

\setupexternalfigures
  [location=default]

\setupindenting
  [yes, small]

\setupwhitespace
  [small]

\defineframedtext
  [prettyblock]
  [width=10cm,
   indenting={yes, small},
   background=color, backgroundcolor=lightgreen,
   foreground=color, foregroundcolor=black,
   offset=2mm,
   align=flushleft]

\starttext

\startprettyblock
\setupindenting[next]
  The Earth, as a habitat for animal life, is in old age and has a fatal
  illness. Several, in fact.

  It would be happening whether humans had ever evolved or not.

  \placefigure
[][fig:church]
{Stephanus Church.}
{\externalfigure[ma-cb-24][width=.4\textwidth]}

\stopprettyblock
\setupindenting[next]
Below, we have two separate columns; but up here, for the nonce, we have but
the one.

\startcolumns [n=2]
  Text, text, text \dots
  all in the first column
\column
  Words, words, words \dots
  all in the second column.
  And look ye here! Even more words!
\stopcolumns

\stoptext

Many regards
Uschi 

-----Ursprüngliche Nachricht-----
Von: ntg-context <ntg-context-bounces@ntg.nl> Im Auftrag von Oliver Sieber via ntg-context
Gesendet: Mittwoch, 19. Oktober 2022 11:31
An: ntg-context@ntg.nl
Cc: Oliver Sieber <context-ml@privly.pm>
Betreff: [NTG-context] Floating Figure in framed-environment

Dear ConTeXt Users

I am relatively new to context and I am suffering with a problem with the framed environment.

I want to use a framed textbox for Definitions in my script. I also want to use floating figures.  But this does not work and I haven’t found out why. Maybe I totally use it the wrong way. I would appreciate if someone could help me or has a tipp.

Here is an example code, where the figure does not behave as expected, i.e. the figure is behind the text:

\starttext
\framed[corner=round, rulethickness=2pt, width=\textwidth, align=flushleft, offset=1em,background=color,framecolor=black]
{{\bf Definition: Hello World} \blank[medium] 

\placefigure[right, none]{This is an example of a logo.}{\externalfigure[dummy]}

Carrot cake tiramisu lollipop dragée lollipop marshmallow carrot cake sweet pastry. Tiramisu danish jelly tootsie roll tart gummi bears. Carrot cake chupa chups cake wafer lemon drops lemon drops tiramisu. Chocolate lemon drops sugar plum cheesecake jelly beans sugar plum. Tootsie roll cupcake jujubes pie chocolate bar bear claw chupa chups shortbread. Candy candy canes jelly-o jelly beans sugar plum muffin danish donut. Bonbon lemon drops powder jujubes marshmallow biscuit halvah. Powder carrot cake caramels chocolate cake carrot cake jelly-o. Topping danish tootsie roll gummi bears oat cake jujubes. Sweet candy canes cotton candy pie topping. Jelly-o carrot cake ice cream lemon drops macaroon gummies lemon drops tiramisu chocolate cake. Cupcake sugar plum shortbread gummi bears tootsie roll. Chocolate cake sugar plum macaroon candy canes chocolate bar donut cake icing tootsie roll.
}
\stoptext


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

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : https://contextgarden.net
___________________________________________________________________________________
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : https://contextgarden.net
___________________________________________________________________________________

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

* Re: Floating Figure in framed-environment
  2022-10-19 11:52 ` Ursula Hermann via ntg-context
@ 2022-10-19 15:35   ` Oliver Sieber via ntg-context
  0 siblings, 0 replies; 4+ messages in thread
From: Oliver Sieber via ntg-context @ 2022-10-19 15:35 UTC (permalink / raw)
  To: ntg-context; +Cc: Oliver Sieber

Dear Uschi

Thanks for the example. But unfortunately it behaves similiar. As soon as I want to place the figure to the right by using \placefigure
[right]… with floating text to the left. The framed environment behaves strange, i.e. it seems to ignore the image.

Just using a centered image works perfectly. I included everything in this code, to show exactly, what is not working.

\starttext
\framed[corner=round, rulethickness=2pt, width=\textwidth, align=flushleft, offset=1em,background=color,framecolor=black]
{{\bf Box with centered image} \blank[medium] 

\input khatt-en

\placefigure[none]{This is an example of a logo.}{\externalfigure[dummy]}
}

\blank[2cm]



\framed[corner=round, rulethickness=2pt, width=\textwidth, align=flushleft, offset=1em,background=color,framecolor=black]
{{\bf Faulty box with floating text, image to the right} \blank[medium] 

\placefigure[right, none]{This is an example of a logo.}{\externalfigure[dummy]}

\input khatt-en
}

\blank[2cm]

{\bf Floating text with image to the right, without box} \blank[medium] 

\placefigure[right, none]{This is an example of a logo.}{\externalfigure[dummy]}

\input khatt-en
\stoptext

Any ideas? 

Thanks a lot in advance.



> Am 19.10.2022 um 13:52 schrieb Ursula Hermann via ntg-context - ntg-context at ntg.nl <ntg-context@ntg.nl>:
> 
> Dear Oliver, 
> 
> maybe something like this? 
> This is my example: 
> \starttext
> 
> \setuppapersize
>  [A5]
> 
> \setupexternalfigures
>  [location=default]
> 
> \setupindenting
>  [yes, small]
> 
> \setupwhitespace
>  [small]
> 
> \defineframedtext
>  [prettyblock]
>  [width=10cm,
>   indenting={yes, small},
>   background=color, backgroundcolor=lightgreen,
>   foreground=color, foregroundcolor=black,
>   offset=2mm,
>   align=flushleft]
> 
> \starttext
> 
> \startprettyblock
> \setupindenting[next]
>  The Earth, as a habitat for animal life, is in old age and has a fatal
>  illness. Several, in fact.
> 
>  It would be happening whether humans had ever evolved or not.
> 
>  \placefigure
> [][fig:church]
> {Stephanus Church.}
> {\externalfigure[ma-cb-24][width=.4\textwidth]}
> 
> \stopprettyblock
> \setupindenting[next]
> Below, we have two separate columns; but up here, for the nonce, we have but
> the one.
> 
> \startcolumns [n=2]
>  Text, text, text \dots
>  all in the first column
> \column
>  Words, words, words \dots
>  all in the second column.
>  And look ye here! Even more words!
> \stopcolumns
> 
> \stoptext
> 
> Many regards
> Uschi 
> 
> -----Ursprüngliche Nachricht-----
> Von: ntg-context <ntg-context-bounces@ntg.nl> Im Auftrag von Oliver Sieber via ntg-context
> Gesendet: Mittwoch, 19. Oktober 2022 11:31
> An: ntg-context@ntg.nl
> Cc: Oliver Sieber <context-ml@privly.pm>
> Betreff: [NTG-context] Floating Figure in framed-environment
> 
> Dear ConTeXt Users
> 
> I am relatively new to context and I am suffering with a problem with the framed environment.
> 
> I want to use a framed textbox for Definitions in my script. I also want to use floating figures.  But this does not work and I haven’t found out why. Maybe I totally use it the wrong way. I would appreciate if someone could help me or has a tipp.
> 
> Here is an example code, where the figure does not behave as expected, i.e. the figure is behind the text:
> 
> \starttext
> \framed[corner=round, rulethickness=2pt, width=\textwidth, align=flushleft, offset=1em,background=color,framecolor=black]
> {{\bf Definition: Hello World} \blank[medium] 
> 
> \placefigure[right, none]{This is an example of a logo.}{\externalfigure[dummy]}
> 
> Carrot cake tiramisu lollipop dragée lollipop marshmallow carrot cake sweet pastry. Tiramisu danish jelly tootsie roll tart gummi bears. Carrot cake chupa chups cake wafer lemon drops lemon drops tiramisu. Chocolate lemon drops sugar plum cheesecake jelly beans sugar plum. Tootsie roll cupcake jujubes pie chocolate bar bear claw chupa chups shortbread. Candy candy canes jelly-o jelly beans sugar plum muffin danish donut. Bonbon lemon drops powder jujubes marshmallow biscuit halvah. Powder carrot cake caramels chocolate cake carrot cake jelly-o. Topping danish tootsie roll gummi bears oat cake jujubes. Sweet candy canes cotton candy pie topping. Jelly-o carrot cake ice cream lemon drops macaroon gummies lemon drops tiramisu chocolate cake. Cupcake sugar plum shortbread gummi bears tootsie roll. Chocolate cake sugar plum macaroon candy canes chocolate bar donut cake icing tootsie roll.
> }
> \stoptext
> 
> 
> Best regards
> Oli
> ___________________________________________________________________________________
> If your question is of interest to others as well, please add an entry to the Wiki!
> 
> maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
> webpage  : https://www.pragma-ade.nl / http://context.aanhet.net archive  : https://bitbucket.org/phg/context-mirror/commits/
> wiki     : https://contextgarden.net
> ___________________________________________________________________________________
> ___________________________________________________________________________________
> If your question is of interest to others as well, please add an entry to the Wiki!
> 
> maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
> webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
> archive  : https://bitbucket.org/phg/context-mirror/commits/
> wiki     : https://contextgarden.net
> ___________________________________________________________________________________


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

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : https://contextgarden.net
___________________________________________________________________________________

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

* Re: Floating Figure in framed-environment
  2022-10-19  9:31 Floating Figure in framed-environment Oliver Sieber via ntg-context
  2022-10-19 11:52 ` Ursula Hermann via ntg-context
@ 2022-10-19 16:38 ` Wolfgang Schuster via ntg-context
  1 sibling, 0 replies; 4+ messages in thread
From: Wolfgang Schuster via ntg-context @ 2022-10-19 16:38 UTC (permalink / raw)
  To: mailing list for ConTeXt users, Oliver Sieber via ntg-context
  Cc: Wolfgang Schuster

Oliver Sieber via ntg-context schrieb am 19.10.2022 um 11:31:
> Dear ConTeXt Users
>
> I am relatively new to context and I am suffering with a problem with the framed environment.
>
> I want to use a framed textbox for Definitions in my script. I also want to use floating figures.  But this does not work and I haven’t found out why. Maybe I totally use it the wrong way. I would appreciate if someone could help me or has a tipp.
>
> Here is an example code, where the figure does not behave as expected, i.e. the figure is behind the text:
>
> [...]

You have to use the textbackground mechanism to create a block of text 
where floats work as expected.

\definetextbackground
   [Oliver]
   [     location=paragraph,
           corner=round,
    rulethickness=2pt,
       framecolor=black,
        topoffset=1em,
     bottomoffset=1em,
       leftoffset=1em,
      rightoffset=1em,
           before=\blank,
            after=\blank,
       background=]

\setupfloats
   [freeregion=no]

\definedescription
   [Definition]
   [alternative=top,
           text={Definition: },
          title=yes,
         before=\startOliver,
          after=\stopOliver,
      inbetween={\blank[medium]}]

\startbuffer[sampletext]
Carrot cake tiramisu lollipop dragée lollipop marshmallow carrot cake 
sweet pastry. Tiramisu danish jelly tootsie roll tart gummi bears. 
Carrot cake chupa chups cake wafer lemon drops lemon drops tiramisu. 
Chocolate lemon drops sugar plum cheesecake jelly beans sugar plum. 
Tootsie roll cupcake jujubes pie chocolate bar bear claw chupa chups 
shortbread. Candy candy canes jelly-o jelly beans sugar plum muffin 
danish donut. Bonbon lemon drops powder jujubes marshmallow biscuit 
halvah. Powder carrot cake caramels chocolate cake carrot cake jelly-o. 
Topping danish tootsie roll gummi bears oat cake jujubes. Sweet candy 
canes cotton candy pie topping. Jelly-o carrot cake ice cream lemon 
drops macaroon gummies lemon drops tiramisu chocolate cake. Cupcake 
sugar plum shortbread gummi bears tootsie roll. Chocolate cake sugar 
plum macaroon candy canes chocolate bar donut cake icing tootsie roll.
\stopbuffer

\starttext

\startOliver
{\bf Definition: Hello World}
\blank[medium]
\placefigure[right,none]{This is an example of a 
logo.}{\externalfigure[dummy]}
\getbuffer[sampletext]
\stopOliver

\startDefinition[title={Hello World}]
\placefigure[right,none]{This is an example of a 
logo.}{\externalfigure[dummy]}
\getbuffer[sampletext]
\stopDefinition

\stoptext

Wolfgang

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

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : https://contextgarden.net
___________________________________________________________________________________

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

end of thread, other threads:[~2022-10-19 16:38 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-19  9:31 Floating Figure in framed-environment Oliver Sieber via ntg-context
2022-10-19 11:52 ` Ursula Hermann via ntg-context
2022-10-19 15:35   ` Oliver Sieber via ntg-context
2022-10-19 16:38 ` Wolfgang Schuster via ntg-context

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