Вопрос

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.

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top