Re: [NTG-context] Captions with background

2019-08-04 Thread Henning Hraban Ramm
Am 2019-08-04 um 10:33 schrieb Hans Hagen :
> 
> 

Thank you! That is much cleaner than my try, of course. I’ll try to transfer 
that into my environment.



Greetlings, Hraban
---
https://www.fiee.net
http://wiki.contextgarden.net
https://www.dreiviertelhaus.de
GPG Key ID 1C9B22FD

___
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] Captions with background

2019-08-04 Thread Hans Hagen

On 8/3/2019 5:22 PM, Henning Hraban Ramm wrote:

Hi,

in my books I typeset captions onto full page images, therefore I need a 
background; in the attached example it’s just a white box, usually I use a 
MetaPost shadow (some of you helped me with that a few years ago, current code 
see https://wiki.contextgarden.net/Drop_shadows).

Now, the background should just enclose the text, not more. Since I don’t know 
how long the caption will be (I use the whole setup in a macro), I need a \vbox 
within \setlayer, but that always uses the full \textwidth, regardless of width 
settings of \framed.

If the caption is short, the box should be minimal. Is this possible?


Even better would be a textbackground just behind the text lines.

Unfortunately my MP foo is not up to the task, the rectangular shadow was hard 
enough, but I’d try.
There’s an example in details.pdf, but I don’t understand how I could 
manipulate the path around the text (not: paragraph).


The example shows another problem: If you run it with --mode=arrange, the bleed 
is cut off.
Is this a matter of settings or a bug?


Greetlings, Hraban


___
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___




--

-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
   tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
-
\usemodule[visual]

\setuppapersize[A6][A6,oversized]

\setuplayout
   [location=middle,
marking=on,
grid=yes]

\setuppagenumbering
  [alternative=doublesided]

\starttext

\definelayer
  [page]
  [width=\paperwidth,
   height=\paperheight]

\definelayer
  [footer]
  [width=\textwidth,
   height=\footerheight]

\setupbackgrounds
  [page]
  [background=page,
   state=start]

\setupbackgrounds
  [footer][text]
  [background=footer,
   state=start]

\setupfooter[strut=no]

\useMPlibrary[dum]

\showframe[frame=on]

\dorecurse{10} {

test

\page[left]

\setlayer
  [page]
  [x=-2mm,
   y=-2mm,
   preset=lefttop]
  {\externalfigure
 [bogus]
 [width=\dimexpr\paperwidth+2mm,
  height=\dimexpr\paperheight+4mm]
 [frame=on]}

\setlayerframed
  [footer]
  [preset=leftbottom]
  [frame=off,
   align=normal,
   background=color,
   backgroundcolor=white]
  {\fakewords{#1}{#1}}

\page[empty]

test

}

\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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


[NTG-context] Captions with background

2019-08-03 Thread Henning Hraban Ramm
Hi,

in my books I typeset captions onto full page images, therefore I need a 
background; in the attached example it’s just a white box, usually I use a 
MetaPost shadow (some of you helped me with that a few years ago, current code 
see https://wiki.contextgarden.net/Drop_shadows).

Now, the background should just enclose the text, not more. Since I don’t know 
how long the caption will be (I use the whole setup in a macro), I need a \vbox 
within \setlayer, but that always uses the full \textwidth, regardless of width 
settings of \framed.

If the caption is short, the box should be minimal. Is this possible?


Even better would be a textbackground just behind the text lines.

Unfortunately my MP foo is not up to the task, the rectangular shadow was hard 
enough, but I’d try.
There’s an example in details.pdf, but I don’t understand how I could 
manipulate the path around the text (not: paragraph).


The example shows another problem: If you run it with --mode=arrange, the bleed 
is cut off.
Is this a matter of settings or a bug?


Greetlings, Hraban


captiontest.tex
Description: Binary data
___
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___