將“tcolorbox”包中的“dot”更改為“dash”

將“tcolorbox”包中的“dot”更改為“dash”

我使用tcolorbox如下所示的包創建了一個盒子:

在此輸入影像描述

現在,我想將“點”更改為“破折號”。我該怎麼做?

答案1

number freestyle我們可以在定義環境時使用該選項tcolorbox

這是一個例子:

\documentclass{article}
\usepackage[theorems]{tcolorbox}
\newtcbtheorem[number freestyle=
                      \noexpand\thesubsection-\noexpand \arabic{\tcbcounter}]
             {example}{Example}{colbacktitle=green!50!black}{exp}

\renewcommand{\thesubsection}{\thesection-\arabic{subsection}} % for the dash in 
                                                               % the subsection number
\begin{document}
\section{First section}
\section{second section}
\subsection{First subsection}
\begin{example}{}{example1}
This is an example
\end{example}
\end{document}

在此輸入影像描述

相關內容