How to avoid new line jump after each tcolorbox ?



function Table (n)
    for i=1,10

        \Large\hfill\textsf{Table de #1}\hfill\strut}},%
    \end{tcolorbox} bob}


\foreach \i in {1,...,5} {\Table{\i}}

  • Try with the option nobeforeafter --- worked for me. Maybe with the hbox option too.
    – Rmano
    Oct 1 '18 at 8:33
  • 1
    Ok for me. Thank you. Consider to write an answser.
    – Tarass
    Oct 1 '18 at 8:53

Normally tcolorbox try to typeset the box as a paragraph; to do that sets the keys before and after to a value that is dependent on the presence or not of the package parskip (guessed, really). Typically they are something like:

before={\par\pagebreak[0]\smallskip\parindent=0pt}, after={\par\smallskip}

If you want to clear the default values, use the key nobeforeafter; in the manual (pag. 78 in my copy, version 4.12) it states:

Abbreviation for clearing the keys before and after. The colored box is not put into a paragraph and there is no space before or after the box.

Moreover, the option hbox is needed sometime; this will size the box according to the content (and no the other way around; pag. 94):

capture=hbox: This is the default mode for \tcbox. The content cannot have a lower part and cannot be broken. The colored box is sized according to the dimensions of the content. A shortcut to set this mode is /tcb/hbox.

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.