tcolorbox 定理,没有边框

tcolorbox 定理,没有边框

最小示例: 在此处输入图片描述

\documentclass[]{report}
\usepackage{tcolorbox}
\tcbuselibrary{theorems}
\tcbuselibrary{skins}
\newtcbtheorem[number within=chapter]{thm}{Theorem}
{theorem style=change apart,enhanced,arc=0mm,outer arc=0mm,
boxrule=0pt,toprule=1pt,bottomrule=1pt,left=0.2cm,right=0.2cm,
titlerule=0.5em,toptitle=0.1cm,bottomtitle=-0.1cm,top=0.2cm,
colframe=white!25!black,colback=white,coltitle=white,
title style={white!25!black},
fonttitle=\bfseries,fontupper=\normalsize}{thm}
\begin{document}

\begin{thm}{Stokes}{stokes}
Let $D$ be a regular domain in an oriented $n$-dimensional manifold $M$, 
and let $\omega$ be a smooth $(n-1)$ form of compact support. Then
\[\int_D d\omega = \int_{\partial D} \omega.\]
\end{thm}

\end{document}

我想完全消除侧面的框架,同时保留底部的框架。

答案1

首先,我要说的是,您的设置是正确的,但您看到的是预览器伪影。您是否看到小线条取决于预览器。

我有两种解决方案可以消除这些问题。

第一个只是稍微改变了你的代码。主要是,enhanced被替换enhanced jigsaw。拼图变体使用另一个代码来绘制可用于透明框的框架。此外,许多预览器不显示零宽度线:

\documentclass[]{report}
\usepackage{tcolorbox}
\tcbuselibrary{theorems}
\tcbuselibrary{skins}
\newtcbtheorem[number within=chapter]{thm}{Theorem}{
  theorem style=change apart,
  enhanced jigsaw,% <--- jigsaw
  sharp corners,
  boxrule=0pt,
  toprule=1pt,bottomrule=1pt,
  left=0.2cm,right=0.2cm,top=0.2cm,
  titlerule=0.5em,
  toptitle=0.1cm,
  bottomtitle=-0.1cm,
  colframe=white!25!black,colback=white,coltitle=white,
  %title style={white!25!black},   & <---- remove
  fonttitle=\bfseries,fontupper=\normalsize}{thm}
\begin{document}

\begin{thm}{Stokes}{stokes}
Let $D$ be a regular domain in an oriented $n$-dimensional manifold $M$,
and let $\omega$ be a smooth $(n-1)$ form of compact support. Then
\[\int_D d\omega = \int_{\partial D} \omega.\]
\end{thm}

\end{document}

这给出了 Windows 上 Adob​​e Reader 和 SumatraPDF 的预期结果:

在此处输入图片描述

您可能有一个预览器,它仍然显示左右线。在这种情况下,我有第二个解决方案。在这里,我不希望有任何瑕疵,因为根本没有绘制任何内容。底部规则由一个borderline south选项制定:

\documentclass[]{report}
\usepackage{tcolorbox}
\tcbuselibrary{theorems}
\tcbuselibrary{skins}
\newtcbtheorem[number within=chapter]{thm}{Theorem}{
  theorem style=change apart,
  enhanced,
  frame hidden,interior hidden,
  sharp corners,
  boxrule=0pt,
  left=0.2cm,right=0.2cm,top=0.2cm,
  toptitle=0.1cm+1pt,%        <-- I used your values here
  bottomtitle=-0.1cm+0.5em,%  <-- I used your values here
  colframe=white!25!black,colback=white,coltitle=white,
  title style=white!25!black,
  bottomrule=1pt,%  <-- reserve space
  borderline south={1pt}{0pt}{white!25!black},%---- draw line
  fonttitle=\bfseries,fontupper=\normalsize}{thm}
\begin{document}

\begin{thm}{Stokes}{stokes}
Let $D$ be a regular domain in an oriented $n$-dimensional manifold $M$,
and let $\omega$ be a smooth $(n-1)$ form of compact support. Then
\[\int_D d\omega = \int_{\partial D} \omega.\]
\end{thm}

\end{document}

答案2

可以在定义的选项参数中使用 、 等来leftrule=0pt设置各个规则rightrule=0pt\newtcbtheorem

\documentclass[]{report}
\usepackage{tcolorbox}
\tcbuselibrary{theorems}
\tcbuselibrary{skins}
\newtcbtheorem[number within=chapter]{thm}{Theorem}
{theorem style=change apart,enhanced,arc=0mm,outer arc=0mm,
boxrule=0pt,toprule=1pt,leftrule=0pt,bottomrule=1pt, rightrule=0pt,left=0.2cm,right=0.2cm,
titlerule=0.5em,toptitle=0.1cm,bottomtitle=-0.1cm,top=0.2cm,
colframe=white!25!black,colback=white,coltitle=white,
title style={white!25!black},
fonttitle=\bfseries,fontupper=\normalsize}{thm}
\begin{document}

\begin{thm}{Stokes}{stokes}
Let $D$ be a regular domain in an oriented $n$-dimensional manifold $M$, 
and let $\omega$ be a smooth $(n-1)$ form of compact support. Then
\[\int_D d\omega = \int_{\partial D} \omega.\]
\end{thm}

\end{document}

在此处输入图片描述

相关内容