Skip to content

\grammarterm{} macro partially unconverted in definition contexts #16

@lefticus

Description

@lefticus

Problem

The \grammarterm{} macro is not being converted to italics in certain definition contexts. The LaTeX command appears as raw text in the output.

Location

File: n4950/intro.md
Lines: 440, 483

Current Behavior

Line 440:

⟨non-template friend function with trailing \grammarterm{requires-clause⟩

Line 483:

⟨\grammarterm{template-head⟩ template parameter list, excluding template

The \grammarterm{...} command appears as literal text instead of being converted to italics.

Expected Behavior

Line 440:

⟨non-template friend function with trailing *requires-clause*

Line 483:

*template-head*⟩ template parameter list, excluding template

The grammar term should be italicized using markdown *...* syntax.

Source Context

File: cplusplus-draft/source/intro.tex
Lines: 575-576, 628

\defnadj{target}{targets}%
\item \range{non-template friend function with trailing \grammarterm{requires-clause}}
\defnx{template parameter}{parameter!template}%
\item \range{\grammarterm{template-head}} template parameter list, excluding template

The \grammarterm{} macro is used within \range{} definitions.

Impact

  • Severity: MAJOR
  • Raw LaTeX macros appear in the visible output
  • Makes the document look unprofessional
  • Grammar terms should be distinguished from regular text
  • Inconsistent with other \grammarterm{} conversions in the document (most work correctly)

Root Cause

The macro filter (cpp-macros.lua) is not handling \grammarterm{} when it appears within certain contexts, specifically:

  1. Within \range{...} definitions
  2. Possibly other definition-related contexts

This is a partial failure - most \grammarterm{} macros in the document convert correctly, but these specific instances within definition ranges do not.

Reproduction

  1. Open n4950/intro.md
  2. Navigate to line 440 or 483
  3. Search for \grammarterm{
  4. Observe the raw LaTeX macro in the output

Related Files

  • src/cpp_std_converter/filters/cpp-macros.lua - Macro conversion logic
  • src/cpp_std_converter/filters/cpp-definitions.lua - Definition processing
  • May be related to the order of filter application or context-specific handling

Related Issues

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingmajorMajor priority issue

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions