ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: MF <massifr@fastwebnet.it>
To: mailing list for ConTeXt users <ntg-context@ntg.nl>
Subject: Re: annotated text: main text in narrower text, annotations on the right
Date: Sun, 02 Oct 2016 10:29:36 +0200	[thread overview]
Message-ID: <1475396976.2896.1.camel@fastwebnet.it> (raw)
In-Reply-To: <57EE38BA.10307@gmail.com>


[-- Attachment #1.1: Type: text/plain, Size: 3777 bytes --]

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
> 
> 

[-- Attachment #1.2: Type: text/html, Size: 5941 bytes --]

[-- Attachment #2: Type: text/plain, Size: 485 bytes --]

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

  reply	other threads:[~2016-10-02  8:29 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-29 14:23 MF
2016-09-29 18:45 ` Wolfgang Schuster
2016-09-29 22:09   ` mf
2016-09-30 10:04     ` Wolfgang Schuster
2016-10-02  8:29       ` MF [this message]
2016-10-02 12:21         ` Footnotes inside and outside a framed text Jean-Pierre Delange
2016-10-02 22:47           ` mf
2016-10-04 15:36             ` Jean-Pierre Delange
2016-10-04 18:44               ` Pablo Rodriguez
2016-10-05  9:48                 ` Jean-Pierre Delange
2016-09-30 16:43     ` annotated text: main text in narrower text, annotations on the right Jean-Pierre Delange

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1475396976.2896.1.camel@fastwebnet.it \
    --to=massifr@fastwebnet.it \
    --cc=ntg-context@ntg.nl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).