Thanks Rik,
that is very helpful. Now I am having some difficulties with coordinating the \inmargins with the marginrules.
In the example below, I notice the oddity that \startmarginrule[2] is closer to the text than \startmarginrule[1]or \startmarginrule[3], which are at equal distance. I can live with that.
There are only three things I’d like to improve:
i) I’d like to put my default \inmargin arguments into the setup, but I can’t figure out whether to use \setupinmarginor \setupinmargindata, and where to put the arguments.
ii) Ideally I’d like to use a description to be able to write \startgreenline … \stopgreenline, and I have tried this with\setupdescription, but failed.
iii) Dream: Instead of solid margin rules I would love to have other options, like squiggly lines, dashed, dotted.
Thanks!
Matthias
\setupmarginrule[rulethickness=.1pt] % works
\setupmargindata[][align=middle,width=2cm] %???
\definedescription[greenline] % ???[before={\setupmarginrule[rulecolor=green]\indenting[no]\startmarginrule[2]},after={\stopmarginrule}]
\starttext
\inmargin[method=first][frame=on,corner=round] {Read\\this\\first}\setupmarginrule[rulecolor=red]\indenting[no]\startmarginrule[1]\input{knuth}\stopmarginrule
\inmargin[method=first][frame=on,corner=round,align=middle,width=2cm,offset=3pt] {Read\\this\\second}\setupmarginrule[rulecolor=green]\indenting[no]\startmarginrule[2]\input{tufte}\stopmarginrule
\inmargin[][frame=on,corner=round,align=middle,width=2cm] {Read\\this\\third}\setupmarginrule[rulecolor=blue]\indenting[no]\startmarginrule[3]\input{knuth}\stopmarginrule
\inmargin[][frame=on,corner=round,align=middle,width=2cm] {Read\\this\\fourth}\setupmarginrule[rulecolor=black]\indenting[no]\startmarginrule[4]\input{knuth}\stopmarginrule
\startgreenline\input{tufte}\stopgreenline
\stoptext
% macros=mkvi
\setupmarginrules[rulethickness=2pt,alternative=1]
\setupmargindata [left]
[location=left,
style=\bfxx]
\setupmarginframed[left]
[frame=on,
framecolor=darkgray,
corner=round,
offset=3pt,
width=2cm,
align=middle]
\starttexdefinition startMtext
\bgroup
\dotripleempty\dostartMtext
\stoptexdefinition
\starttexdefinition dostartMtext [#RULE][#COLOR][#ORDER]
\doifemptyelse{#RULE}
{\def\Rule{2}}% default rule
{\def\Rule{#RULE}}
\doifemptyelse{#COLOR}
{\def\Color{green}}% default color
{\def\Color{#COLOR}}
\ifthirdargument
\inleft{Read\\this\\#ORDER}
\fi
\setupmarginrule[\Rule][rulecolor=\Color]
\startmarginrule[\Rule]
\stoptexdefinition
\starttexdefinition stopMtext
\stopmarginrule
\egroup
\stoptexdefinition
\definedescription[greenline]
[before={\setupmarginrules[rulecolor=green,
alternative=0,
rulethickness=0.5pt]
\indenting[no]
\startmarginrule[2]},
after={\stopmarginrule}]
\starttext
\startMtext [1][][first]
\input knuth
\stopMtext
\startMtext [2][green][second]
\input tufte
\stopMtext
\blank
\startMtext [3][blue][third]
\input tufte
\stopMtext
\startMtext [4][black][fourth]
\input knuth
\stopMtext
\input knuth
Just a few lines of text before the marked text.
\startMtext[][red]
\input tufte
\stopMtext
And a few lines of text after the marked text.
\input knuth
\blank
\greenline \input knuth
\blank
\greenline{} {Some text and tufte: \input tufte
Some more text.}
\input tufte
\startMtext [][magenta][last]
\input tufte
\stopMtext
\stoptext