首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >groff中的转义点

groff中的转义点
EN

Stack Overflow用户
提问于 2012-07-13 19:11:21
回答 2查看 1.2K关注 0票数 12

根据info groff (第5.11节字符翻译),\.应该只打印圆点。然而,这似乎不是正在发生的事情。如果我呈现此手册页

代码语言:javascript
复制
.TH x x x x
\.SH foo

我将foo呈现为小节标题,并且不打印.SH

那么,为什么会发生这种情况,以及我如何在groff中转义行中的圆点(和撇号)?

EN

回答 2

Stack Overflow用户

回答已采纳

发布于 2012-07-20 02:13:20

要转义行write开头的点,请使用\[char46]

代码语言:javascript
复制
\[char46]SH foo

打印

代码语言:javascript
复制
.SH foo

这是一个预期的行为,但应该在手册页中修复。Here是一个错误报告。

下面你可以阅读\\ (缩写)和\. (从信息页面)的描述。

代码语言:javascript
复制
-- Escape: \\
[...]

`\\' is a `delayed' backslash; more precisely, it is the default
escape character followed by a backslash, which no longer has
special meaning due to the leading escape character. It is _not_
an escape sequence in the usual sense! In any unknown escape
sequence `\X' the escape character is ignored and X is printed.
But if X is equal to the current escape character, no warning is
emitted.

As a consequence, only at top-level or in a diversion a backslash
glyph is printed; in copy-in mode, it expands to a single
backslash which then combines with the following character to an
escape sequence.

[...]

-- Escape: \.
Similar to `\\', the sequence `\.' isn't a real escape sequence.
As before, a warning message is suppressed if the escape character
is followed by a dot, and the dot itself is printed.
票数 12
EN

Stack Overflow用户

发布于 2014-07-26 03:40:52

只需在点前添加一个宽度为零的字符:

代码语言:javascript
复制
\&. -- this a a dot.

或临时切换到另一个控制字符:

代码语言:javascript
复制
.cc #
. -- this is a dot.
#cc
票数 5
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/11469341

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档