Currently, (@)-numbered lists (example lists), when tags are defined and used for reference in running text, do not generate links.
For example:
(@ex) This is an example
Refer to (@ex) for an example
Will be converted to LaTeX:
\begin{enumerate}
\def\labelenumi{(\arabic{enumi})}
\tightlist
\item
This is an example
\end{enumerate}
Refer to (1) for an example
It would be desirable if the reference would link back to the list item.
Perhaps this should be handled at the markdown reader level instead. Currently the markdown
(@foo) hi
See (@foo)
gets parsed as
[OrderedList (1,Example,TwoParens)
[[Plain [Str "hi"]]]
,Para [Str "See",Space,Str "(1)"]]
What if we instead parsed it as:
[OrderedList (1,Example,TwoParens)
[[Plain [Span ("example-1",[],[]) [Str "hi"]]]]
,Para [Str "See",Space,Link ("",[],[]) [Str "(1)"] ("#example-1","")]]
Then you'd get the links for free in LaTeX, and also in other formats.
Most helpful comment
Perhaps this should be handled at the markdown reader level instead. Currently the markdown
gets parsed as
What if we instead parsed it as:
Then you'd get the links for free in LaTeX, and also in other formats.