[Tex/LaTex] tcolorbox theorem which isn’t framed on the sides

tcolorboxtheorems

Minimal example:
enter image description here

\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}

I would like to completely eliminate the frames on the side, while keeping the one on bottom.

Best Answer

First, let me say, your settings are correct, but what you see are previewer artifacts. It depends on the previewer if you see the small lines or not.

I have two solutions how to get rid of these artifacts.

The first one changes your code just sligtly. Mainly, enhanced is replaced by enhanced jigsaw. The jigsaw variant uses another code to draw the frame which can be used for transparent boxes. Also, zero width lines are not displayed by many previewers:

\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}

This gives the expected result with Adobe Reader and SumatraPDF on Windows:

enter image description here

You may have a previewer which still shows left and right lines. In this case, I have a second solution. Here, I do not expect any artifacts because there is simply nothing drawn at all. The bottom rule is made by a borderline south option:

\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}