Draw leftframe to a description
Hi, I want to typeset an "excurses" description that is marked with a leftframe. The problem is that it spans about multiple pages and has footnotes. Here is an MWE: ``` %% -> mwe-framedtext.pdf \defineframedtext[excursusbg][ frame=off, leftframe=on, rulethickness=1mm, framecolor=blue, toffset=0mm, % there is an offset anyways ] %% -> mwe-textbackground.pdf % \definetextbackground[excursusbg] [ % location=text, % background=color, % backgroundcolor=lightblue, % frame=on, % loffset=10cm, % seems to have no impact % ] \definedescription[excursus][ text={Excursus:\ }, alternative=top, headstyle=bold, margin=1cm, width=broad, before={\startexcursusbg}, after={\stopexcursusbg}, ] \starttext \input ward \startexcursus[title={A Knuth extract}] \input knuth \stopexcursus \input ward \startexcursus[title={A much longer Knuth extract}] \input knuth Sometimes, sentences have footnotes\footnote{Some footnote}. \input knuth \input knuth \stopexcursus \stoptext ``` See the attached PDFs for the different results. In principal, I would like the excurses typesetted like to solution with \defineframedtext. However, this does not work with pagebreaks. Additionally, the leftframe is too long (it begins above the "Excursus" text). I tried toffset to let the leftframe begin exactly at the "Excurses" text without success. The solution with \textbackground looks somewhat promising. It supports pagebreaks, but draws above footnotes and prints a small rectangle at the end of the excursus. I also didn't found a way to specify a leftframe only. Also, loffset seems to have no effect, here. Do I use the false environments? Do you know a better solution? Gerion
Am Montag, 8. Juli 2024, 15:00:30 MESZ schrieb Gerion Entrup:
Hi,
I want to typeset an "excurses" description that is marked with a leftframe. The problem is that it spans about multiple pages and has footnotes. ...
I just also asked on Stackexchange: https://tex.stackexchange.com/questions/727604/draw-a-multi-page-leftframe-w... Gerion
I'm not sure I understand your needs. But if you don't want a background, but just need a border. You can try command “startsidebar“ : https://wiki.contextgarden.net/Command/setupsidebar
Am Montag, 30. September 2024, 05:58:10 MESZ schrieb ai2472206007@yeah.net:
I'm not sure I understand your needs. But if you don't want a background, but just need a border. You can try command “startsidebar“ : https://wiki.contextgarden.net/Command/setupsidebar
Thank you for that command, it is pretty much that what I want. In contrast to a textbackground, it seems to be always in the margin of the page. I tried: ``` \definesidebar[excursussb][ rulethickness=1mm, rulecolor=darkred, distance=1mm, % <- this seems to be not respected for text that is narrower ] \definedescription[excursus][ text={Excursus:\ }, alternative=top, headstyle=bold, width=broad, before={\startnarrower\startsidebar[exkursussb]}, after={\stopsidebar\stopnarrower}, ] ``` The more relevant problem, however, is that it does not work with footnotes. I got exactly the same problems like with textbackground (see the stackexchange post for screenshots). Gerion
On Sun, 6 Oct 2024, Gerion Entrup wrote:
I got exactly the same problems like with textbackground (see the stackexchange post for screenshots).
I had replied to you on stackexachange, but I think that the mailing list is a better place to discuss this, so I am following up here. Regarding the footnote, what is happening is that text-background extends to the "end of the page". This is from one of my old files where I had encountered a similar issue: %D By default, the textbackground extends till the page boundary. This does %D not look good if a page break occurs when there is not enough material to %D fit in the page. So, we want to limit textbackground till the typeset %D material. This has not been interfaced yet, so I use a low level \TEX\ %D command. \chardef\kindofpagetextareas\plusone Adding the same works in your example: \definetextbackground [leftbartext] [ location=paragraph, mp=mpos:region:leftbar, width=broad, frame=off, framecolor=darkgray, rulethickness=2ex, leftoffset=5ex, rightoffset=2.25ex, topoffset=2.25ex, bottomoffset=2.25ex, background=color, backgroundcolor=lightgray, ] \startuseMPgraphic{mpos:region:leftbar} draw_multi_pars; draw_multi_side; \stopuseMPgraphic \definecolor[lightblue] [0.95(blue,white)] \definetextbackground [blocktext] [leftbartext] [ framecolor=darkblue, backgroundcolor=lightblue, ] \definedescription [excursus] [ text={Excursus}, alternative=top, headstyle=bold, margin=1cm, width=broad, before={\startblocktext}, after={\stopblocktext}, ] \chardef\kindofpagetextareas\plusone \starttext \input ward \startexcursus[title={A Knuth extract}] \input knuth \stopexcursus \input ward \startexcursus[title={A much longer Knuth extract}] \input knuth Sometimes, sentences have footnotes\footnote{Some footnote}. \input knuth \input knuth \stopexcursus \stoptext Aditya
participants (3)
-
Aditya Mahajan
-
ai2472206007@yeah.net
-
Gerion Entrup