# Set logo position in header

I am using this code:

\rhead{\textsc{\includegraphics[height=36pt]{my_pict}}}


to set a logo on the right hand of the header (I have also another one on the left).

It works nicely until I try to enlarge the text with

\usepackage[textwidth=17cm]{geometry}


the left logo seems still in a good position, while the right one get shifted towards the center.

How can I keep it bound to the right edge of the text?

here is the simplified version of the beginning of the file:

\documentclass[english]{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{babel}
\usepackage{amsmath}
\usepackage{graphicx}
\usepackage{fancyhdr}

\pagestyle{fancy}
\fancyhf{}

\usepackage[textwidth=17cm]{geometry}

\begin{document}
text
\end{document}


Thanks for help

• Hello and welcome to TexSE. Can you add a minimal working example: tex.meta.stackexchange.com/questions/228/… – Bobyandbob Mar 29 '17 at 13:01
• does that help? you can put any other picture I guess - should I provide screenshots of the issue? – jjrr Mar 29 '17 at 15:08
• Good. No. You can use example images with example-image or example-image-a... Hint: You forgot \end{document} – Bobyandbob Mar 29 '17 at 15:24

Use \usepackage[textwidth=17cm]{geometry} to specify page dimension above \pagestyle{fancy}. Since it is a package that changes a relatively large number of parameters within the document, it should be included as one of the last or last packages to ensure that the settings have not been overwritten by one of the following packages.

With \usepackage{showframe} you can make page margins visible.

MWE:

\documentclass[english]{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{babel}
\usepackage{amsmath}
\usepackage{graphicx}
\usepackage{fancyhdr}
\usepackage[textwidth=17cm]{geometry}

\pagestyle{fancy}
\fancyhf{}