1

I am new to latex and am trying to alter a template with little success.

So the current template has an image in the header on the left side of the page and a title in the middle. I need to move the image so that it is above the header but cannot get it to work.

So I changed the line below from [LO] to [CO] to centre it.

\fancyhead[CO]{\parbox{1.5cm}{\includegraphics[width=2cm]{C:/My_path/my_pic.png}}}

However if I place the line of code for the title below the line above only the title is shown. If I place the line of code for the title above the line above only the image is shown.

The code

 \documentclass[a4paper]{article}
 \usepackage[T1]{fontenc}
 \usepackage{selinput}
 \usepackage{fancyhdr} 
 \usepackage[english]{babel}
 \usepackage{graphicx}
 \usepackage{epstopdf}
 \usepackage{color} 
 \usepackage{float}
 \usepackage{tabularx}
 \usepackage[paperheight=11.69in,paperwidth=8.27in, top=0.9in, bottom=1in, left=0.25in, right=0.25in]{geometry}
 \usepackage{helvet}
 \usepackage{xcolor}
 \usepackage{booktabs}
 \usepackage{array} 


 % imposing fancy page style
\pagestyle{fancy} 

 % creating fancy header and footer 
\fancyhead[CO]{\parbox{1.5cm}{\includegraphics[width=2cm]{C:/My_path/my_pic.png}}}
\fancyhead[CO]{{\Large \color{FCblueOne}{\scshape{\textbf{Some Title} -  Report}}}}
\fancyfoot[CO]{\Grey \scshape{For Internal Use Only}} 
\fancyfoot[RO]{\Grey \scshape{\today}} 
\fancyhead[RO]{\parbox{2.0cm}{\includegraphics[width=2cm]

% adjusting header and footer rules
\renewcommand{\headrulewidth}{0.1pt} 
\renewcommand{\footrulewidth}{0.1pt} 
\renewcommand{\headrule}{\hbox to\headwidth{\color{\Grey}\leaders\hrule height \headrulewidth\hfill}}
\renewcommand{\footrule}{\hbox to\headwidth{\color{\Grey}\leaders\hrule height \headrulewidth\hfill}}
3
  • 1
    Welcome to TeX.SX! Please post compilable documents, not just fragments only. We also have no access to the image file
    – user31729
    Feb 9, 2016 at 13:14
  • hi, I can't where I am able to attach the image file, its just a simple png file though. The rest of the document contains a few tables using an \input{\ptt/some table name.tex} - these tables contain sensitive data though. If I added \end{document} to my post would that work?
    – user8170
    Feb 9, 2016 at 13:26
  • 2
    @user8170 Please read meta.tex.stackexchange.com/questions/228/… on how to write good MWEs.
    – Benjamin
    Feb 9, 2016 at 13:29

1 Answer 1

1

You specify \fancyhead[CO] multiple times. Only the last one is used as the previous one gets overwritten. Try putting everything you want to center into one \fancyhead[CO] and try to achieve the "image above title" fe. with \\ or similar, ie.:

\fancyhead[CO]{%
    \parbox{1.5cm}{\includegraphics[width=2cm]{C:/My_path/my_pic.png}}\\
    {\Large \color{FCblueOne}{\scshape{\textbf{Some Title} -  Report}}}%
}
\fancyfoot[CO]{\Grey \scshape{For Internal Use Only}} 
\fancyfoot[RO]{\Grey \scshape{\today}} 

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .