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 want to make a rectangle like the image in which I could add an image with \includegraphics. I have the following rectangle code:

\begin{tikzpicture}[overlay,remember picture]
        \draw [xshift=3mm,line width=7pt,rounded corners=7pt, draw=black]
        ($ (current page.north west) + (15mm,-15mm) $)
        rectangle
        ($ (current page.south east) + (-15mm,15mm) $);
\end{tikzpicture}

Example

share|improve this question
2  
Use tcolorbox it has all of this and many more. This must be a duplicate but I can't find it. –  percusse Aug 24 at 18:47
    
I know with tcolorbox has the option, but I don't want to use it, that's why ask this –  hkviktor Aug 24 at 19:26

1 Answer 1

up vote 3 down vote accepted

I am not sure to understand the question

try this

\documentclass[a4paper]{article}                

\usepackage{pgf,tikz}
\usetikzlibrary{fit,calc,positioning}

\begin{document}

\begin{tikzpicture}
\node[draw,,line width=5pt,rounded corners=5pt,](cadre){\includegraphics[width=10cm]{linux-penguin}};
        \draw [xshift=3mm,line width=5pt,rounded corners=5pt, draw=black,fill=white]
        ($ (cadre.north) + (15mm,-5mm) $)
        rectangle
        ($ (cadre.north) + (-15mm,5mm) $);
\end{tikzpicture}
\end{document}

enter image description here

with your source and comments

\documentclass[a4paper]{article}                


\usepackage{pgf,tikz}
\usetikzlibrary{fit,calc,positioning}

\begin{document}


\begin{tikzpicture}[overlay,remember picture]
        \draw [xshift=3mm,line width=7pt,rounded corners=7pt, draw=black]
        ($ (current page.north west) + (15mm,-15mm) $)
        rectangle
        ($ (current page.south east) + (-15mm,15mm) $);
        \node at ($ (current page.north) + (0,-15mm) $) [draw,line width=5pt,rounded corners=5pt,]{\includegraphics[width=4cm]{linux-penguin}};
\end{tikzpicture}


\end{document}

enter image description here

share|improve this answer
    
Almost, but the image was supposed to be inside the blue rectangle –  hkviktor Aug 24 at 19:25

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.