<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <div class="moz-cite-prefix">On 2014-05-18 09:50, Matthias Weber
      wrote:<br>
    </div>
    <blockquote
      cite="mid:F5F935AC-61CB-4DE2-8008-A804A810BE95@indiana.edu"
      type="cite">
      <meta http-equiv="Content-Type" content="text/html;
        charset=ISO-8859-1">
      Thanks Rik,
      <div><br>
      </div>
      <div>that is very helpful. Now I am having some difficulties with
        coordinating the \inmargins with the marginrules.</div>
      <div><br>
      </div>
      <div><br>
      </div>
      <div>In the example below, I notice the oddity that
        \startmarginrule[2] is closer to the text than
        \startmarginrule[1]</div>
      <div>or \startmarginrule[3], which are at equal distance. I can
        live with that.</div>
      <div><br>
      </div>
      <div>There are only three things I’d like to improve:</div>
      <div><br>
      </div>
      <div>i) I’d like to put my default  \inmargin arguments into the
        setup, but I can’t figure out whether to use \setupinmargin</div>
      <div>or \setupinmargindata, and where to put the arguments.</div>
      <div><br>
      </div>
      <div>ii) Ideally I’d like to use a description to be able to write
        \startgreenline … \stopgreenline, and I have tried this with</div>
      <div>\setupdescription, but failed.</div>
      <div><br>
      </div>
      <div>iii) Dream: Instead of solid margin rules I would love to
        have other options, like squiggly lines, dashed, dotted. </div>
      <div><br>
      </div>
      <div><br>
      </div>
      <div>
        <div>Thanks!</div>
        <div><br>
        </div>
        <div>Matthias</div>
        <div>
          <div><br>
          </div>
          <div>
            <div><br>
            </div>
            <div>
              <div><br>
              </div>
              <div>\setupmarginrule[rulethickness=.1pt] % works</div>
              <div><br>
              </div>
              <div><br>
              </div>
              <div>\setupmargindata[][align=middle,width=2cm] %??? </div>
              <div><br>
              </div>
              <div>\definedescription[greenline] % ???</div>
              <div>[before={\setupmarginrule[rulecolor=green]</div>
              <div>\indenting[no]</div>
              <div>\startmarginrule[2]},</div>
              <div>after={\stopmarginrule}</div>
              <div>]</div>
              <div><br>
              </div>
              <div>\starttext</div>
              <div><br>
              </div>
              <div>\inmargin[method=first][frame=on,corner=round]
                {Read\\this\\first}</div>
              <div>\setupmarginrule[rulecolor=red]</div>
              <div>\indenting[no]</div>
              <div>\startmarginrule[1]</div>
              <div>\input{knuth}</div>
              <div>\stopmarginrule</div>
              <div><br>
              </div>
              <div>\inmargin[method=first][frame=on,corner=round,align=middle,width=2cm,offset=3pt]
                {Read\\this\\second}</div>
              <div>\setupmarginrule[rulecolor=green]</div>
              <div>\indenting[no]</div>
              <div>\startmarginrule[2]</div>
              <div>\input{tufte}</div>
              <div>\stopmarginrule</div>
              <div><br>
              </div>
              <div>\inmargin[][frame=on,corner=round,align=middle,width=2cm]
                {Read\\this\\third}</div>
              <div>\setupmarginrule[rulecolor=blue]</div>
              <div>\indenting[no]</div>
              <div>\startmarginrule[3]</div>
              <div>\input{knuth}</div>
              <div>\stopmarginrule</div>
              <div><br>
              </div>
              <div><br>
              </div>
              <div>\inmargin[][frame=on,corner=round,align=middle,width=2cm]
                {Read\\this\\fourth}</div>
              <div>\setupmarginrule[rulecolor=black]</div>
              <div>\indenting[no]</div>
              <div>\startmarginrule[4]</div>
              <div>\input{knuth}</div>
              <div>\stopmarginrule</div>
              <div><br>
              </div>
              <div>\startgreenline</div>
              <div>\input{tufte}</div>
              <div>\stopgreenline</div>
              <div><br>
              </div>
              <div>\stoptext</div>
            </div>
          </div>
        </div>
      </div>
    </blockquote>
    <br>
    I have been playing with this a bit. I think that the following does
    what you want as far as setting up the margin text and description.
    I am no help on the mp stuff that you will need for curly or
    other-dotted rules.<br>
    <br>
    As you probably saw, neither \setupmargindata nor \setupmarginframed
    are in the wiki. The list archive has some hints, but the source
    code, if you ignore a couple of misleading comments, suggested what
    I got to work.<br>
    <br>
    The problem you will run into with the description as you want to
    use it comes when you have multiple paragraphs. Without a start/stop
    mechanism, there is no way to mark the paragraphs to include within
    the scope of the line. As long as you are willing to enclose
    multiple paragraphs in braces (and provide a null description as I
    do here) you will be fine, but at that point you may as well use the
    start/stop.<br>
    <br>
    There is still a problem with the margin rule extending through the
    blank line that results from the implied \par at the end of the
    description block (and any explicit \par). It looks ugly and isn't
    matched by the behavior of the rule in the start/stop text. Perhaps
    someone else can find a way around it.<br>
    <br>
    Some of this is probably unnecessary for what you want; for example,
    instead of using optional arguments you may prefer to hardcode the
    choice of rule # and color. If you want to always use the same color
    with the same rule #, you can simplify in other ways.<br>
    <br>
    I did use MKVI syntax, simply because I have been trying to use it
    consistently in all my current work. It should be easily translated
    back to earlier syntax.<br>
    <br>
    <blockquote><tt>% macros=mkvi<br>
        \setupmarginrules[rulethickness=2pt,alternative=1]<br>
        <br>
        \setupmargindata  [left]<br>
                          [location=left,<br>
                           style=\bfxx]<br>
        \setupmarginframed[left]<br>
                          [frame=on,<br>
                           framecolor=darkgray,<br>
                           corner=round,<br>
                           offset=3pt,<br>
                           width=2cm,<br>
                           align=middle]<br>
        <br>
        \starttexdefinition startMtext<br>
          \bgroup<br>
          \dotripleempty\dostartMtext<br>
        \stoptexdefinition<br>
        \starttexdefinition dostartMtext [#RULE][#COLOR][#ORDER]<br>
          \doifemptyelse{#RULE}<br>
                        {\def\Rule{2}}%              default rule<br>
                        {\def\Rule{#RULE}}<br>
          \doifemptyelse{#COLOR}<br>
                         {\def\Color{green}}%        default color<br>
                         {\def\Color{#COLOR}}<br>
          \ifthirdargument<br>
            \inleft{Read\\this\\#ORDER}<br>
          \fi<br>
          \setupmarginrule[\Rule][rulecolor=\Color]<br>
          \startmarginrule[\Rule]<br>
        \stoptexdefinition<br>
        \starttexdefinition stopMtext<br>
          \stopmarginrule<br>
          \egroup<br>
        \stoptexdefinition<br>
        <br>
        \definedescription[greenline]<br>
                          [before={\setupmarginrules[rulecolor=green,<br>
                                                     alternative=0,<br>
                                                    
        rulethickness=0.5pt]<br>
                                   \indenting[no]<br>
                                   \startmarginrule[2]},<br>
                           after={\stopmarginrule}]<br>
        <br>
        \starttext<br>
        <br>
        \startMtext [1][][first]<br>
        \input knuth<br>
        \stopMtext<br>
        <br>
        \startMtext [2][green][second]<br>
        \input tufte<br>
        \stopMtext<br>
        <br>
        \blank<br>
        <br>
        \startMtext [3][blue][third]<br>
        \input tufte<br>
        \stopMtext<br>
        <br>
        \startMtext [4][black][fourth]<br>
        \input knuth<br>
        \stopMtext<br>
        <br>
        \input knuth<br>
        Just a few lines of text before the marked text.<br>
        \startMtext[][red]<br>
        \input tufte<br>
        \stopMtext<br>
        And a few lines of text after the marked text.<br>
        \input knuth<br>
        <br>
        \blank<br>
        <br>
        \greenline \input knuth<br>
        <br>
        \blank<br>
        <br>
        \greenline{} {Some text and tufte: \input tufte<br>
        <br>
        Some more text.}<br>
        <br>
        \input tufte<br>
        <br>
        \startMtext [][magenta][last]<br>
        \input tufte<br>
        \stopMtext<br>
        <br>
        \stoptext</tt><br>
    </blockquote>
    <br>
  </body>
</html>