newtcbtheorem 的问题

newtcbtheorem 的问题

我想删除下面separator sign={\ ---}\newtcbtheorem。我的意思是:我想要一个能产生这张照片中tcolorbox-latex-function最后一个的。tcolorbox

索莱克斯

我尝试\newtcbtheorem这样写:

\newtcbtheorem[number within=subsection]{SolEx}{Soluzione dell'\Exref{\pgfkeysvalueof{/tcb/exercise ref}} --- }{enhanced, colback=red!5!white, colframe=black, sharpish corners, breakable, separator sign none, fonttitle=\bfseries, coltitle=orange}{ex}

可以吗?非常感谢

\PassOptionsToPackage{svgnames, x11names}{xcolor}
\documentclass[openany]{book}
\usepackage[T1]{fontenc}
\usepackage{lmodern}
\usepackage[italian]{babel}
\usepackage[utf8]{inputenc}
\usepackage[a4paper,top=3cm,bottom=3cm,left=1.5cm,right=1.5cm]{geometry}
\usepackage[svgnames,x11names]{xcolor}
\usepackage{amscd}
\usepackage{color}
\usepackage{stix}
\usepackage{mathtools}
\usepackage{amsthm}
\usepackage{imakeidx}
\usepackage[tight, italian]{minitoc}
\usepackage[most]{tcolorbox}
\tcbuselibrary{breakable,theorems,skins}
\usepackage[colorlinks=true]{hyperref}
\hypersetup{pdfstartview=FitH}
\usepackage{cleveref}

% New Exercises

\newtcbtheorem[number within=subsection] {exercise}{Esercizio}{%
enhanced, colback=red!5!white, colframe=gray, sharpish corners, breakable, fonttitle=\bfseries, coltitle=green, separator sign={\ ---},#1, description delimiters={$\bigl($}{$\bigr)$}}{ex}

\newtcbtheorem[use counter from=exercise] {solex}{}{enhanced, colback=red!5!white, colframe=gray, sharpish corners, breakable, separator sign none, fonttitle=\bfseries, coltitle=green, #1}{solex}

\newtheorem{esercizio}{Esercizio}[subsection]

% For solutions

\tcbset{exercise ref/.initial=,}

\newtcbtheorem[number within=subsection]{SolEx}{Soluzione dell'\Exref{\pgfkeysvalueof{/tcb/exercise ref}} --- }{enhanced, colback=red!5!white, colframe=black, sharpish corners, breakable, separator sign none, fonttitle=\bfseries, coltitle=orange}{ex}

% New ref

\newcommand{\Exref}[1]{\textcolor{red}{Esercizio} \ref{ex:#1}}

\begin{document}

\Large

\begin{exercise}{Esercizio d'esempio}{EX1}

\end{exercise}

\begin{SolEx*}[exercise ref={EX1}]

\end{SolEx*}

But I'd like something like this

\begin{tcolorbox}[enhanced, colback=red!5!white, colframe=black, sharpish corners, breakable, separator sign none, fonttitle=\bfseries, coltitle=orange, title={Soluzione dell'\Exref{EX1}}]

\end{tcolorbox}

\end{document}

答案1

改变你的

\newtcbtheorem[number within=subsection]{SolEx}{Soluzione dell'\Exref{\pgfkeysvalueof{/tcb/exercise ref}} --- }{enhanced, colback=red!5!white, colframe=black, sharpish corners, breakable, separator sign none, fonttitle=\bfseries, coltitle=orange}{ex}

进入

\newtcbtheorem[number within=subsection]{SolEx}
  {Soluzione dell'\Exref{\pgfkeysvalueof{/tcb/exercise ref}}}{
  enhanced,
  colback=red!5!white,
  colframe=black,
  sharpish corners,
  breakable,
  separator sign none,
  fonttitle=\bfseries,
  coltitle=orange
}{ex}

这不仅简化了维护,而且表明您已经

Soluzione dell'\Exref{\pgfkeysvalueof{/tcb/exercise ref}} --- 

因此,TeX 当然按照要求添加了破折号。

相关内容