我正在try 使用mm宏在Groff中定义一个自定义标题.

如果我定义.PH,它将在第2页生效,但不会在第1页生效.

为什么会发生这种事?

% cat sample2.mm 
\" ***************
\" PAGE DEFINITION
\" ***************
.pl 29.7c           \" PAGE LENGTH
.po 1.5c            \" PAGE OFFSET
.ll 18.0c           \" LINE LENGTH 
.nr pg*top-margin 0     \" MARGIN VARIABLES
.nr pg*foot-margin 0
.nr pg*block-size 0
.nr pg*footer-size 5        \" 1v+footer+even/odd footer+2v
.nr pg*header-size 7        \" 3v+header+even/odd header+2v
.nr pg*extra-footer-size 0
.nr pg*extra-header-size 0
\" ****************
\" HEADER
\" ****************
.PH "'LEFT'CENTER'RIGHT'"
\" ****************
\" FOOTER
\" ****************
.BS             \" CUSTOM FOOTER
CUSTOM FOOTER BLOCK
.BE
\" **************
\" BEGIN DOCUMENT
\" **************
.P
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

.AV "Approver" "Company" [ ]
.SK
.P
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

这就是我得到的

For page 1, the header is the default one: page1

For page 2, the header is the expected one: Page2

推荐答案

.PH定义下一页和下一页的页眉.如果在第一页上执行了任何操作,包括查看一些 comments ,则从第二页开始使用.PH个参数中的标头.

如果您将第.PH行移到顶部,它也将被处理到第一页.不要把任何 comments 放在上面.

Linux相关问答推荐

Postfix 连接到 domain.com[74.208.61.85]:587: 连接被 dovecot、opendkim 和 SSL 拒绝

如何过滤 Bash 的正则表达式(Linux)中的所有值,除了一个?

为什么 perf stat 不计算 cycles:u 在 BIOS 中禁用超线程的 Broadwell CPU 上?

x86_64 Linux 程序集中的逻辑与实现

从 Ansible 中的 shell 命令输出中提取特定数据

matlab中linux和windows上regexp()的不同行为

如果 bash 中已经存在文件名,则创建新文件但添加数字

如何使用完整路径或文件名显示 grep 结果

Linux 的 TextMate 替代品

bash 中的线程?

如何在 Linux 上取消关机?

如何在字符串中查找子字符串(或如何 grep 变量)?

将标准输出作为命令行工具的文件名传递?

ctrl-x 在终端中使用时会发送哪个信号?

将所有文件扩展名转换为小写

初学者如何在 Linux 中开始使用 Mono?

Linux:处理成服务

如何在 linux 中使用 CMake 和 Kdevelop 编译 GLUT + OpenGL 项目?

如何限制堆大小?

find -name "*.xyz" -o -name "*.abc" -exec 对所有找到的文件执行,而不仅仅是指定的最后一个后缀