我在 minted 环境中有一段代码,我将代码分成几个“块”。我通过在块之间创建点来展示这一点,但我想在代码右侧创建一个括号来指定块名称。以下是我的 minted 代码和命令:
\renewcommand\theFancyVerbLine{%
\ifnum\value{FancyVerbLine}=2
\setcounter{FancyVerbLine}{2}\ldots
\else\ifnum\value{FancyVerbLine}=5
\setcounter{FancyVerbLine}{6}\ldots
\else\ifnum\value{FancyVerbLine}=17
\setcounter{FancyVerbLine}{30}\ldots
\else
\arabic{FancyVerbLine}%
\fi
\fi
\fi
}
\begin{minted}[
frame=lines,
framesep=2mm,
baselinestretch=1.2,
fontsize=\scriptsize,
linenos
]{C}
// convert binary to decimal
#include <stdio.h>
#include <math.h>
// function prototype
int convert(long long);
int main() {
long long n;
printf("Enter a binary number: ");
scanf("%lld", &n);
printf("%lld in binary = %d in decimal", n, convert(n));
return 0;
}
// function definition
int convert(long long n) {
int dec = 0, i = 0, rem;
while (n!=0) {
rem = n % 10;
n /= 10;
dec += rem * pow(2, i);
++i;
}
return dec;
}
\end{minted}
我想要的括号如下所示:
我如何将这些括号和块名称添加到我的铸造环境中?