如何在 minted 环境中更改数字的字体大小?可以使用参数修改字体fontsize
,但左侧的数字不受影响。
这是代码:
\documentclass[11pt,article,oneside]{memoir}
\usepackage{listings}
\usepackage{xcolor}
\usepackage{textcomp}
\usepackage[T1]{fontenc}
\usepackage{minted}
\counterwithout{section}{chapter}
\begin{document}
\begin{minted}[mathescape,
linenos,
numbersep=5pt,
gobble=2,
frame=lines,
framesep=2mm,
fontsize=\tiny]{csharp}
string title = "This is a Unicode π in the sky"
/*
Defined as $\pi=\lim_{n\to\infty}\frac{P_n}{d}$ where $P$ is the perimeter
of an $n$-sided regular polygon circumscribing a
circle of diameter $d$.
*/
const double pi = 3.1415926535
\end{minted}
\end{document}
答案1
\theFancyVerbLine
应该重新定义来控制行号样式。
\renewcommand{\theFancyVerbLine}{\sffamily \textcolor[rgb]{0.5,0.5,1.0}{\huge \oldstylenums{\arabic{FancyVerbLine}}}}