groff
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Newbie question - Indents and paragraph filling


From: Ralph Corderoy
Subject: Re: Newbie question - Indents and paragraph filling
Date: Mon, 17 Apr 2023 15:18:54 +0100

Hi Ben,

> I was looking to insert a question Num and then without a break indent
> the question text. Similar to the IP command with a bullet, however,
> I wish to append an additional mark allocation to the end of this body
> text also without a break.

Attached is some source which has a go at what you describe.
It's intended to be useful to study rather than just run.
I developed it using

    nroff -ww ben.tr

but it formats as PDF okay too with

    troff -ww -Tpdf ben.tr | gropdf >ben.pdf

> So pointers to sources to read or inaccuracies in my thinking would
> also be greatly appreciated.

One terse resource with handy indexes at the start is Kernighan and
Ossanna's CSTR 54.  It also has a tutorial macro set at the end.
https://troff.org/54.pdf

Here's the nroff output of ben.tr.

0.........1.........2.........3.........4.........5.........6.........7.........8
          _____
          ____________________________________________________________
               _______________________________________________________

               Question goes here.                               Right

            i) Q1estion goes here.                               Right

           ii) Question goes here.                               Right

          iii) Another question.                                   [2]

           iv) A much longer question.  Far longer than before.     12

            v) A much longer question.  Far longer than before.     12

           vi) This  question takes several lines.  Both in the input.
               And in the output.                                  123

          vii) This question takes several lines.  Both in the  input.
               And in the output.                                  124

         viii) This  question takes several lines.  Both in the input.
               And in the output.                                  125

           ix) A question that doesn’t  leave  enough  space  for  the
               marks to sit on the same line forcing a break.   123456

            x) A  question  that  doesn’t  leave  enough space for the
               marks to sit on the same line forcing a break.
                                                               1234567

           xi) A question that doesn’t  leave  enough  space  for  the
               marks to sit on the same line forcing a break.
                                                              12345678

          xii) A  question  that  doesn’t  leave  enough space for the
               marks to sit on the same line forcing a break.
                                                             123456789

         xiii) A question that doesn’t  leave  enough  space  for  the
               marks to sit on the same line forcing a break.
                                                            1234567890

          xiv) Final question.                                      42

-- 
Cheers, Ralph.

Attachment: ben.tr
Description: ben.tr


reply via email to

[Prev in Thread] Current Thread [Next in Thread]