Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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...

share|improve this question

1 Answer 1

up vote 6 down vote accepted

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

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

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.