Экранирование точек в грифе
В соответствии с info groff
(раздел 5.11 Перевод символов),\.
должен печатать только точку. Однако, похоже, что это не так. Если я предоставлю эту страницу
.TH x x x x
\.SH foo
я получил foo
отображается как заголовок раздела, и .SH
не печатается.
Итак, почему это происходит, и как мне избежать точки (и апостроф) в начале строки в groff?
2 ответа
Решение
Для экранирования точки в начале строки пишите \[char46]
:
\[char46]SH foo
печать
.SH foo
Это ожидаемое поведение, но оно должно быть исправлено на странице руководства. Вот отчет об ошибке.
Ниже вы можете прочитать описание обоих \\
(сокращенно) и \.
(со страниц информации).
-- 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.
Просто добавьте точку с символом нулевой ширины:
\&. -- this a a dot.
или временно переключиться на другой управляющий символ:
.cc #
. -- this is a dot.
#cc