2

I construct a raster by tcolorbox in which nested tcbitemize exists. I want boxes in the same line have the same height, so the option raster equal height=rows is used which seems not work as shown on the attached figure composed by the following MWE -- Same height with the box #1 and #2 is wanted, but they don't. Why and how to solve this problem?

MWE:

\documentclass[a4paper,12pt]{article}

\usepackage{tcolorbox}
\tcbuselibrary{raster}

\begin{document}

\begin{tcbitemize}[title=\#\thetcbrasternum,
                   raster columns=4,
                   raster equal height=rows]
  \tcbitem 1
  \tcbitem[raster multicolumn=3]
    \begin{tcbitemize}[raster columns=3]
      \tcbitem 1 \tcbitem 1 \tcbitem 1
      \tcbitem 2 \tcbitem 2 \tcbitem 2
      \tcbitem 3 \tcbitem 3 \tcbitem 3
    \end{tcbitemize}
  \tcbitem 4
\end{tcbitemize}

\end{document}

enter image description here

1 Answer 1

4

You need to compile the document twice. raster equal height=rows writes the height of each box in the tcbraster to the .aux file and uses it when the .aux file is reread. This is necessary, because for instance, in order to compose the first box correctly (i.e., for final output), one needs to know the natural height of each box in the first row, which is impossible without using information from a previous TeX run.

After two compilation runs, your unmodified source produces:

screenshot

1
  • Thank you @frougon. By your kindly answer, I find the problem. After delete the original .aux file, twice of compilation give the result I want.
    – lyl
    Aug 25, 2019 at 7:45

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.