# [NTG-context] How to make something appear to the right of every paragraph?

Hans Hagen j.hagen at freedom.nl
Tue Oct 11 19:28:02 CEST 2022

On 10/10/2022 12:12 AM, Joel via ntg-context wrote:
> I'd like to add some area for readers to write in the margins of some
> text. This would leave three lines, like this to the right of the text.
>
> ______
> ______
> ______
>
> The passage would take up about the left 60% of the text and the margin
> note space about 30% of textwidth, so no need to use the margins.
>
> Though its easy for me to implement this code using some \thinrules and
> manually dropping macros in the text, is there some way ConTeXt can be
> told to just add them to right of every paragraph (at the start of the
> paragraph)?
>
> Sample:
>
> This is some text      ________
> that is written in        ________
> the passage and      ________
> you can see the th-
> ree lines to the right.
> The text in the para-
> graph continues even
> though there are
> just three lines to
> the right.
>
> Here is another par-    ________
> agraph.                        ________
>        ________
>
> Here is yet another    ________
> paragraph. You can    ________
> see it also has the     ________
> three liens.
>
> This is just for a segment of the book, not every paragraph in the book.

\starttext

\def\StartHack
{\margintext
[location=right,style=]
{\thinrules[n=3]}}

\def\StopHack
{\par \ifnum\prevgraf<3
\blank[\the\numexpr4-\prevgraf\relax*line]
\fi}

\StartHack \input tufte \StopHack

\StartHack test test \StopHack

\StartHack test test \StopHack

\stoptext

--

-----------------------------------------------------------------