tcolorbox 本地改变代码块中的文本颜色

tcolorbox 本地改变代码块中的文本颜色

我已经努力了\tcolorbox一段时间才得到代码块所需的输出,下面举个例子: 在此处输入图片描述

和代码:

\documentclass[12pt]{report}


\usepackage[letterpaper,margin=1in]{geometry}
\usepackage[newfloat]{minted}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{subcaption}
\usepackage{listings}
\usepackage{hyperref}
\usepackage{caption}
\usepackage{amsmath}
\usepackage{xcolor}
\usepackage{float}

\usepackage{tcolorbox}
\tcbuselibrary{listings, minted, xparse, breakable, skins}
\renewcommand{\theFancyVerbLine}{\textcolor[rgb]{1,1,1}{\scriptsize\arabic{FancyVerbLine}}}
\AtBeginDocument{%
    \newtcblisting[
        blend into=listings
    ]{bash}[2][]{%
        title=#2,
        breakable,
        listing only,
        detach title,
        coltitle=black,
        listing engine=minted,
        comment above* listing,
        comment=\raggedright\tcbtitle,
        minted language=bash,
        minted style=stata-light, colback=gray!10, beamer, frame hidden,
        minted options={fontsize=\footnotesize, tabsize=2, breaklines, autogobble,
        linenos, numbersep=5pt, frame=lines, framesep=2mm, baselinestretch=1.2, breakanywhere},
        overlay={
            \begin{tcbclipinterior}\fill[black!90] (frame.south west)
        rectangle ([xshift=5mm]frame.north west);\end{tcbclipinterior}
        },
        blend before title code={},
        #1
    }
}

\hypersetup{
    colorlinks,
    citecolor=electricultramarine,
    filecolor=.,
    linkcolor=maroon,
    urlcolor=smokyblack,
    linktoc=all
}
\definecolor{cobalt}{rgb}{0.0, 0.28, 0.67}
\definecolor{maroon}{rgb}{0.69, 0.19, 0.38}

\begin{document}


\begin{bash}[label=listing:symmetric_graph]{\parbox{\linewidth}{\linespread{1}\selectfont\normalfont The \texttt{PGGB 0.4.0} pipeline for symmetric graph construction. This code was run on the Galileo100 HPC system, available at the time of the pilot project, using 48 threads.}}
# load necessary modules
module load profile/bioinf
ml bcftools/1.13
# activate the Conda environment to run the pipeline
source conda.sh
conda activate assembly_graphs
# pangenome construction with specific parametrization tuned for humans using GRCh38 for variant calling in the output VCF
pggb -i /g100_scratch/userexternal/mungaro0/pangenomes/pangenome_ref_guided_pggb-v4.fa.gz -o /g100_scratch/userexternal/mungaro0/VGS -t 48 -p 98 -s 100000 -n 12 -k 311 -O 0.03 -T 24 -G 13117, 13219 -S -m -V 'GRCh38_p14v2.0.fna.gz:#'
\end{bash}

...

\end{document}

但是,正如您所看到的,.03此 Linux 代码中的 并未像其他数字一样以蓝色突出显示。我猜想 被.视为特殊字符,因此其后的所有内容都被视为文本而不是数字。

不过,这是一个必须传递给算法的数字参数0.03,我希望它像代码块中的其他数字一样被涂成蓝色。有什么办法吗?本地选项似乎无效...任何帮助都值得感激,提前致谢!

相关内容