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\textheadLeft {ss Technical Document}%
\def\textheadRight{TD-1}%
\def\textfootLeft {Por: A. Perez}%
\def\textfootRight{Departamento de Diseño}%
%
\makeatletter%
\headheight = 80pt%
\fancypagestyle{plain}{%
\fancyhf{}%
\fancyhead[C]{%
\fboxsep = 0pt
\hbox to \headwidth%
{%
\parindent = 0pt%
\hsize = \headwidth%
\hfil%
\vbox to \logoHeight%
{%
\vfil%
\includegraphics[keepaspectratio,height=\logoHeight,width=\headwidth]{\MyLogo}%
\vfil%
}%
\hfil%
}%
}%
\lfoot{\textfootLeft}%
\cfoot{\thepage / \pageref{LastPage}}%
\rfoot{\textfootRight}%
\renewcommand{\footrulewidth}{0.4pt}%
\renewcommand{\headrulewidth}{10pt}%
}%
%
\def\headrule{%
\hrule\@height\footrulewidth\@width\headwidth\vskip2pt%
\textbf{\textheadLeft}\hfill\textbf{\textheadRight}%
\vskip2pt\hrule\@height\footrulewidth\@width\headwidth%
}%
\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
.tex
file 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\textheadLeft {Reporte de Desarrollo}%
\def\textheadRight{DES-001}%
\def\textfootLeft {Por: A. Perez}%
\def\textfootRight{Departamento de Diseño}%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\headheight = 80pt%
\fancypagestyle{plain}{%
\fancyhf{}%
\chead{%
\fboxsep = 0pt
\hbox to \headwidth%
{%
\parindent = 0pt%
\hsize = \headwidth%
\hfil%
\vbox to \logoHeight%
{%
\vfil%
\includegraphics[keepaspectratio,height=\logoHeight,width=\headwidth]{\MyLogo}%
\vfil%
}%
\hfil%
}%
}%
\lfoot{\textfootLeft}%
\cfoot{\thepage / \pageref{LastPage}}%
\rfoot{\textfootRight}%
\renewcommand{\footrulewidth}{0.4pt}%
\renewcommand{\headrulewidth}{10pt}%
}%
%
\def\headrule{%
\hrule\@height\footrulewidth\@width\headwidth\vskip2pt%
\textbf{\textheadLeft}\hfill\textbf{\textheadRight}%
\vskip2pt\hrule\@height\footrulewidth\@width\headwidth%
}%
%
\pagestyle{plain}%