Hi again, It seems there is a bit of margin displacement when using backgrounds. I assume there is a \setupbackground parameter I can use to fix this displacement, but I don't know which one ? TIA for any help, Taco % minimal file: \starttext A\inleft{test} b \startbackground A\inleft{test} b \stopbackground \stoptext
Taco Hoekwater wrote:
Hi again,
It seems there is a bit of margin displacement when using backgrounds.
I assume there is a \setupbackground parameter I can use to fix this displacement, but I don't know which one ?
TIA for any help, Taco
% minimal file: \starttext A\inleft{test} b \startbackground A\inleft{test} b \stopbackground \stoptext
probably some interaction, best use \definetextbackground[taco][location=paragraph,frame=off] A\inleft{test1} b \starttextbackground[taco] A\inleft{test2} b \stoptextbackground
Hans Hagen wrote:
probably some interaction, best use
\definetextbackground[taco][location=paragraph,frame=off]
A\inleft{test1} b
\starttextbackground[taco] A\inleft{test2} b \stoptextbackground
No problem since \startbackground has a number of other problems as well (esp. regarding float placements) that I'd be happy to get away from, but (never having used textbackgrounds seriously before) is there a simple way to get the equivalent of \setupbackground[frame=off,leftframe=on] using textbackgrounds? My previous set of definitions was: %D how examples look \defineenumeration [Example] [style={\switchtobodyfont[9pt]}, headstyle={\ss\bf}, before=, after=, inbetween=\noindent, text=Voorbeeld, indentnext=no, indenting=yes, chapternumber=yes] \def\startexample% {\blank \start \setupbackground [frame=off, leftframe=on, offset=0pt, width=broad, background=, rulethickness=2pt, framecolor=examplecolor] \startbackground \startnarrower[left] \startExample } \def\stopexample% {\stopExample \stopnarrower \stopbackground \stop \blank }
Taco Hoekwater wrote:
Hans Hagen wrote:
probably some interaction, best use
\definetextbackground[taco][location=paragraph,frame=off]
A\inleft{test1} b
\starttextbackground[taco] A\inleft{test2} b \stoptextbackground
No problem since \startbackground has a number of other problems as well (esp. regarding float placements) that I'd be happy to get away from, but (never having used textbackgrounds seriously before) is there a simple way to get the equivalent of
\setupbackground[frame=off,leftframe=on]
using textbackgrounds?
btw, your problem can be solved with: \defineinmargin [taco] [inner] [normal] [distance=\dimexpr\leftmargindistance+.5em\relax] \setupbackground[leftoffset=.5em,rightoffset=.5em] the problem is that llap is not working well inside a vbox (i changed the hsize adaption to left/rightskip but it's still not going well)
My previous set of definitions was:
%D how examples look
\defineenumeration [Example] [style={\switchtobodyfont[9pt]}, headstyle={\ss\bf}, before=, after=, inbetween=\noindent, text=Voorbeeld, indentnext=no, indenting=yes, chapternumber=yes]
\def\startexample% {\blank \start \setupbackground [frame=off, leftframe=on, offset=0pt, width=broad, background=, rulethickness=2pt, framecolor=examplecolor] \startbackground \startnarrower[left] \startExample }
\def\stopexample% {\stopExample \stopnarrower \stopbackground \stop \blank }
hey, some features thatyou don't know about ... here we go: \setupcolors [state=start] \defineenumeration [Example] [style={\switchtobodyfont[9pt]}, headstyle={\ss\bf}, before=, after=, inbetween=\noindent, text=Voorbeeld, indentnext=no, indenting=yes, chapternumber=yes] \definetextbackground [example] [location=paragraph, rulethickness=2pt, framecolor=red, before=\blank, after=\blank] \startuseMPgraphic{mpos:par:columnset} for i=1 upto nofmultipars : % draw leftboundary multipars[i] % shifted (-.25EmWidth,0) % withpen pencircle scaled 2pt % withcolor red ; draw leftboundary multipars[i] shifted (-.5EmWidth,0) withpen pencircle scaled \MPvar{linewidth} withcolor \MPvar{linecolor} ; endfor ; \stopuseMPgraphic \def\startexample {\startnarrower[left] \starttextbackground[example] \startExample} \def\stopexample {\stopExample \stoptextbackground \stopnarrower} \starttext \input tufte \startexample \input tufte \stopexample \input tufte \stoptext
Hans Hagen wrote:
the problem is that llap is not working well inside a vbox (i changed the hsize adaption to left/rightskip but it's still not going well)
The worst problem I have had with the old backgrounds is that they (seem to) take the size of 'currently floating' floats into account when deciding whether or not to go to the next page. This quite often resulted in half-empty pages; naturally followed by an overful float page two pages in-the-future. And there were the typical problems from \vsplit where too much or not enough gets cut off, of course. The textbackgrounds do not have these problems, so I am very happy with the example code you gave me (if the science is too hard, i happily settle for the magic :-)). Thanks, Taco
participants (2)
-
Hans Hagen
-
Taco Hoekwater