3

I'm trying to create two columns in my \tcolorbox that allow for a title of sorts to the left with a small paragraph to the right. However, my current code just puts the first line of the paragraph to the left and creates a body next to it (see photo). I want the ABC to be alone in the middle to the left, but the remaining text to be in one paragraph together.

   \documentclass[11pt]{article}
   \usepackage[utf8]{inputenc}
   \usepackage{tikz,tcolorbox}
   \usepackage{xcolor}
   \usepackage{geometry}
   \usepackage{helvet}
   \usepackage{moresize}
   \usepackage{multicol}
   \begin{document} 
\definecolor{burgundy}{HTML}{CC0000}      
  \begin{tcolorbox}[colback=burgundy, colframe=burgundy, width=5.65in, coltext=white,lefthand width=1.2in, righthand width=4.06in] %Impact block
  \begin{multicols}{2}
  {\HUGE ABC}
  \columnbreak
  Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.
  \end{multicols}
  \end{tcolorbox}
  \end{document}

enter image description here

I want something more like this

enter image description here

New contributor
Latex Learnin is a new contributor to this site. Take care in asking for clarification, commenting, and answering. Check out our Code of Conduct.
3

2 Answers 2

4

If you don't want equal widths, don't use multicols. (Normally I would use paracol, but it needs to be in outer par mode.)

You can make the ABC larger using \scalebox or \resizebox.

\documentclass[11pt]{article}
   \usepackage[utf8]{inputenc}
   \usepackage{tikz,tcolorbox}
   \usepackage{xcolor}
   \usepackage{geometry}
   \usepackage{helvet}
   \usepackage{moresize}
   %\usepackage{multicol}
   \begin{document} 
\definecolor{burgundy}{HTML}{CC0000}      
  \begin{tcolorbox}[colback=burgundy, colframe=burgundy, width=5.65in, coltext=white,lefthand width=1.2in, righthand width=4.06in] %Impact block
  \sbox0{\HUGE\bfseries ABC}% measure width
  \parbox[c]{\wd0}{\usebox0}\hfill
  \parbox[c]{\dimexpr \linewidth-\columnsep-\wd0}{%
  Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.}
  \end{tcolorbox}
  \end{document}

demo

4

Instead of using columns, you could place the title in a wider left rule.

Or you could use the sidebyside feature.

\documentclass[11pt]{article}

\usepackage[most]{tcolorbox}

\begin{document}

  \noindent
  \begin{tcolorbox}[
    enhanced,
    colback=red, 
    colframe=red, 
    coltext=white,
    title=ABC,
    leftrule=.2\linewidth,
    detach title,
    overlay={
      \node[anchor=north east,white,font=\Huge,inner sep=\topsep,text width=.2\linewidth,align=center,xshift=2\topsep] at (interior.north west) {\tcbtitletext};
    }
  ]
    Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.
  \end{tcolorbox}
  
  \noindent
  \begin{tcolorbox}[
    colback=red,
    colframe=red,
    coltext=white,
    sidebyside,
    lefthand width=1.5cm,
    lower separated=false,
    sidebyside align=top seam
  ]
    {\centering\Huge ABC\par}
    \tcblower
    Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.
  \end{tcolorbox}
  
\end{document}

enter image description here

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.