Bug report: manual style prints literal <prefix> in big-figure captions
Environment
- TeXmacs 2.1.5
- macOS 14.8.4 (Apple Silicon)
Problem
Using the legacy manual document style, big-figure captions contain the
literal string
<prefix>
instead of the expected section number.
For example, instead of
Figure 2.3.
the document displays
Figure <prefix>3.
Location
The relevant code is in
TeXmacs/styles/documentation/manual.ts
around lines 62–64:
<assign|big-figure|<macro|fig|cap|
...
<assign|the-label|<prefix><figure-nr>>
...
<with|font-size|0.84|
<surround|
<with|font-series|bold|
<localize|Figure>
<prefix><figure-nr>. >
||
<arg|cap>>>
Investigation
I traced the history of this code with Git.
manual.ts has contained these lines since commit
4b7f7b62
2004-03-23
and they have remained essentially unchanged ever since.
I then searched both the historical repository and the current TeXmacs source
tree for a definition of prefix.
Historical search
git grep '<assign|prefix|'
No definition exists in the 2004 tree where manual.ts introduced
<prefix>.
Current source tree
Searching the TeXmacs 2.1.5 installation likewise finds no numbering-related
definition of prefix.
A documentation package (tmdoc-keyboard) later introduced a macro also named
prefix, but it is used only for rendering keyboard shortcuts (Ctrl, Meta,
etc.) and is unrelated to document numbering.
Therefore the manual style appears to reference a macro that is no longer
defined (or perhaps never was).
Local workaround
Replacing
<assign|the-label|<prefix><figure-nr>>
by
<assign|the-label|<section-nr>.<figure-nr>>
and replacing
<prefix><figure-nr>. >
by
<value|the-label>. >
restores the expected captions.
For example, the following sections and figures produce
Figure 1.1
Figure 1.2
Figure 2.3
Figure 2.4
Figure 5.5
The workaround preserves the existing global figure-nr counter while
restoring the section prefix.
Question
Is the use of
<prefix>
inside manual.ts a long-standing typo or obsolete leftover from an older
numbering mechanism?
Would replacing it with an explicit construction of the-label be an
acceptable upstream fix, or is there a preferred modern implementation for
big-figure in the legacy manual style?
Maybe @mgubi, @darcy, or @jeroen would know.
Cheers, Tilda