3

I'm using groff version 1.22.4 to create a two-page letter. The first page has three columns, the second page has 2 columns.

The macros for printing columns 1-3 on the first page work as expected. The macro for starting the second page always gives a first line that is the width of the column on the previous page. enter image description here.

How can I get the first line on the second page to have the correct width?

Below is the groff:

.ll 2.25i \" Line length of a column 2.25 inches. Good for three columns.
.vs 15p \" 11 points between lines of text in the same paragraph
.ps 12 \" 12 point font size
.nr bottom-margin 0.75i \" Bottom margin
.de START-COLUMN-0
. mk \" Mark top of column
. wh -\\n[bottom-margin]u START-COLUMN-1 \" At bottom of 1st column, run next macro.
..
.de START-COLUMN-1
. po +2.55in \" Add offset for second column.
. rt \" Return to top of column.
. wh -\\n[bottom-margin]u START-COLUMN-2 \" At bottom of 2nd column, run next macro.
..
.de START-COLUMN-2
. po +2.55in \" Add offset for second column.
. rt \" Return to top of column.
. wh -\\n[bottom-margin]u START-PAGE-2 \" At bottom of 2nd column, run next macro.
..
.de START-PAGE-2 \"Page break.
'll 3.55i \" Line length of a column 3.55 inches. Good for two columns.
'bp \" Break page.
'po 0.5in \" left margin 
'mk \" Mark top of column
'wh -\\n[bottom-margin]u END-PAGE-2 \" At bottom of 1st column, run next macro.
..
.de END-PAGE-2
. po +3.85in \" Add offset for second column.
. rt \" Return to top of column.
. wh -\\n[bottom-margin]u \" Terminate at second column on second page.
..
.START-COLUMN-0
Lots of text here.
asked Jan 3, 2021 at 22:46
5
  • may I ask why do you use such an old program? Commented Jan 13, 2021 at 10:29
  • @meuh -- the groff version is 1.22.4 Commented Jan 13, 2021 at 23:49
  • 1
    @Minsky -- Why do I use such an old program? Two reasons. First, as my wife says, I like to suffer. Second, I'm looking for a typesetting program that gives better results than LibreOffice. LaTeX is way too complicated, groff seems like a good alternative. Are there other typesetting programs? Commented Jan 13, 2021 at 23:51
  • I see @9-Pin, I was just curious about it. Agreed on both, but there are many templates to get started w latex! Commented Jan 14, 2021 at 4:31
  • BTW there is one - GNU TeXmacs (it is not TeX/LaTeX at all, it is not Emacs, just wording for fun) Commented Jul 2, 2024 at 14:30

1 Answer 1

0

Posted as an answer, because I need a picture in it and the size of the comment is too large.

Are you sure? The result is completely different from what you describe. The second page is two columns, instead of the 1 column in your description.

When I run your code (GNU groff version 1.22.4), I get:

enter image description here

or as nroff:

 laoreet arcu eros vi‐ faucibus, lacus lectus cus. Quisque mattis
 tae lorem. Morbi con‐ ullamcorper massa, euismod tortor, sit
 vallis massa lacus, quis fermentum leo me‐ amet hendrerit lacus
 vel mollis velit tus sed ipsum. Maece‐ tristique a. Aenean
 vulputate nec. nas sagittis pharetra fermentum sapien pu‐
 rus,
 vel interdum tellus tincidunt nec. Ut euismod massa risus.
 Aenean rutrum, sem sed sodales mattis, magna felis ullamcorper dolor, ac
 convallis nulla diam vel erat. Donec in turpis velit. Nunc elit arcu, cur‐
 sus et condimentum in, efficitur et nisi. Vivamus suscipit porttitor nunc
 consectetur malesuada. Vivamus sodales non lacus quis porttitor. Aenean
 viverra nulla ut lacus dignissim bibendum. Nulla gravida sem quis ex cursus

I also get a single column on the second page, and not two columns as you have in the output.

answered Jan 12, 2021 at 22:03
Sign up to request clarification or add additional context in comments.

6 Comments

why do ppl use groff being it's so old fashioned etc ? Isn't tex better?
The point is, that his output example has two columns on page 2, but he describes that there should only be 1 column.
@Minsky:because it is much more simple and predictable. And it is sufficient for most of us.
@LjmDullaart Thank you for running the code. My description was incorrect; I probably pasted incorrectly. Nevertheless, in your own screen shot, the last partial word on page 1 is lentesque. Why does that fragment not appear on the following page?
@LjmDullaart -- I updated the code sample. It should now reproduce my screen shot.
|

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.