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'm not that familiar with TikZ and I want to use it for designing by front page. I want a blue bar in the top, where some text is centered in the bar. Like following (how do I center the text without using hspace to push the text in?)

\begin{tikzpicture}[remember picture,overlay]
  \node [xshift=\,yshift=-2cm] at (current page.north west)
  [text width=\textwidth,fill=my_defined_blue,below right]
  {
   \hspace{3.5cm} \textcolor{white}{\Large{\textsc{School Name}}}
  };
\end{tikzpicture}

However, I also want a logo on bar, which should be a bit larger than the bar. Any suggestions, how this should be done?

The logo structure: Logo structure

share|improve this question

1 Answer 1

up vote 6 down vote accepted

Is this what you're looking for? The frame around the logo is drawn "by hand", so if you have a complicated shape, your suggestion of using a transparent PNG with a white border might be more practical.

\documentclass[a4paper]{article}

\usepackage{tikz}
\usepackage{lipsum}

\begin{document}

\begin{tikzpicture}[remember picture,overlay]

\coordinate [below=2.5cm] (midpoint) at (current page.north);

\node [name=colourbar,
anchor=base,
fill=blue!40,
text = white,
minimum width=\paperwidth,
minimum height=1cm] at (midpoint) {\huge{\textsc{School Name}}};

% Define the point where the logo will go
\coordinate [right=4cm] (logo) at (colourbar.west);

% Set coordinate system origin
\begin{scope}[shift=(logo)]
% Draw the outline
\filldraw [white,draw=red] (2.3,0.85) -- (-2,0.85) -- (-2.8,-0.85) -- (2.3,-0.85) --cycle;
% Include the logo
\node {\includegraphics[width=4cm]{logo}};
\end{scope}

\end{tikzpicture}

\section{Normal stuff starts here}
\lipsum

\end{document}

Title page with TikZ

share|improve this answer
    
Nice! Yes, something like that. I have edited the my post, with the more tricky part of the bar. The logo should is in between the red area. My backup solution to this, is to use a transparent png image in the corner with a white background. Do you have a better suggestion? –  aagaard Jan 21 '11 at 11:05
    
Exactly! Thanks –  aagaard Jan 21 '11 at 13:06
    
This example is giving this error l.26 \node {\includegraphics[width=4cm]{logo}} –  Aku Jan 21 '11 at 14:01
    
"logo" refers to a file called "logo.png" that needs to be in the same directory as the tex file. I used the LaTeX logo found on Wikipedia. –  Jake Jan 21 '11 at 14:06

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.