Pure lua implementation of table, figure, section and equation cross-references.
# Chapter 1
In-text references to @fig:1 [B] and @tab:foobar.
Multi-reference to [@fig:1 (A); the cool part of @fig:1; @fig:three]
and [@tab:foobar (very cool); *especially* @tab:foobar].
{#fig:1 width=1in}
{#fig: width=1in}
{#fig:three width=1in}
Plot [-@fig:three] is given above, without adding the "Figure" prefix.
As seen in @tab:foobar, commas are handled properly.
## Equations {#equationchapter}
Equations, such as @eq:pythagoras, have to be put into a span with an id:
[$$a^2 + b^2 = c^2$$]{#eq:pythagoras}
## Tables
Foo Bar
--- ---
1 2
Table: With caption string {#tab:foobar border=1 attr2=foo}In-text references to Figure 1B and Table 1.
Multi-reference to Figures 1 (A), the cool part of 1 & 3 and Tables 1 (very cool) & especially 1.
Figure 1: The number one. Figure 2: The unlabeled number two. Figure 3: The number three.Plot 3 is given above, without adding the “Figure” prefix.
As seen in Table 1, commas are handled properly.
Equations, such as Equation 1, have to be put into a span with an id:
*a*2 + *b*2 = *c*2| Foo | Bar |
|---|---|
| 1 | 2 |
Table 1:With caption string
| Feature | luarefnos | pandoc-xnos |
|---|---|---|
| Figure references | ✔ | ✔ |
| Subfigures | (✗) | ✔ |
| Table references | ✔ | ✔ |
| Equation references | ✔ | ✔ |
| Section references | (✔) | ✔ |
| Clever references | ✗ | ✔ |
| Customization | ✗ | ✔ |
| Maturity | 👶 | ✔ |
| Corner cases | Many | Probably none |
| Installation | One file | Python + 3 packages |
| Native docx references | ✔ | ✗ |
Before anything can be referenced, it has to have an ID.
The native attribute syntax is reused:
{#fig:example}A (not yet) native attribute block is at the end of the caption is applied to the table:
Col A Col B
----- -----
1 2
: A table caption {#tab:example}Display math in a span with an ID is counted:
[$$a^2 + b^2 = c^2$$]{#eq:pythagoras}Section IDs are re-used, the sec: is added automatically!
# Section A
The section below has the number @sec:someotherid
# Section B {#someotherid}Citations with a namespace (e.g. sec:, fig: etc.) are replaced with
the reference:
We reference @tab:example and @fig:example.