Skip to content

Commit 3da06e6

Browse files
fix examples for ref and autoref
1 parent 9127304 commit 3da06e6

File tree

1 file changed

+33
-8
lines changed

1 file changed

+33
-8
lines changed

docs/paper.md

Lines changed: 33 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -113,24 +113,49 @@ The goal of Open Journals is to provide authors with a seamless and pleasant wri
113113

114114
Tables and figures can be referenced if they are given a *label* in the caption. In pure Markdown, this can be done by adding an empty span `[]{label="floatlabel"}` to the caption. LaTeX syntax is supported as well: `\label{floatlabel}`.
115115

116-
Link to a float element, i.e., a table or figure, with `\ref{identifier}` or `\autoref{identifier}`, where `identifier` must be defined in the float's caption. The former command results in just the float's number, while the latter inserts the type and number of the referenced float. E.g., in this document `\autoref{proglangs}` yields "\autoref{proglangs}", while `\ref{proglangs}` gives "\ref{proglangs}".
116+
For example:
117+
118+
119+
```markdown
120+
: Comparison of programming languages used in the publishing tool. \label{proglangs}
121+
122+
| Language | Typing | Garbage Collected | Evaluation | Created |
123+
|----------|:---------------:|:-----------------:|------------|---------|
124+
| Haskell | static, strong | yes | non-strict | 1990 |
125+
| Lua | dynamic, strong | yes | strict | 1993 |
126+
| C | static, weak | no | strict | 1972 |
127+
```
128+
129+
Makes:
130+
131+
```{table} **Table 1:** Comparison of programming languages used in the publishing tool.
132+
:name: proglangs
133+
134+
| Language | Typing | Garbage Collected | Evaluation | Created |
135+
|----------|:---------------:|:-----------------:|------------|---------|
136+
| Haskell | static, strong | yes | non-strict | 1990 |
137+
| Lua | dynamic, strong | yes | strict | 1993 |
138+
| C | static, weak | no | strict | 1972 |
139+
```
140+
141+
Link to a float element, i.e., a table or figure, with `\ref{identifier}` or `\autoref{identifier}`, where `identifier` must be defined in the float's caption. The former command results in just the float's number, while the latter inserts the type and number of the referenced float. E.g., for this example:
142+
143+
144+
145+
* `\autoref{proglangs}` yields [Table 1](#proglangs)
146+
* `\ref{proglangs}` yields [1](#proglangs)
117147

118-
: Comparison of programming languages used in the publishing tool. []{label="proglangs"}
119148

120-
| Language | Typing | Garbage Collected | Evaluation | Created |
121-
|----------|:---------------:|:-----------------:|------------|---------|
122-
| Haskell | static, strong | yes | non-strict | 1990 |
123-
| Lua | dynamic, strong | yes | strict | 1993 |
124-
| C | static, weak | no | strict | 1972 |
125149

126150
### Equations
127151

128152
Cross-references to equations work similarly to those for floating elements. The difference is that, since captions are not supported for equations, the label must be included in the equation:
129153

130154
$$a^n + b^n = c^n \label{fermat}$$
131155

132-
Referencing, however, is identical, with `\autoref{eq:fermat}` resulting in "\autoref{eq:fermat}".
156+
Referencing, however, is identical, with `\autoref{eq:fermat}` resulting in [Equation 1](#eq:fermat).
133157

158+
(eq:fermat)=
134159
$$a^n + b^n = c^n \label{eq:fermat}$$
135160

136161
Authors who do not wish to include the label directly in the formula can use a Markdown span to add the label:

0 commit comments

Comments
 (0)