8

I try to add picture.png in header of tcolorbox. I want to place this picture in bottom title belt.

This is my box:

\newtcolorbox{SimpleBox}{
  breakable,
  enhanced,
  colback=red!0!white,
  colframe=red!75!black,
  title={\large Simple box},
}

How I can add picture.png?

When I add before } line

\hfill\smash{\raisebox{-11pt}{\includegraphics[width=1cm,height=1cm]{picture.png}}}

I achieve errors...

9

You have to add it inside the title option:

\documentclass{article}

\usepackage{mwe} % just for the example

\usepackage[most]{tcolorbox}

\newtcolorbox{SimpleBox}{%
  breakable,
  enhanced,
  colback=red!0!white,
  colframe=red!75!black,
  title={\large Simple box\hfill%
    \smash{\raisebox{-11pt}{\includegraphics[width=1cm,height=1cm]{example-image}}}},
}

\begin{document}

\begin{SimpleBox}
Some Text
\end{SimpleBox}

\end{document} 

enter image description here

Substitute example-image with your picture.png

  • I think mwe package is perfect for such dummy image use. – percusse Apr 8 '14 at 9:54
  • @percusse You're right. – karlkoeller Apr 8 '14 at 9:54
  • @HarishKumar I know. Just in case the image is not in the OP's TeX path. – karlkoeller Apr 8 '14 at 9:58
  • 1
    @karlkoeller, thank you. And how I can place picture.png on left side of title? – Ama Apr 8 '14 at 10:02
  • 1
    @ama invert the two things inside the title – karlkoeller Apr 8 '14 at 10:11

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.