Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I have noticed that in the document I am working on the line in the header is changing position page to page. Basically there are two slightly (but notably) different vertical spaces between the line and the page number.

I managed to find out that the line's position is different using \doublespacing and \singlespacing.

Here is MWE: (need to be run twice - with \doublespacing and \singlespacing to see the difference of the line position)

\documentclass[12pt,a4paper,oneside]{mwbk}
\usepackage{enumitem}
\usepackage[cp1250]{inputenc}
\fussy
\addtolength{\textwidth}{1,5cm}
\addtolength{\hoffset}{0cm}
\addtolength{\textheight}{0cm}
\addtolength{\voffset}{0cm}

\usepackage{setspace}
\pagestyle{uheadings}

\usepackage{lipsum}

\begin{document}

\doublespacing         %different position when using \singlespacing
%\singlespacing

\lipsum[1-10] 

\end{document}

Have you any idea how I can fix the position of the line while I am using different spacing in the document and the line has different position depending on what is in the code -- single or double spacing.

share|improve this question

1 Answer 1

up vote 4 down vote accepted

You have to reinstate single spacing in the header:

\makeatletter
\renewcommand\hf@uheadings{%
  \def\@oddhead{\vtop{\linespread{1}%
      \hb@xt@\textwidth{%
        \reset@font{\heading@font\rightmark}\hfil\thepage\strut}%
      \vskip2pt\hrule\vskip-2.4pt}}%
  \let\@oddfoot\@empty
  \def\@evenhead{\vtop{\linespread{1}%
      \hb@xt@\textwidth{%
        \reset@font\strut\thepage\hfil\heading@font\leftmark}%
      \vskip2pt\hrule\vskip-2.4pt}}%
  \let\@evenfoot\@empty
  }
\makeatother
\pagestyle{uheadings}
share|improve this answer
    
Perfect!!! Thank you, egreg! –  Karo Dec 20 '11 at 11:09

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.