LaTeX forum ⇒ Page LayoutHeader box using Tikzpicture: How to modify / add lines Topic is solved

Information and discussion about page layout specific issues (e.g. header and footer lines, page formats, page numbers).
paveheikkinen
Posts: 2
Joined: Mon Oct 20, 2014 9:47 pm

Header box using Tikzpicture: How to modify / add lines

Postby paveheikkinen » Mon Oct 20, 2014 10:04 pm

Hello Latex Community,

I have been working on a CV template to personalize it. Yet, I have not found a way to to modify the header that is originally created with Tikz. The CV concludes from two different files: the actual .tex file and a .cls file. By trying out different combinations I have been able to add a line of text 'randomly' with wrong font and position. What I am trying to do is to add a third lane of text into the header.

The original code:
.cls file
  1. \newcommand{\header}[3]{%
  2. \begin{tikzpicture}[remember picture,overlay]
  3. \node [rectangle, fill=fillheader, anchor=north, minimum width=\paperwidth, minimum height=3.5cm] (box) at (current page.north){};
  4. \node [anchor=center] (name) at (box) {%
  5. \fontsize{40pt}{72pt}\color{header}%
  6. {\thinfont #1}{\bodyfont #2}
  7. };
  8. \node [anchor=north] at (name.south) {%
  9. \fontsize{14pt}{24pt}\color{header}%
  10. \thinfont #3%
  11. };
  12. % This is what I tried adding with unwanted results
  13. % \node [anchor=south] at (box.south) {%
  14. % \fontsize{14pt}\color{header}%
  15. % {\thinfont #4}{\thinfont #5}
  16. % };
  17. \end{tikzpicture}
  18. \vspace{2.5cm}
  19. \vspace{-2\parskip}

And the .tex file
  1. \header{name}{surname}{texline1}
  2. %{text2}{text3} this is what I added to work with the extra code in .cls


So my first question would be the basics about the node. Am I missing some other part of code which influences the number of lines in the header?
Secondly, how can I set the third node position correctly?
All in all, I would truly appreciate help!
As you probably can understand from my text, I am not a professional with Latex. Thus if there are any questions/data missing, feel free to ask/comment!

Best wishes,
paveheikkinen

esdd
Posts: 36
Joined: Sat Jan 25, 2014 9:13 pm

Postby esdd » Wed Oct 22, 2014 5:28 pm

Try something like that in your preamble

  1. \renewcommand{\header}[3]{%
  2. \begin{tikzpicture}[remember picture,overlay]
  3. \node [
  4. fill=fillheader,
  5. anchor=north,
  6. minimum width=\paperwidth, minimum height=3.5cm
  7. ] (box) at (current page.north){};
  8. \node [
  9. anchor=south,
  10. font=\fontsize{40pt}{72pt}\selectfont\color{header}
  11. ] (name) at (box) {{\thinfont #1} {\bodyfont #2}%
  12. };
  13. \node [
  14. anchor=north,
  15. align=center,
  16. font=\fontsize{14pt}{16pt}\selectfont\color{header}\thinfont
  17. ] at (name.south) {#3%
  18. };
  19. \end{tikzpicture}
  20. \vspace{2.5cm}
  21. \vspace{-2\parskip}%
  22. }


and in your document

  1. \header{name}{surname}{texline1\\text2\\text3}



Best regards
Elke

paveheikkinen
Posts: 2
Joined: Mon Oct 20, 2014 9:47 pm

Postby paveheikkinen » Thu Oct 23, 2014 6:03 pm

Million thanks Elke!
This worked like a charm!

Bests,
Pave


Return to “Page Layout”

Who is online

Users browsing this forum: No registered users and 6 guests