我想从标题中删除冒号
\documentclass{article}
\usepackage{tcolorbox}
\tcbuselibrary{theorems, breakable, skins}
\newtcbtheorem[no counter]{free}% environment name
{}% Title text
{enhanced, % tcolorbox styles
attach boxed title to top center={yshift=-2.5mm},
colback=white, colframe=black, colbacktitle=white, coltitle=black,
boxed title style={size=small,colframe=white},
fonttitle=\bfseries,
sharp corners=all,
breakable
}%
{freee}% label prefix
\begin{document}
\begin{free}{Stochastic calculus}{}
Stochastic calculus is a branch of mathematics that operates on stochastic
processes. It allows a consistent theory of integration to be defined for
integrals of stochastic processes with respect to stochastic processes. It is
used to model systems that behave randomly.
\end{free}
\noindent\textbf{Solution \ref{ex:sets}.}
\end{document}
产生
答案1
您可以使用separator sign none
。但请注意,由于您没有指定标题,因此您必须应用肮脏的手动黑客攻击(似乎不打算使用没有标题的)。
\documentclass{article}
\usepackage{tcolorbox}
\tcbuselibrary{theorems, breakable, skins}
\newtcbtheorem[no counter]{free}% environment name
{\hskip-.3em}% Title text
{enhanced, % tcolorbox styles
attach boxed title to top center={yshift=-2.5mm},
colback=white, colframe=black, colbacktitle=white, coltitle=black,
boxed title style={size=small,colframe=white},
fonttitle=\bfseries,
sharp corners=all,
breakable,
separator sign none,
}%
{freee}% label prefix
\begin{document}
\begin{free}{Stochastic calculus}{}
Stochastic calculus is a branch of mathematics that operates on stochastic
processes. It allows a consistent theory of integration to be defined for
integrals of stochastic processes with respect to stochastic processes. It is
used to model systems that behave randomly.
\end{free}
\noindent\textbf{Solution \ref{ex:sets}.}
\end{document}
答案2
为什么不直接使用\newtcolorbox
:
\documentclass{article}
\usepackage{tcolorbox}
\tcbuselibrary{theorems, breakable, skins}
\newtcolorbox{free}[1][0]
{enhanced, % tcolorbox styles
attach boxed title to top center={yshift=-2.5mm},
colback=white, colframe=black, colbacktitle=white, coltitle=black,
boxed title style={size=small,colframe=white},
fonttitle=\bfseries,
sharp corners=all,
title={#1},
breakable
}%
\begin{document}
\begin{free}[Stochastic calculus]
Stochastic calculus is a branch of mathematics that operates on stochastic
processes. It allows a consistent theory of integration to be defined for
integrals of stochastic processes with respect to stochastic processes. It is
used to model systems that behave randomly.
\end{free}
\noindent\textbf{Solution \ref{ex:sets}.}
\end{document}