更改 Tikz Bclogo 索引标题的字母颜色

更改 Tikz Bclogo 索引标题的字母颜色

考虑一下代码

\RequirePackage{filecontents}
\begin{filecontents*}{\jobname.mst}
%delim_0 "\\IndexDotfill "
%delim_1 "\\IndexDotfill "
headings_flag 1
heading_prefix "  \\IndexHeading{"
heading_suffix "}\n"
\end{filecontents*}
\documentclass{book}
\usepackage{xcolor}
\let\cleardoublepage\clearpage 

\usepackage{imakeidx}
\makeindex
\usepackage{idxlayout}

\usepackage[tikz]{bclogo}
\usetikzlibrary{calc,shapes.callouts,shapes.arrows}

\newcommand*{\IndexDotfill}{%
  \nobreak\dotfill\ \nobreak
}
\renewcommand*{\indexspace}{%
  \par
  \vspace{25pt plus 6pt minus 4pt}%
  }
\newcommand*{\IndexHeading}[1]{%
\vspace{27pt}
\hfil   \tikz\node[
    rounded corners=5pt,
    draw=blue,
    fill=blue!75!red,
    line width=1.3pt,
    inner sep=10pt,
    align=center,
    font=\sffamily\bfseries\Large,
    minimum width=1.25in
  ] {#1};%
  \nopagebreak
  \par
  \vspace{2mm}%
\hfil }


% Make all page numbers in index bold
\let\oldindex\index
\renewcommand{\index}[1]{%
  \oldindex{#1|textbf}%
}%

\begin{document}
\LARGE

\newpage A sentence.\index{S Subheading@\textbf{\textcolor{red}{S Subheading}}!A subentry}
\index{S Subheading@\textbf{\textcolor{red}{S Subheading}}!Another subentry}
\index{S Subheading@\textbf{\textcolor{red}{S Subheading}}!Yet another subentry}

\idxlayout{columns=1}
\printindex
\end{document}

产生

在此处输入图片描述

问题:对于如图所示的深色 tikz 框,我想将内嵌字母的颜色更改为粗体白色。我如何在上述 MWE 中执行此操作?

谢谢。

答案1

\documentclass[tikz, border=1 cm]{standalone}
\begin{document}
  \tikz\node[
    rounded corners=5pt,
    draw=blue,
    fill=blue!75!red,
    line width=1.3pt,
    inner sep=10pt,
    align=center,
    font=\sffamily\bfseries\Large,
    minimum width=1.25in,
    text=white,
  ] {S};%
\end{document}

带白色“S”的蓝色盒子

相关内容