You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As far as I can see, currently pandoc supports counters only for headers and lists (via example lists). Plus, the support for header counters is limited in that one cannot cross-reference the heading number.
It will be very useful to support arbitrary inline counters, like a simple span element.
I propose the following syntax.
Declaration Syntax
A counter is initialized or incremented by an empty Span containing a class (the counter group) and a unique ID (the reference anchor). Eg:
[]{.theorem #main}
Counters from different classes are numbered separately. So a separate state will be kept for each counter class.
Referencing Syntax
To reference the counter value (and add a link to the anchor),
we could utilize one of the following existing syntaxes:
citation: @main
Empty Link: [](#main). Or, use #main as shorthand?
Example
The following markdown block:
Theorem @thm:main: theorem body.
[]{#thm:main .theorem}
See also theorem @thm:foo below.
Theorem @thm:foo: theorem body.
[]{#thm:foo .theorem}
will be translated to the following markdown block:
Theorem [1](#thm:main): theorem body.
[]{#thm:main .theorem}
See also theorem [2](#thm:foo) below.
Theorem [2](#thm:foo): theorem body.
[]{#thm:foo .theorem}
Personal
Speaking for myself, I primarily write in pandoc markdown. This feature is less useful when I only care about latex,
but it becomes necessary when exporting to docx/HTML.
I currently rely on some preprocessor scripts to enable inline counters, and I've found them highly useful for my workflow.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
As far as I can see, currently pandoc supports counters only for headers and lists (via example lists). Plus, the support for header counters is limited in that one cannot cross-reference the heading number.
It will be very useful to support arbitrary inline counters, like a simple
spanelement.I propose the following syntax.
Declaration Syntax
A counter is initialized or incremented by an empty Span containing a class (the counter group) and a unique ID (the reference anchor). Eg:
Counters from different classes are numbered separately. So a separate state will be kept for each counter class.
Referencing Syntax
To reference the counter value (and add a link to the anchor),
we could utilize one of the following existing syntaxes:
@main[](#main). Or, use#mainas shorthand?Example
The following markdown block:
will be translated to the following markdown block:
Personal
Speaking for myself, I primarily write in pandoc markdown. This feature is less useful when I only care about latex,
but it becomes necessary when exporting to docx/HTML.
I currently rely on some preprocessor scripts to enable inline counters, and I've found them highly useful for my workflow.
Beta Was this translation helpful? Give feedback.
All reactions