Экранирование точек в groff

Согласно info groff (раздел 5.11 Перевод символов), \. должен печатать только точку. Однако, похоже, это не так. Если я отрисовываю эту справочную страницу

.TH x x x x
\.SH foo

Я получаю foo как заголовок раздела, а .SH не печатается.

Итак, почему это происходит, и как избежать точки (и апострофа) в начале строки в groff?


person Roman Cheplyaka    schedule 13.07.2012    source источник


Ответы (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.
person rogal111    schedule 19.07.2012

Просто добавьте перед точкой символ нулевой ширины:

\&. -- this a a dot.

или временно переключиться на другой управляющий символ:

.cc #
. -- this is a dot.
#cc
person Ant_222    schedule 25.07.2014