I need some help with a titlepage for tikz
I want to create the following… 3 red lines, a gray space a green space but I already fail with just creating a line across the whole page…
\draw (0,0) -- (\pagewidth,0)
fails :-(, it only creates a line of 2 cm or so…
I hope anyone is good with tikz and can create this for me.
Update
@Tobi I now have the following:
\documentclass{report}
\usepackage{graphicx}
\usepackage{tikz}
\usetikzlibrary{
calc,
positioning
}
\begin{document}
\begin{titlepage}
\begin{tikzpicture}[overlay,remember picture]
\coordinate (SW) at (current page.south west);
\coordinate (SE) at (current page.south east);
\coordinate (NW) at (current page.north west);
\coordinate (NE) at (current page.north east);
% commented out because it is not necessary to compile,
% but one should note that the background is here,
% because of overlapping parts.
%\node at ($(current page.south west)$){
% \begin{tikzpicture}[overlay]
% %\includegraphics[width=\paperwidth]{./figures/cover_spaceshuttle.jpg}
% \end{tikzpicture}};
\fill[blue,very nearly opaque] ($(SW)!0.2!(SE)$) -| ($(SE)!1.95!(NE)$) -- cycle;
\fill[red,very nearly opaque] ($(SW)!0.2!(SE)$) -| ($(SE)!1.95!(NE)$) -- cycle;
\draw[white,fill] ($(SW)$) rectangle ($(SE)!0.1!(NE)$);
\fill[blue,very nearly opaque] ($(SW)!0.2!(SE)$) -| ($(SE)!1.95!(NE)$) -- cycle;
\draw[red] ($(SW)!0.20!(SE)$) -- ($(NW)!0.61!(NE)$);
\draw[red] ($(SW)!0.10!(NW)$) -- ($(SE)!0.10!(NE)$);
\node at ($(SW)!0.1!(NW)$) [
anchor=north,
xshift=6.40cm,
yshift=0.13cm,
minimum width=\paperwidth,
align=center,
outer sep=0pt,
font=\sffamily]{something};
\end{tikzpicture}
\end{titlepage}
\end{document}
This code generates the following page
Now the blue fill fills all the way to the top, on the left side. But I only want to let it fill at about $(SW)!0.05!(NW)$, the right side. How do I achieve this? Thanks in advance
Best Answer
Use the options
overlay
andremember picture
to make the cooridnates of the current page available as thecurrent page
node.Try to adapt this to fit your needs …
(Compile twice to get the right result)
Update
I added three more ways to position your elements on the page
(O)
to the lower left corner 1 of the page and move relatively [2] to it (needscalc
library [0]).(point)!div!(point)
syntax [3] (needscalc
library [0]).positioning
library [0]).