2

see this MWE

\documentclass{article}
\usepackage{lipsum}
\usepackage{tcolorbox}
\usepackage{paracol}
\tcbuselibrary{breakable}
\begin{document}
\begin{paracol}{2}

\begin{rightcolumn}
\lipsum[1-2]

\begin{tcolorbox}[breakable]
\lipsum[1]
\end{tcolorbox}

\end{rightcolumn}
\begin{leftcolumn}
\lipsum
\end{leftcolumn}

\end{paracol}
\end{document}

compiled with XeLaTeX the breakable box in the right side Cause displacement of text on the left

enter image description here how we can fix this?

5
  • I cannot reproduce this output. Where your red arrow is, I have the rest of the text for the left column. I also tried with an older version of tcolorbox without problems. I compiled with pdflatex. Jul 26, 2014 at 8:50
  • Forgot to say that I use XeLaTeX to compile my code
    – Salim Bou
    Jul 26, 2014 at 9:16
  • I am compelled to use XeLaTeX For its ability of employment of Fonts System
    – Salim Bou
    Jul 26, 2014 at 9:25
  • With XeLaTeX I can reproduce the problem. But at the moment I do not have an idea why pdflatex and XeLaTeX produce different output in this case. Jul 26, 2014 at 9:45
  • The text on the left side is not displaced but written in white (or with opactiy 0). I think this is related to tex.stackexchange.com/questions/186139/… and tex.stackexchange.com/questions/188174/… Jul 26, 2014 at 13:54

2 Answers 2

3

The text on the left hand side is not displaced but written with white color. The reason is a color stack problem resulting from vsplitting. pdflatex and xelatex seem to have a different color implementation.

I changed the placing of text colors for tcolorbox with the recent version 3.12 (2014/07/29).

This version was tested with MiKTeX. The following test file compiled without problems with different engines:

\documentclass{article}
\usepackage{lipsum}
\usepackage{tcolorbox}
\usepackage{paracol}
\tcbuselibrary{breakable,skins}

\begin{document}
\begin{paracol}{2}

\begin{rightcolumn}
\lipsum[1-2]

\begin{tcolorbox}[breakable,enhanced jigsaw,
  size=small,colback=red!10!white,colupper=blue!50!black,
  vfill before first,height fixed for=middle,
  pad at break=1mm]
\lipsum[1]
\end{tcolorbox}

\end{rightcolumn}
\begin{leftcolumn}
\lipsum
\end{leftcolumn}

\end{paracol}
\end{document}

I compiled with three engines:

This is XeTeX, Version 3.1415926-2.5-0.9999.3 (MiKTeX 2.9) (preloaded format=xelatex 2014.6.23)

and

This is pdfTeX, Version 3.1415926-2.5-1.40.14 (MiKTeX 2.9) (preloaded format=pdflatex 2013.6.27)

and

This is LuaTeX, Version beta-0.76.0-2013062820 (rev 4627) (format=lualatex 2013.12.20)

All three produced the same output:

enter image description here

Note that it is still possible to provoke color errors in combination with paracol, if color commands are written into the box text. These errors appear for tcolorbox and mdframed alike. If this happens, it seems to be enough to place a \color{.} inside the column where colors disappear or are set wrong. This also worked in my experiment for tcolorbox and mdframed alike. If no color commands are written into the box text, I found no problems with the development version using MiKTeX.

2
  • I've downloaded the tcolorbox 3.12pre1 and Everything works well , thanks for this awesome package and for your efforts to improve it Good luck .
    – Salim Bou
    Jul 28, 2014 at 12:58
  • @seloumi Glad I could help :-) The final version 3.12 is out now on GitHub and will be available at CTAN soon. Note that I added the vfill before first option to the example code. Jul 29, 2014 at 13:51
2

with mdframed we can put a breakable box without causing shift of text in the left column

\usepackage{lipsum}
\usepackage{mdframed}
\usepackage{paracol}
\usepackage{xcolor}
\begin{document}
\begin{paracol}{2}

\begin{rightcolumn}
\lipsum[1-2]

\begin{mdframed}[backgroundcolor=red!10]
\lipsum[1]
\end{mdframed}

\end{rightcolumn}
\begin{leftcolumn}
\lipsum
\end{leftcolumn}

\end{paracol}
\end{document} 

and we got

enter image description here

You must log in to answer this question.

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