minted -- 突出显示的LaTeX源代码
概述
minted 是一个 LaTeX 包,它使用 Pygments 库促进表达式语法高亮。 该软件包还提供了使用 fancyvrb 自定义突出显示的源代码输出的选项。
例如,这段代码:
\begin{minted}[mathescape, linenos, numbersep=5pt, gobble=2, frame=lines, framesep=2mm]{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}
将产生以下渲染:
有关示例和安装说明,请参阅文档。
可用性
minted 与 TeX Live 和 MiKTeX 一起发布。 它也可以从 CTAN 获得。 无论如何,Python 和 Pygments 需要单独安装。
许可证
可以在 LaTeX Project Public License(LaTeX项目公共许可证)(LPPL)1.3版或更高版本的条件下分发和/或修改此工作。
此外,该项目可以根据 3-Clause ("New") BSD license 的条款进行分发。
请使用项目的 GitHub 站点 https://github.com/gpoore/minted 获取建议、功能请求和错误报告。