I'm requesting your help because after trying to understand this according to TikZ handbook and many example on internet, I feel lost.
I would like a fancy header with Picture (photo) with a rectangle on top of the page width inside a photo left center inside the box and Name center inside the box.
First of all, the code (I tried to make it as simple as possible):
Code: Select all
\documentclass[]{report}
\usepackage[a4paper, top= 1cm, left=1.5cm, right=1.5cm]{geometry}
\usepackage{tikz}
\usepackage{lipsum}
\newcommand{\heading}[2]{
\begin{tikzpicture}[remember picture,overlay]
\node [rectangle, fill=gray, anchor=north, minimum width=\paperwidth, minimum height=3cm]
(box) at (current page.north);
\node[anchor=center] at (box) {\Huge\color{white}%
{#1}\ {#2}};
\node[anchor=north east, minimum size=1in] at (current page.north)
{\includegraphics[scale=.2]{example-image-a}};
\end{tikzpicture}
\vskip 2cm
}
\begin{document}
\heading{John}{Doe}
\lipsum
\lipsum
\end{document}
Code: Select all
\node [rectangle, fill=gray, anchor=north, minimum width=\paperwidth, minimum height=3cm]
(box) at (current page.north);
- (box) : what's the meaning of this ? I was expecting north/south/west/east values (of box here means "generic define" ? )
Code: Select all
\node[anchor=north east, minimum size=1in] at (current page.north)
{\includegraphics[scale=.2]{example-image-a}};
I think I do not have the understanding yet, that's why I ask you help as expert to help me.
Thank you very much for helping me.