Home > Enterprise >  Is there a way to exit double column mode without page break in groff?
Is there a way to exit double column mode without page break in groff?

Time:01-02

I'm trying to write up my CV in groff/troff and would like to have my contact details in two columns at the top, one column adjusted on the left and the other on the right. I tried doing it like this:

.2C
Name
.LP
Address line 1
.LP
Address line 1
.LP
Phone number
.LP
Email@ddress
.LP
Link to Github

The problem is that when I go back to a single column there is an automatic page break and my details are displayed in the left-hand column.

Is there a way to avoid the page break and have only a small section of the page display double columns?

CodePudding user response:

The 2-columnn format is not that flexible.

What you would probably need is tbl. Typically that would look like:

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam tempus tincidunt
velit, eleifend auctor nisi tristique semper.
.TS
expand,tab(@);
lw35 rw35.
T{
Name: Me
T}@T{
Email: [email protected]
T}
T{
Address: Here
T}@T{
Telephone: available
T}
.TE

Pellentesque egestas mi scelerisque
neque lobortis faucibus. Phasellus semper erat vitae neque aliquet molestie.
Ut sit amet vulputate dui. Maecenas mattis, nisl id fringilla scelerisque, mi
mauris vestibulum massa, at iaculis ante elit id sem. Etiam scelerisque orci
at dapibus euismod.

and generate with

tbl columntest.ms | groff -ms  > out.ps

You may want to play a bit with the column-width until you're satisfied.

enter image description here

  • Related