I used to use listings
a lot but minted+pygmentize
has outstanding output. However, there are a few features from listings
that are hard to find in minted
, like having the line numbers on the right.
Is there a way to cross reference lines in a minted
environment as in listings
?
Best Answer
I know this is an "ancient" question but I would like to answer it to help those who get here like me. :)
minted
nows provides a macro calledescapeinside
(alsotexcl
andtexcomments
for LaTeX in comments, please check the document for more):An example given in the document is:
I've tried that. We can also use
\label{refname}
to create a line reference usingesacpeinside
like this:The example on Overleaf.
Hope this helps. :)