1

I'm writing you because I need your help to create a template, I've tried a lot of ways to make it but no results. So I'd like someone help me to create it or guide me to do it.

I attach a PDF with the header and footer that I want. enter image description here

I appreciate some help.

Best regards.

drialo
  • 37
  • 5
    Welcome to TeX SE. This kind of question is not really a reasonable one as it stands as it leaves all of the work to others. Please post the code that you've tried or at least the basic framework of the document with the words you want included so that people don't have to start entirely from scratch. I'm not sure, for example, is that header supposed to be entirely above the body of the text or part of it? – cfr May 04 '14 at 19:53

1 Answers1

2

This is probably not the best method but...

Graphics intended independently of header and footer

This is based on the image the OP posted in an answer (now deleted). It does not 'count' the additional graphics as part of the actual header or footer. Instead, it places them behind the page using tikz. If the configuration is desired on every page, you can use background or eso-pic or similar to facilitate this (as Harish Kumar pointed out in a comment). However, I tend to use wallpaper because I can actually get that to work whereas I've never succeeded with background despite it looking really nice. (I can use it for simple things but not for complex content which is really where it should shine - and surely does, if you know its tricks.)

Graphics behind page

In the code below, you can adjust the lengths and widths and configure the page layout to suit. In particular, I've exaggerated the difference in thickness of the lines at the top so that they show up in the images posted here. You may wish to adjust accordingly.

\documentclass{article}
\usepackage[rgb]{xcolor}
  \definecolor{olive}{rgb}{.4,.7,.2}
  \definecolor{burntorange}{rgb}{.8,.4,.1}
\usepackage{tikz}
  \usetikzlibrary{positioning,calc}
\newlength{\mytop}
\setlength{\mytop}{96pt}% based on geometry's defaults
\newlength{\mybot}
\setlength{\mybot}{142pt}% based on geometry's defaults
\usepackage[ignoreall, top=\mytop, bottom=\mybot]{geometry}

\begin{document}

\begin{tikzpicture}
  [remember picture,
    overlay,
    outer sep=0pt,
    inner sep=0pt,
    node distance=0pt,
    font=\sffamily,
  ]
  \node (topline) [xshift=15mm, yshift=5mm, fill=olive, minimum width=2mm, minimum height=20mm] at ($(current page.north east) - (\oddsidemargin+\marginparwidth+\marginparsep,\mytop)$) {};
  \node (bottomhead) at ($(topline.south) - (0,20mm)$) {};
  \path [draw, ultra thick, color=olive] (topline.south) -- (bottomhead);
  \node (leftheadertxt) [xshift=-1.5mm, left=of topline.north west, color=burntorange, minimum width=20mm, rotate=90, align=center] {\tiny DSDGDGDGD};
  \node (rightheadertxt) [xshift=1.5mm, right=of bottomhead, color=burntorange, rotate=90, align=left] {\tiny DDDFGH};
  \path [draw, line width=.75mm] ($(current page.south east) - (\oddsidemargin+\marginparwidth+\marginparsep+10mm,-\mybot+\footskip-5mm)$) node (leftfoot) {} -- +(30mm,0) node (rightfoot) {};
  \node (rightfootertxt) [align=right, yshift=-2mm, left=of rightfoot.west] {\tiny Ghshshg};
\end{tikzpicture}

Some text.

\end{document}

If you would like the image on every page, I would save the following as mygraphics.tex and use it to generate mygraphics.pdf:

\documentclass{article}
\usepackage[rgb]{xcolor}
  \definecolor{olive}{rgb}{.4,.7,.2}
  \definecolor{burntorange}{rgb}{.8,.4,.1}
\usepackage{tikz}
  \usetikzlibrary{positioning,calc}
\newlength{\mytop}
\setlength{\mytop}{96pt}% based on geometry's defaults
\newlength{\mybot}
\setlength{\mybot}{142pt}% based on geometry's defaults
\usepackage[ignoreall, top=\mytop, bottom=\mybot]{geometry}
\pagestyle{empty}

\begin{document}

\begin{tikzpicture}
  [remember picture,
    overlay,
    outer sep=0pt,
    inner sep=0pt,
    node distance=0pt,
    font=\sffamily,
  ]
  \node (topline) [xshift=15mm, yshift=5mm, fill=olive, minimum width=2mm, minimum height=20mm] at ($(current page.north east) - (\oddsidemargin+\marginparwidth+\marginparsep,\mytop)$) {};
  \node (bottomhead) at ($(topline.south) - (0,20mm)$) {};
  \path [draw, ultra thick, color=olive] (topline.south) -- (bottomhead);
  \node (leftheadertxt) [xshift=-1.5mm, left=of topline.north west, color=burntorange, minimum width=20mm, rotate=90, align=center] {\tiny DSDGDGDGD};
  \node (rightheadertxt) [xshift=1.5mm, right=of bottomhead, color=burntorange, rotate=90, align=left] {\tiny DDDFGH};
  \path [draw, line width=.75mm] ($(current page.south east) - (\oddsidemargin+\marginparwidth+\marginparsep+10mm,-\mybot+\footskip-5mm)$) node (leftfoot) {} -- +(30mm,0) node (rightfoot) {};
  \node (rightfootertxt) [align=right, yshift=-2mm, left=of rightfoot.west] {\tiny Ghshshg};
\end{tikzpicture}

\end{document}

Then I would simply include it using graphicx and wallpaper:

\documentclass{article}
\newlength{\mytop}
\setlength{\mytop}{96pt}% based on geometry's defaults
\newlength{\mybot}
\setlength{\mybot}{142pt}% based on geometry's defaults
\usepackage[ignoreall, top=\mytop, bottom=\mybot]{geometry}
\usepackage{wallpaper,graphicx}

\begin{document}

\CenterWallPaper{1}{mygraphics}

Some text.\clearpage Some more text.

\end{document}

Graphics on every page

Graphics intended as (part of) actual header and footer

header/footer

\documentclass{article}
\usepackage[rgb]{xcolor}
  \definecolor{olive}{rgb}{.4,.7,.2}
  \definecolor{burntorange}{rgb}{.8,.4,.1}
\usepackage{tikz}
  \usetikzlibrary{positioning,calc}
\usepackage[headheight=45mm,includehead]{geometry}
\usepackage{fancyhdr}
\pagestyle{fancy}
\fancyhf{}
\renewcommand{\headrulewidth}{0pt}
\fancyhf[cf]{\thepage}
\fancyhf[rh]{%
  \begin{tikzpicture}
    [
      outer sep=0pt,
      inner sep=0pt,
      node distance=0pt,
      font=\sffamily,
    ]
    \node (topline) [fill=olive, minimum width=1mm, minimum height=20mm] {};
    \node (bottomhead) at ($(topline.south) - (0,20mm)$) {};
    \path [draw, ultra thick, color=olive] (topline.south) -- (bottomhead);
    \node (leftheadertxt) [xshift=-1.5mm, left=of topline.north west, color=burntorange, minimum width=20mm, rotate=90, align=center] {\tiny DSDGDGDGD};
    \node (rightheadertxt) [xshift=1.5mm, right=of bottomhead, color=burntorange, rotate=90, align=left] {\tiny DDDFGH};
  \end{tikzpicture}}
\fancyhf[rf]{%
  \begin{tikzpicture}
    [
      outer sep=0pt,
      inner sep=0pt,
      node distance=0pt,
      font=\sffamily,
    ]
    \path [draw, ultra thick] (0,0) -- (30mm,0);
    \node (botright) at (30mm,0) {};
    \node (rightfootertxt) [align=right, yshift=-1.5mm, left=of botright.west] {\tiny Ghshshg};
  \end{tikzpicture}
  }


\begin{document}

Some text.

\end{document}

Obviously you would need to adjust the lengths and sizing to suit.

cfr
  • 198,882
  • 2
    It is better to use background or eso-pic to put this graphic on each page than fancyhdr. –  May 04 '14 at 22:41
  • @HarishKumar Doesn't that depend on whether or not it is meant to be a header? If the text is supposed to start beneath the header, fancyhdr seemed a better choice. If, on the other hand, the text is meant to start at a point regardless of the header, then it obviously wouldn't do what's required. I assumed the former because it was called a 'header' in the question. But it was pretty unclear what was wanted. – cfr May 05 '14 at 17:11
  • @TorbjørnT. Mine does, too. Just my PDF viewer doesn't show it when I look at the entire page so neither does the image posted here. My PDF viewer tends to not show the thickness of thinish lines very accurately unless you zoom right in. – cfr May 05 '14 at 21:20
  • @cfr Oh, sorry about that then, I just compared the screenshots. I'll delete my comment. – Torbjørn T. May 05 '14 at 21:26
  • @cfr That vertical line (at least) doesn't seem to belong to the header IMO :) –  May 05 '14 at 22:12
  • @HarishKumar Well I thought perhaps the idea was to have that to the right of the rest of the header e.g. the title and section or whatever. However, it is obvious from the image the OP subsequently posted that you're right so I've updated the answer. (I use wallpaper as I can never make background or similar do anything.) Forgot to say thanks. – cfr May 05 '14 at 23:01
  • @TorbjørnT. In posting an update, I've emphasised the difference. I think this is too much for real use but it makes the effect obvious in the images posted here. (Even on my small screen, my PDF viewer shows the difference with full page view.) Forgot to say thanks. – cfr May 05 '14 at 23:03