4

enter image description here

I'm trying to make tcolorbox like this above and I don't know what is the right way to do it...

This is possible to make tcolorbox like this? (The ABC can be at the center instead...)?

I tried few times and I really don't know how (I think to put the image as watermark, but the the image cropped or something else...)

enter image description here

6
  • 1
    See tex.stackexchange.com/questions/294491 if this can help you.
    – Zarko
    Commented Jul 31, 2019 at 15:11
  • @heblyx: Why a tcolorbox? Is it necessary?
    – Marian G.
    Commented Jul 31, 2019 at 15:11
  • @MarianG. - Yes because I want to to this in box and maby put some titles...
    – heblyx
    Commented Jul 31, 2019 at 15:16
  • 2
    what is the problem: create tcolorbox or its placing on image? For design tcolorbox see the package manual. What you try so far? Question as it is is to broad and also unclear.
    – Zarko
    Commented Jul 31, 2019 at 15:20
  • But when there is an image the second box is beside it and I'm trying to avoid from it...
    – heblyx
    Commented Jul 31, 2019 at 15:24

1 Answer 1

4

Like this?

\documentclass[tikz,margin=5mm]{standalone}
\usepackage[most]{tcolorbox}
\tcbset
    {
        enhanced,
        left=8mm,
        right=8mm,
        boxrule=0.4pt,
        colback=red!5!white,
        boxrule=1pt,
        colframe=red!75!black,fonttitle=\bfseries,
        width=(\linewidth-4pt)/2,
    }
\begin{document}
\begin{tikzpicture}[]
    \node[anchor=south west,inner sep=0] at (0,0)(pic) {\includegraphics[width=\textwidth]{example-image}};
    \draw [ultra thick,red](current bounding box.north east) rectangle (current bounding box.south west);
    \node at ([yshift=-2.5cm] pic.center)
    {\begin{tcolorbox}
    \centering ABC
    \end{tcolorbox}};
\end{tikzpicture}
\end{document}

enter image description here

Giving some opacity to tcolorbox.

\documentclass[tikz,margin=5mm]{standalone}
\usepackage[most]{tcolorbox}
\tcbset
    {
        enhanced,
        left=8mm,
        right=8mm,
        boxrule=0.4pt,
        colback=red!5!white,
        boxrule=1pt,
        colframe=red!75!black,fonttitle=\bfseries,
        width=(\linewidth-4pt)/2,
         }
\begin{document}
\begin{tikzpicture}[]
    \node[anchor=south west,inner sep=0] at (0,0)(pic) {\includegraphics[width=\textwidth]{example-image}};
    \draw [ultra thick,red](current bounding box.north east) rectangle (current bounding box.south west);
    \node[] at ([yshift=-1.25cm] pic.center)
    {\begin{tcolorbox}[
    standard jigsaw,
    opacityback=0.2,  % this works only in combination with the key "standard jigsaw"
]
    \centering ABC
    \end{tcolorbox}};
\end{tikzpicture}
\end{document}

enter image description here

5
  • And if you want to add frame to image is possible?
    – heblyx
    Commented Jul 31, 2019 at 15:49
  • Sure, I have edited my answer.
    – user31034
    Commented Jul 31, 2019 at 16:01
  • Thank you!! BTW the frame can be without space (between the image and the frame)?
    – heblyx
    Commented Jul 31, 2019 at 16:07
  • 1
    So as I understand there is no way to do it with tcolorbox, right?
    – heblyx
    Commented Jul 31, 2019 at 16:09
  • I think, I did not understand your main question rightly. But it is possible to remove the space between image and frame. Please look at my last edited answer.
    – user31034
    Commented Jul 31, 2019 at 16:18

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .