[NTG-context] annotated text: main text in narrower text, annotations on the right

MF massifr at fastwebnet.it
Sun Oct 2 10:29:36 CEST 2016


Thank you, Wolfgang and Jean-Pierre!

I've modified your example and now it resembles what I was looking for.
Now I can use \inright to get annotations on the right of the main
text,
but inside the width of the normal text.

The annotations are aligned to the line they occur in the main text.

It's somewhat tricky, because I need to leave the second paragraph
empty.
Is there a way to obtain that effect without setupparagraphs?

Anyway it works as I wanted, so now I have a solution.
Thank you very much!

Best regards,
Massi


%% begin example
\setuplayout[rightmargin=7cm]

\definenarrower
  [SidenotesMargin]
  [before=\blank,
   after=\blank,
   right=-1cm,
   %right=\rightmarginwidth,
   default=-right]

\defineparagraphs[Sidenotes]
\setupparagraphs
[Sidenotes]  [n=2,before={\startnarrow[SidenotesMargin]},after=\stopnar
row]
\setupparagraphs
[Sidenotes:1][width=.55\localhsize,distance=.1\localhsize]
\setupparagraphs [Sidenotes:2][width=.35\localhsize]

\starttext

\input knuth

\startparagraphs[Sidenotes]
  \startparagraphscell
    A paragraph spanning some lines of text 
    with sidenotes that should stay aligned\inright{aligned}
    with the text they annotate;
    \input ward
    Some more words\inright{more words, 
      spanning more than one line on the margin} 
    to control whether the sidenotes are
    aligned with the text they annotate.
  \stopparagraphscell
  \startparagraphscell\stopparagraphscell
\stopparagraphs

\input knuth

\stoptext
%% end example

> > mf
> >         30. 
> > September 2016 um 00:09
> >     
> > 
> > 
> >   
> > Thanks
> >  for the answer, Wolfgang.
> > 
> > That's not style and color, it's a 
> > sort of two-column layout with the
> > main text in the left column and 
> > annotations (comments) in the right
> > one.
> > 
> > 
> > This is not a real multcolumn text because in verbatim text each
space
> 
> in the input appear also in the output and in the examples spaces
> 
> where used to align the code comments on the same position.
> 
> >   
> >     Example (it does not work):
> > 
> > \starttext
> > 
> > This is 
> > the main text\sidenote{annotation} flowing in the left
> > column...
> > 
> > \stoptext
> > 
> > resulting
> >  in
> > 
> > |This is the main text flowing   | annotation               |
> > |in
> >  the left column...           |                          |
> > 
> > You 
> > can do it with setuplayout and a wider right margin, using \inright
> > for
> >  annotations, but it's for the whole document or a whole page.
> > Is 
> > that possibile only for a section of text inside a page?
> > 
> >     
> > 
> >   
> > 
> > You can use the narrower environment to change the margins for a
certain
> 
> text area and use the paragraphs environment to create two columns
> 
> with different widths in this area.
> 
> 
> 
> %% begin example
> 
> \definenarrower
> 
>   [SidenotesMargin]
> 
>   [before=\blank,
> 
>    after=\blank,
> 
>    right=\rightmarginwidth,
> 
>    default=-right]
> 
> 
> 
> \defineparagraphs[Sidenotes]
> 
> \setupparagraphs [Sidenotes]  
> [n=2,before={\startnarrow[SidenotesMargin]},after=\stopnarrow]
> 
> \setupparagraphs 
> [Sidenotes:1][width=.6\localhsize,distance=.1\localhsize]
> 
> \setupparagraphs [Sidenotes:2][width=.3\localhsize]
> 
> 
> 
> \starttext
> 
> 
> 
> \input knuth
> 
> 
> 
> \startparagraphs[Sidenotes]
> 
>     \startparagraphscell
> 
>         \input knuth
> 
>     \stopparagraphscell
> 
>     \startparagraphscell
> 
>         \input ward
> 
>     \stopparagraphscell
> 
> \stopparagraphs
> 
> 
> 
> \input knuth
> 
> 
> 
> \stoptext
> 
> %% end example
> 
> 
> 
> Wolfgang
> 
> 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.ntg.nl/pipermail/ntg-context/attachments/20161002/d8097f14/attachment.html>


More information about the ntg-context mailing list