#1340 indexterm in man page creates spurious periods

output: manpages

Consider the attached test document. It contains


This produces


because the indexterm produces a period, which is wrong.

The template is

<!-- * indexterm instances produce groff comments like this: -->
<!-- * .\" primary: secondary: tertiary -->
<xsl:template match="indexterm">
  <xsl:text>.\" </xsl:text>

I think this commenting style only works at the beginning of the line.

Is there a reason to keep the indexterms in the man pages at all?

1 Attachments


  • Robert Stayton

    Robert Stayton - 2014-07-30

    I looked into this issue. The processing of a mixed content block like para is tricky. The stylesheet does not just insert a line break before each dot command, because if the preceding content ends with a line break, then you get a double line break, so a blank line, and a broken text line in formatted output. The template named "mixed.block" tries to manage that for various combinations.

    I could not figure out how to process indexterm instances with the various combinations of preceding and following whitespace, without some of them introducing too many line breaks and messing up the formatted output.

    To preserve the white space of the input, the indexterm output would need to be inline, but there is no way to hide inline content.

    I think omitting indexterms (and remarks) from the output would be the right solution. Since they don't work now, I doubt we would get many complaints with that change. If someone had a special purpose for indexterms, they could (and should) implement it as a customization.

  • Robert Stayton

    Robert Stayton - 2014-08-08
    • status: open --> pending-fixed
    • assigned_to: Robert Stayton
  • Robert Stayton

    Robert Stayton - 2014-08-08

    I changed manpage/inline.xsl to omit indexterm and remark elements from nroff output. If someone needs them for some special purpose, they can easily add a customized template to handle them.


Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.

No, thanks