## LaTeX forum ⇒ Page Layout ⇒ Problem with newtcbtheorem

Information and discussion about page layout specific issues (e.g. header and footer lines, page formats, page numbers).
PooggaTo
Posts: 2
Joined: Sat Jun 22, 2019 1:26 pm

### Problem with newtcbtheorem

Hello everybody,

im working on my bachelor's degree and have a problem with my theorems.

A friend of mine told me i should use "\newtcbtheorem".

So i made some for every case i need.

`\newtcbtheorem[number within = chapter, Crefname={Definition}{Definition} ]{MyDef}{Definition}%{fonttitle=\bfseries, enhanced, theorem number and name,	frame code={		\path[thick, draw] (frame.north west)  +(.5\baselineskip,0) -| +(0,-.5\baselineskip);		\path[thick, draw] (frame.north east) +(-.5\baselineskip,0) -| +(0,-.5\baselineskip);		\path[thick, draw] (frame.south west) +(.5\baselineskip,0) -| +(0,.5\baselineskip);		\path[thick, draw] (frame.south east) +(-.5\baselineskip,0) -| +(0,.5\baselineskip);	},	left=1mm, right=1mm, top=1mm, bottom=1mm,	colback=black!0,	coltitle=black}{def}`

Now my problem is, when i write text, which is longer than one page, in this theorem, LaTeX doesn't make a regular page break and continue text on page margin or even page below. I can't find any solution rn, let me know if u can help me! I appreciate your help a lot

greetings, PooggaTo

Stefan Kottwitz
Posts: 9416
Joined: Mon Mar 10, 2008 9:44 pm
Hi PooggaTo,

welcome to the forum!

Just add the `breakable` option, such as

`\newtcbtheorem[number within = chapter, Crefname={Definition}{Definition} ]{MyDef}{Definition}%{fonttitle=\bfseries, enhanced, theorem number and name,	breakable,	frame code={		\path[thick, draw] (frame.north west)  +(.5\baselineskip,0) -| +(0,-.5\baselineskip);		\path[thick, draw] (frame.north east) +(-.5\baselineskip,0) -| +(0,-.5\baselineskip);		\path[thick, draw] (frame.south west) +(.5\baselineskip,0) -| +(0,.5\baselineskip);		\path[thick, draw] (frame.south east) +(-.5\baselineskip,0) -| +(0,.5\baselineskip);	},	left=1mm, right=1mm, top=1mm, bottom=1mm,	colback=black!0,	coltitle=black}{def}`

Stefan

PooggaTo
Posts: 2
Joined: Sat Jun 22, 2019 1:26 pm
Thank you, Stefan.

I have tried this before, but I forget to add it in \tcbuserlibrary, sorry my fault.
`\tcbuselibrary{theorems, skins, breakable}`

So now it works, but I get a new problem.
`\newtcbtheorem[use counter from = MyDef, number within = chapter, Crefname={Satz}{Satz}]{MySatz}{Satz}%{fonttitle=\bfseries, enhanced, theorem number and name, breakable,	frame code={		\path[thick, draw] (frame.north west)  +(.5\baselineskip,0) -| +(0,-.5\baselineskip);		\path[thick, draw] (frame.north east) +(-.5\baselineskip,0) -| +(0,-.5\baselineskip);		\path[thick, draw] (frame.south west) +(.5\baselineskip,0) -| +(0,.5\baselineskip);		\path[thick, draw] (frame.south east) +(-.5\baselineskip,0) -| +(0,.5\baselineskip);	},	left=1mm, right=1mm, top=1mm, bottom=1mm,	colback=black!0,	coltitle=black,}{sat}`

Now, if LaTeX made a break, the break is perfekt, but, the design change back to this:

But it should look like this:

Any ideas why does it change back and how i could fix it?

kind regards