Quantcast
Channel: Highlight labeled lines of code with minted - TeX - LaTeX Stack Exchange
Viewing all articles
Browse latest Browse all 2

Highlight labeled lines of code with minted

$
0
0

I was wondering whether I could use the labeling mechanism explained here to get the line numbers that I want to use for highlighting code via highlightlines in minted.

I am imagining something like this (Modified example from https://tex.stackexchange.com/a/483714/85983):

\begin{minted}[linenos=true, escapeinside=!!, highlightlines=\ref{myline}]{c++}    i = i + 1 ;      j = j + 1 ; !\label{myline}!    k = k + 1 ;\end{minted}The important line is line \ref{myline}.

In the resulting output the line j = j + 1 ; should be highlighted.


Viewing all articles
Browse latest Browse all 2

Latest Images

Trending Articles





Latest Images