On 16 oct. 2010, at 17:30, Emanuele Sacco wrote:
A solution by Luigi: […]
Hi Emmanuele, Hi Luigi, Please excuse me if I get involved in the thread of your discussions… I was interested both by the question ad the solutions, since I had a similar problem some time ago, but I gave up. Now that you give a solution with \definetextbackground (the solution below), I would like to point out that with this definition the beginning of the highlighted text does not have the upper frame turned on, while at the end the bottom frame is turned on (of course this is what we want). So my question is: can one have both the upper frame turned on at the begining of the highlighted text (and only there) and also the bottom frame turned on at the end (and only there). In other words, a highlighted framed text spanning over two (or more) pages, would be like a big rectangle of which the upper and the bottom frame, as well as the left and right frames, are shown. Thanks in advance for you attention: OK
An alternative solution with the command \definetextbackground:
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \setupcolors[state=start] \enableregime[utf] \def\Linea{\startMPcode draw (0,0) -- (\the\textwidth-1,0) withpen pencircle scaled 1bp withcolor red; \stopMPcode } \definetextbackground [Prova] [ mp=background:mp, location=paragraph, rulethickness=1pt, width=broad, leftoffset=1em, rightoffset=1em, after={\Linea} ] \startuseMPgraphic{background:mp} path p; for i = 1 upto nofmultipars : p = (multipars[i] topenlarged 5pt bottomenlarged 10pt); fill p withcolor lightgray ; draw leftboundary p withpen pencircle scaled 1bp withcolor red ; draw rightboundary p withpen pencircle scaled 1bp withcolor red ; endfor; \stopuseMPgraphic
\starttext
\startProva \input knuth \input knuth \input knuth \input knuth \input knuth \stopProva
\stoptext %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%