GeneralCoverpage with TikZ

LaTeX specific issues not fitting into one of the other forums of this category.
Post Reply
User avatar
cbustaam
Posts: 57
Joined: Mon Sep 01, 2008 10:17 pm

Coverpage with TikZ

Post by cbustaam »

Hi all,
I'm trying to do a cover page using TikZ package, but some problems appears. I wanto something like:
coverexample.jpg
coverexample.jpg (15.41 KiB) Viewed 7990 times
So far, it has one problem: the orange rectangle overlay the blue one. This effect only can be seen with lower zoom. I tried to change the dimensions of the rectangles (changing milimiter by milimiter) but ever exist some maladjustment. I think that there have to exist some way to make it easier and nicer, I meanm without havo to change the milimeters. Any idea? So far, I have this

Code: Select all

\documentclass{report}
\usepackage[margin=3cm]{geometry}
\usepackage[svgnames]{xcolor}
\usepackage{tikz}

\begin{document}

\begin{tikzpicture}[remember picture,overlay]
  \node[yshift=-5.57cm] at (current page.north west) 
  {\begin{tikzpicture}[remember picture, overlay]
        \draw[draw=MidnightBlue,fill=MidnightBlue] (0,0) rectangle
        (\paperwidth,5.57cm);
   \end{tikzpicture}
  };
\end{tikzpicture}

\begin{tikzpicture}[remember picture,overlay]
  \node[yshift=-1.2\paperheight] at (current page.north west) 
  {\begin{tikzpicture}[remember picture, overlay]
        \draw[draw=DarkOrange,fill=DarkOrange] (0,-10) rectangle         
        (7cm,\paperheight);
   \end{tikzpicture}
  };
\end{tikzpicture}

\end{document}
Also, How can I put the text?

Bests
"Show me your .emacs and I'll tell you who you are." -- modified proverb

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

gmedina
Posts: 2313
Joined: Wed Jul 11, 2007 11:45 pm

Coverpage with TikZ

Post by gmedina »

Hi,

you can use the following as a starting point:

Code: Select all

\documentclass[svgnames]{article}
\usepackage{tikz}
\usepackage{fix-cm}

% command to facilitate the change in font size
\newcommand\myfont[2]{\fontsize{#1}{#2}\selectfont}

\begin{document}
\thispagestyle{empty}

\begin{tikzpicture}[remember picture,overlay,line width=0mm]
  % draw the orange strip
  \draw [draw=DarkOrange,fill=DarkOrange]
    (current page.south west) rectangle (1.5,1);
  % draw the blue strip
  \draw [draw=MidnightBlue,fill=MidnightBlue]
    (current page.north west) rectangle (\paperwidth,1);
  % place the text inside the blue stripe
  \node[xshift=.6\paperwidth,yshift=1.8cm,text=white,font=\myfont{40}{48}] {Text 1};
  % place the title
  \node[yshift=.5cm,xshift=2.5cm] at (current page.center)
    [text width=8cm,text=MidnightBlue,font=\myfont{50}{60},above right]{Title Here};
  % place the date
  \node[yshift=.5cm,xshift=1cm] at (current page.south west)
    [text width=6cm,text=white,font=\Large,above right]{\today};
  % place the logo (I used \rule to simulate the logo)
  \node[yshift=1cm,xshift=.6\paperwidth] at (current page.south west)
    [text width=5cm,text centered,above right]{\rule{5cm}{2cm}};
\end{tikzpicture}

\end{document}
1,1,2,3,5,8,13,21,34,55,89,144,233,...
User avatar
cbustaam
Posts: 57
Joined: Mon Sep 01, 2008 10:17 pm

Re: Coverpage with TikZ

Post by cbustaam »

Thanks for your reply gmedina,
One question: How can I set up the text "environment"? For example, set the alignment (left, rigth or center), the vertical space between lines, font family, etc.
Bests
"Show me your .emacs and I'll tell you who you are." -- modified proverb
User avatar
gmedina
Posts: 2313
Joined: Wed Jul 11, 2007 11:45 pm

Coverpage with TikZ

Post by gmedina »

Hi,

PGF/TikZ offers you some options to set the text justification and the text font (refer to the pgf manual); however, you can also use the standard LaTeX commands:

LaTeX font commands

and you can also use something like

Code: Select all

  
...
\node at (current page.center) 
{\parbox{5cm}{\raggedleft some text text text text text text
text text text text text text text text text text text text
text text text text text text text text text text text text
text text}};
1,1,2,3,5,8,13,21,34,55,89,144,233,...
Post Reply