How to add latex reference to code block of pandoc markdown file?
Вопрос
I've read the guide http://johnmacfarlane.net/pandoc/README.html#verbatim-code-blocks
In the example
~~~~ {#mycode .haskell .numberLines startFrom="100"}
qsort [] = []
qsort (x:xs) = qsort (filter (< x) xs) ++ [x] ++
qsort (filter (>= x) xs)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
How can I add a latex label \label{code}
to this block of code so I can reference it by \ref{code}
?
Решение
According to the page you link to the #mycode
bit is the identifier for the code block, this is equivalent to LaTeX's \label
. You can reference this code block using an internal link and the identifier #mycode
.
Не связан с StackOverflow