Rom*_*aka 12 escaping manpage groff
根据info groff
(第5.11节字符翻译),
\.
应该只打印点.然而,这似乎并非如此.如果我渲染此联机帮助页
.TH x x x x
\.SH foo
Run Code Online (Sandbox Code Playgroud)
我被foo
渲染为一个部分标题,并.SH
没有打印.
那么,为什么会发生这种情况,如何在groff线的开始处逃避点(和撇号)?
rog*_*111 12
要在行开头使用时转义点\[char46]
:
\[char46]SH foo
Run Code Online (Sandbox Code Playgroud)
版画
.SH foo
Run Code Online (Sandbox Code Playgroud)
这是预期的行为,但应在手册页中修复.这是一个错误报告.
您可以在下面阅读\\
(缩短的)和\.
(来自信息页面)的说明.
-- 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.
Run Code Online (Sandbox Code Playgroud)
只需在点前加上一个零宽度字符:
\&. -- this a a dot.
Run Code Online (Sandbox Code Playgroud)
或暂时切换到另一个控制字符:
.cc #
. -- this is a dot.
#cc
Run Code Online (Sandbox Code Playgroud)