LaTeX forum ⇒ Page LayoutProblem 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

Postby PooggaTo » Sat Jun 22, 2019 2:00 pm

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.

  1. \newtcbtheorem[number within = chapter, Crefname={Definition}{Definition} ]{MyDef}{Definition}%
  2. {fonttitle=\bfseries, enhanced, theorem number and name,
  3. frame code={
  4. \path[thick, draw] (frame.north west) +(.5\baselineskip,0) -| +(0,-.5\baselineskip);
  5. \path[thick, draw] (frame.north east) +(-.5\baselineskip,0) -| +(0,-.5\baselineskip);
  6. \path[thick, draw] (frame.south west) +(.5\baselineskip,0) -| +(0,.5\baselineskip);
  7. \path[thick, draw] (frame.south east) +(-.5\baselineskip,0) -| +(0,.5\baselineskip);
  8. },
  9. left=1mm, right=1mm, top=1mm, bottom=1mm,
  10. colback=black!0,
  11. coltitle=black
  12. }{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

User avatar
Stefan Kottwitz
Site Admin
Posts: 9416
Joined: Mon Mar 10, 2008 9:44 pm

Postby Stefan Kottwitz » Sun Jun 23, 2019 3:23 pm

Hi PooggaTo,

welcome to the forum!

Just add the breakable option, such as

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


Stefan
Site admin

PooggaTo
Posts: 2
Joined: Sat Jun 22, 2019 1:26 pm

Postby PooggaTo » Sun Jun 23, 2019 5:43 pm

Thank you, Stefan. :D

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


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

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

But it should look like this:
Image

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

kind regards


Return to “Page Layout”

Who is online

Users browsing this forum: No registered users and 2 guests