units-of-measurement - 可以在 groff 请求中使用数字寄存器吗?
问题描述
有人可以向我解释为什么在.po
(“页面偏移量”)请求中嵌入文字值(例如,“1c”)有效但引用数字寄存器不起作用?
.\" Set the dimensions of an A4 page.
.nr a4_width 21c
.nr a4_height 29.7c
.nr a4_margin_horizontal 1c
.nr a4_margin_vertical 1c
.nr a4_content (\n[a4_width] - (\n[a4_margin_horizontal] * 2))
.
.\" Page-offset and line-length
.po \n[a4_margin_horizontal]
.ll \n[a4_content]
.\" Uncomment the below two lines and everything works.
.\" .po 1c
.\" .ll 19c
.
.\" Start the document.
Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod
tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At
vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren,
no sea takimata sanctus est Lorem ipsum dolor sit amet.
.sp
解决方案
当您编写以下行时:
.nr a4_margin_horizontal 1c
该字母c
为刻度指示符;因此存储在寄存器中的实际数值约为 28346。
以后写的时候:
.po \n[a4_margin_horizontal]
没有刻度指示器;因此解释器依赖于根据行布局(手册页)的默认比例指示器。m
如果要使其工作,请在请求u
后添加指示符:\n
.po \n[a4_margin_horizontal]u
推荐阅读
- java - 用于在 UTF8 和 UTF16 偏移之间转换的 Java 代码(Java 字符串偏移到/来自 Python 3 字符串偏移)
- object-detection - 调整图像大小以进行对象检测
- mysql - 在 MYSQL 中搜索 2 列的字符串部分
- javascript - 如何在节点 js 中查找父层次结构
- swift - 如何修复 Xcode 中的“'viewbusdata' 类型的值没有下标”错误
- median - 使用堆查找未排序数组的中位数
- php - 作曲家:找不到类 League\Uri\UriString
- java - 如何从抽象类调用子类方法?
- html - Bootstrap 4 卡片图像不对齐
- tkinter - tkinter 按下按钮导出预测结果