3

Maybe I haven't made myself clear. In the following example

\documentclass{scrbook}

\usepackage{tcolorbox}
\usepackage{lipsum}
\tcbuselibrary{skins}
\usepackage{calc}
\usetikzlibrary{patterns}
\tcbuselibrary{skins,breakable}

\newtcolorbox{mybox}{
enhanced,
breakable,
toggle left and right,
colback=white, 
rightrule=3cm,
if odd page={right skip=-3cm}{left skip=-3cm},
colframe = gray!50
}


\begin{document}

\begin{mybox}
\lipsum
\end{mybox}

Anyway

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

\end{document}

the margin of the breakable part on the second page is shifted to right, but I like it in the proper margin as in the second box on page 2

2
\documentclass{scrbook}

\usepackage{tcolorbox}
\usepackage{lipsum}
\tcbuselibrary{skins,breakable}

\newtcolorbox{mybox}{
  enhanced,
  breakable,
  toggle left and right,
  colback=white, 
  rightrule=3cm,
  if odd page={right skip=-3cm}{left skip=-3cm},
  colframe = gray!50,
  extras middle and last={if odd page={right skip=-3cm}{left skip=-3cm},}
}


\begin{document}

\begin{mybox}
\lipsum
\end{mybox}

Anyway

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

\end{document}

better behaved boxes?

| improve this answer | |
  • Perfect, exactly what I was looking for. Thanks very much @cfr – Peter Buechel Nov 13 '19 at 20:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.