# Similar header format for my company

I need to reproduce the following header format:

Please help; I'm a completely starter at LaTeX or TeX. I work with LyX and this is included in the document's preamble:

\usepackage{fancyhdr}
\usepackage{multicol}
\usepackage{graphics}
}}
\pagestyle{fancy}
\fancypagestyle{plain}%{%
\fancyhf{} % clear all header and footer fields
\vskip10pt
\lfoot{Por: A. Perez}
\cfoot{\thepage /2}
\rfoot{Departamento de Diseño}
\renewcommand{\footrulewidth}{0.4pt}


Thanks Samuel Albert for your Help.

-

Here is the solution I propose. I added use of package lastpage to have the last page number automated. I changed the package graphics to graphicx to have the functionnalities I use to dimention your logo. This code replaces what you have given.

\usepackage{etoolbox}%
\usepackage{fancyhdr}%
\usepackage{multicol}%
\usepackage{graphicx}%
\usepackage{lastpage}%
%
\def\MyLogo{MyLogo.ext}%
\newlength\logoHeight%
\setlength{\logoHeight}{50pt}%
\def\textfootLeft {Por: A. Perez}%
\def\textfootRight{Departamento de Diseño}%
%
\makeatletter%
\fancypagestyle{plain}{%
\fancyhf{}%
\fboxsep = 0pt
{%
\parindent = 0pt%
\hfil%
\vbox to \logoHeight%
{%
\vfil%
\vfil%
}%
\hfil%
}%
}%
\lfoot{\textfootLeft}%
\cfoot{\thepage / \pageref{LastPage}}%
\rfoot{\textfootRight}%
\renewcommand{\footrulewidth}{0.4pt}%
}%
%
}%
\makeatother%
%
\pagestyle{plain}%


EDIT:

Since you're new to latex, I decided to make it a little easier. You now sould have only to modify the first few lines after package loading

Samuel, I used your code, but Lyx seems to fall in some sort of loop. I changed your MyLogo.ext to logo.png, is that the right thing to do?

Mylogo.ext should indeed be replaced by a path to your logo :

• It can be an absolute path starting from the root of your system (c:/.../logo.png).
• It should however preferably be a relative path originating from the folder where your .texfile belongs to, so that if you move all of this, it will still compile.

For exemple, if the image you want to use is named logo.png and is in the subfolder images/ of the folder where your .tex file is located, you should have the line

\def\MyLogo{images/logo.png}%


Also note that before all of this, you should have declared the document class you use. For example, in the file I used to try this, I have used a report document class.

\documentclass[10pt,a4paper,titlepage,oneside,onecolumn]{report}


Finally, after this header, you should have your \begin{document} followed by the document itself. For example in my test document

\begin{document}
test
\end{document}


To conclude, I am not able to test this under Lyx since I use a combination of Miktex 2.9 and Texmaker, but I am sure someone who uses it will be kind enough to confirm whether it works or not.

Maybe one very last thing to lote is that I use Lualatex. Since there is some non-strictly ASCII characters in the exemple, it could have an incidence (even though I don't really think so). Maybe try to remove the ñ in a first step to make sure it's not the cause of any problem.

# Final Solution

After checking everything as sugested by Samuel Albert, I ended trimming the code due to replicated info. The ñ character wasn´t relevant due to LyX configuration, but other parts of the code were. The following code worked:

\usepackage{fancyhdr}
\pagestyle{fancy}
\usepackage{multicol}
\usepackage{lastpage}%
\usepackage{graphicx}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\providecommand{\tabularnewline}{\\}
\@ifundefined{date}{}{\date{}}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\def\MyLogo{logo.png}%
\newlength\logoHeight%
\setlength{\logoHeight}{50pt}%
\def\textfootLeft {Por: A. Perez}%
\def\textfootRight{Departamento de Diseño}%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\fancypagestyle{plain}{%
\fancyhf{}%
\fboxsep = 0pt
{%
\parindent = 0pt%
\hfil%
\vbox to \logoHeight%
{%
\vfil%
\vfil%
}%
\hfil%
}%
}%
\lfoot{\textfootLeft}%
\cfoot{\thepage / \pageref{LastPage}}%
\rfoot{\textfootRight}%
\renewcommand{\footrulewidth}{0.4pt}%
}%
%