End
Counter chapter
- PrettyFormat "Chapter \arabic{chapter}"
+ PrettyFormat "Chapter ##"
End
Counter section
Within chapter
- PrettyFormat "Section \arabic{section}"
+ PrettyFormat "Section ##"
End
Counter subsection
Within section
- PrettyFormat "Section \arabic{subsection}"
+ PrettyFormat "Section ##"
End
Counter subsubsection
Within subsection
- PrettyFormat "Section \arabic{subsubsection}"
+ PrettyFormat "Section ##"
End
Counter paragraph
Within subsubsection
- PrettyFormat "Paragraph \arabic{paragraph}"
+ PrettyFormat "Paragraph ##"
End
Counter subparagraph
Within paragraph
- PrettyFormat "Paragraph \arabic{subparagraph}"
+ PrettyFormat "Paragraph ##"
End
Counter enumi
End
Counter equation
- PrettyFormat "Equation \arabic{equation}"
+ PrettyFormat "Equation ##"
End
Counter footnote
- PrettyFormat "Footnote \arabic{footnote}"
+ PrettyFormat "Footnote ##"
End
}
-docstring Counters::prettyCounter(docstring const & counter,
+docstring Counters::prettyCounter(docstring const & name,
string const & lang) const
{
- CounterList::const_iterator it = counterList_.find(counter);
+ CounterList::const_iterator it = counterList_.find(name);
if (it == counterList_.end())
return from_ascii("??");
Counter const & ctr = it->second;
+
+ docstring const value = theCounter(name, lang);
docstring const & format = ctr.prettyFormat();
- // FIXME We need to "flatten" the format to get proper output,
- // but doing so will take a bit of work.
- if (true || format.empty()) {
- docstring cntrname = translateIfPossible(counter, lang);
- return cntrname + " " + theCounter(counter, lang);
- }
- return counterLabel(format, lang);
+ if (format.empty())
+ return value;
+ return subst(format, from_ascii("##"), value);
}