Referring to sections in pandoc's markdown #10546
Replies: 3 comments 2 replies
-
You don't have to use \label. By default, pandoc will automatically add \label{my-section} at the end of the heading. To set the identifier explicitely, you can write e.g. `# My section {#myid}`.
Pandoc by itself can only create hyperlinks to your section (e.g. `see [the preceding section](#my-section)`). To refer to it by section number, you can either insert raw LaTeX (if you only export to that format) or use pandoc-crossref.
|
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
manolomartinez
-
Thanks! That's what I gather from the docs, but, e.g., if I have a section called "The Signal-Processing Aim of Cognition", referring to it with `\ref{the-signal-processing-aim-of-cognition}` produces "??" in the resulting pdf.
It should work (at least in pandoc 3.6.1). Did you compile the LaTeX file twice? Did you get a warning? To know if the argument of \ref is right, it suffices to inspect the resulting LaTeX file.
Personally I always set the identifiers manually so that they are more straightforward to refer to and less verbose.
|
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
When I need to refer to a section (if
--number-sections
is set) I do# My section\label{mysection} Here I'm referring to section \ref{mysection}.
This works, but I wonder if there's
Thanks for any pointers.
Beta Was this translation helpful? Give feedback.
All reactions