具体来说,如何使小节编号变为绿色,而文本颜色默认为白色。
我使用 LuaLaTeX 进行编译,并使用 Chirp 字体作为我选择的字体。
这是我的 MWE:
\documentclass{scrartcl}
\usepackage[margin=0.5in]{geometry}
\usepackage{xcolor}
\usepackage{tikz}
\usepackage{fontspec}
\usepackage{eso-pic}
\usepackage[most]{tcolorbox}
\usepackage{titlesec}
\definecolor{lblack}{RGB}{29,26,45}
\definecolor{gblack}{RGB}{33,31,50}
\definecolor{bgreen}{HTML}{2AB17E}
\pagecolor{lblack}
\setmainfont[Color=white, BoldFont={Chirp Bold}]{Chirp Regular}
\setsansfont[Color=white,BoldFont={Chirp Bold}]{Chirp Regular}
\AddToShipoutPictureBG{%
\begin{tikzpicture}[remember picture, overlay,
help lines/.append style={line width=0.5pt,
color=gblack}]
\draw[help lines] (current page.south west) grid[step=0.25]
(current page.north east);
\end{tikzpicture}%
}
\renewcommand\thesection{\arabic{section}.}
\renewcommand\thesubsection{\Alph{subsection}.}
\titleformat{\section}
{\normalfont\fontsize{12}{15}\bfseries}{\thesection}{0.25em}{}
\titleformat{\subsection}
{\normalfont\fontsize{11}{15}\bfseries\color{bgreen}}{\thesubsection}{0.25em}{}
\begin{document}
\section{Vocabulaire usuel des suites}
\subsection{Sens de variation d'une suite}
\end{document}