首页 > 解决方案 > groff:分页后线宽不正确

问题描述

我正在使用 groff 1.22.4 版来创建一个两页的信件。第一页有 3 列,第二页有 2 列。

用于在第一页打印第 1-3 列的宏按预期工作。开始第二页的宏总是给出第一行,它是前一页上列的宽度。在此处输入图像描述.

如何使第二页上的第一行具有正确的宽度?

下面是格罗夫:

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

标签: grofftroff

解决方案


作为答案发布,因为我需要一张图片并且评论的大小太大。

你确定吗?结果和你描述的完全不同。第二页是两列,而不是描述中的 1 列。

当我运行您的代码(GNU groff 1.22.4 版)时,我得到:

在此处输入图像描述

或作为 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

我还在第二页上得到一列,而不是输出中的两列。


推荐阅读