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 use the prelim2e package to mark a document as a draft. This package puts a draft line below the normal footer that contains for example Preliminary version – May 15, 2012.

Usually this draft line stays at the same position on each page, except when the singlespacing environment is used. Then the draft line on the first page inside the singlespacing environment has little different position than the other draft lines. When flipping through the pages this looks weird and I would like to have the draft line in the exact same position on every page.

Here is a MWE

\documentclass[onehalfspacing,oneside]{scrbook}
\usepackage{setspace}
\usepackage{prelim2e}

\begin{document}
\begin{singlespacing}
\tableofcontents
\listoffigures
\end{singlespacing}
\chapter{Some Chapter}    
\end{document}

Positioning of draft line

The positioning of the line is described in the package documentation. But I am not really sure if and what I would have to change here:

We put the text below the page via \EveryShipout provided by the everyshi package. This is done by \@Prelim@EveryShipout.

\@Prelim@EveryShipout puts the text produced by \PrelimText below the page. To do this we modify \box255: We append a \vbox with height and depth of 0pt and the width of \box255 which contains a \hbox with the width of \box255 in which \PrelimText is centered.

38 \newcommand{\@Prelim@EveryShipout}{
39 \bgroup

First we save the dimensions of \box255: height, width and depth; and calculate the total height of \box255.

40 \dimen\z@=\wd\@cclv
41 \dimen\@ne=\ht\@cclv
42 \dimen\tw@=\dp\@cclv
43 \dimen\thr@@=\dimen1
44 \advance\dimen\thr@@ by \dimen\tw@

Then we set \box255: A \vbox to the total height of \box255. In this a \hbox to the width of \box255 is included, in which \box255 is set.

45 \global\setbox\@cclv\vbox to \dimen\thr@@{%
46 \hb@xt@\dimen\z@{%
47 \box\@cclv%
48 \hss%
49 }%

To this we append the text produced by \PrelimText. It is put in a \vbox to 0pt in which a \hbox to the width of \box255 is included, in which \PrelimText is set. We have to reset \protect because it is set to \noexpand by the output routine.

50 \vbox to \z@{%
51 \hb@xt@\dimen\z@{%
52 \let\protect\relax
53 \hfill\PrelimText\hfill%
54 }%
55 \vss%
56 }%
57 \vss%
58 }%
share|improve this question

1 Answer 1

up vote 2 down vote accepted

I have another solution which does use the package background instead of your used package prelim2e. It does not affect your layout of your pages, it just writes a message in the background of your pages. Have a look to this MWE:

\documentclass[onehalfspacing,oneside]{scrbook}
\usepackage{setspace}
\usepackage{xcolor}
%\usepackage[contents=Confidential,color=blue!30]{background}
%\usepackage[contents=Confidential,color=blue!30,placement=bottom]{background}
\usepackage[%
  color=blue!30
 ,scale=4
]{background}
\backgroundsetup{contents={Preliminary version – May 15, 2012}}

\begin{document}
\begin{singlespacing}
\tableofcontents
\listoffigures
\end{singlespacing}
\chapter{Some Chapter}    
\end{document}

The two commented lines shows alternative calls of package background.

share|improve this answer
1  
Combining the backgroundpackage with the ifdraft command does a better job than prelim2e. –  maetra Oct 22 '12 at 7:44
    
@maetra: feel free to edit my MWE to show a better solution to other reader of your question and my answer. –  Kurt Oct 22 '12 at 11:40

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.