2

I defined a proof environment with tcolorbox and needed the breakable option for bigger proofs and it seemed it interfered with the other options and made an undesired frame.

These are the settings I use to define my environment:

\newtcolorbox{preuve}{
   breakable,
   fonttitle=\bfseries,
   enhanced,   
   top=2mm,
   boxrule=0pt,
   frame empty,
   borderline west={2pt}{5pt}{black},
   coltitle=black,
   colback=white,
   sharp corners,
   title = Preuve }

When a proof is contained within one page, it gives the desired output: example1

But when the proof has to cross a page, a black frame appears: enter image description here


Here's a minimal working example:

\documentclass[12pt,a4paper]{article}
\usepackage[utf8]{inputenc}
\usepackage[french]{babel}
\usepackage{lmodern}
\usepackage[T1]{fontenc}
\usepackage{lipsum}
\usepackage{tcolorbox}
\tcbuselibrary{most}


\newtcolorbox{preuve}{
  breakable,
  fonttitle=\bfseries,
  enhanced,
  top=2mm,
  boxrule=0pt,
  frame empty,
  borderline west={2pt}{5pt}{black},
  coltitle=black,
  colback=white,
  sharp corners,
  title = Preuve
}

\begin{document}


\begin{preuve}
\lipsum[1]
\end{preuve}

\begin{preuve}
\lipsum[1-4]
\end{preuve}

\end{document}
2
  • 1
    Replacing frame empty by frame hidden solved the problem for me.
    – Ignasi
    Feb 27, 2022 at 18:06
  • @Ignasi Yes, it does solve the problem for me too, thank you for this helpful suggestion.
    – Axel
    Feb 27, 2022 at 18:12

1 Answer 1

2

Though the reason to this issue is not clear to me, it seems can be fixed by completely hide the frame with opacityframe = 0. (I've also added a pad at break*=0mm to reduce the extra sep at the break point.)

\documentclass[12pt,a4paper]{article}
\usepackage[utf8]{inputenc}
\usepackage[french]{babel}
\usepackage{lmodern}
\usepackage[T1]{fontenc}
\usepackage{lipsum}
\usepackage{tcolorbox}
\tcbuselibrary{most}


\newtcolorbox{preuve}{
  breakable,
  pad at break*=0mm,
  fonttitle=\bfseries,
  enhanced,
  top=2mm,
  boxrule=0pt,
  frame empty,
  opacityframe = 0,
  borderline west={2pt}{5pt}{black},
  coltitle=black,
  colback=white,
  sharp corners,
  title = Preuve
}

\begin{document}


\begin{preuve}
\lipsum[1]
\end{preuve}

\begin{preuve}
\lipsum[1-4]
\end{preuve}

\end{document}

enter image description here

1
  • Thank you a lot, it completely solves my problem!
    – Axel
    Feb 27, 2022 at 18:04

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .