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 adapted the idea from here to place the page numbers in the outer margin. However, by doing so, the vertical ruler disappears. I first thought that adjusting the horizontal spacing parameters for the ruler might bring it back, but it doesn't seem so. How can this be fixed?

\documentclass{scrartcl}

\usepackage[T1]{fontenc}
\usepackage{lmodern}
\usepackage[american]{babel}
\usepackage{scrpage2}
\usepackage{vruler}

% comment this paragraph out and see that the ruler appears again
\rofoot{foo\ \ \textbullet\,\ bar\pageno{o}}% right odd
\lefoot{\pageno{e}Foo\ Bar}% left even
\def\pageno#1{\leavevmode
  \vbox to 0pt{
    \vss
    \hbox to 0pt{%
      \if#1o\kern 2em\else\hss\fi\thepage
      \if#1o\hss\else\kern2em\fi}}}

\begin{document}
\setvruler[10pt][1][1][4][1][10pt][10pt][-24pt][\textheight]%
Foo Bar
\clearpage
Foo Bar
\end{document}
share|improve this question

1 Answer 1

up vote 3 down vote accepted

Quite subtle. :)

The vruler package distinguishes between LaTeX and Plain TeX by looking whether the \pageno macro is defined. So with that code it guesses wrongly that the document is a Plain TeX one.

Change \pageno into \xpageno or whatever.

Here's the relevant part from vruler.sty

141 \ifx\pageno\undefined % this is considered as LaTeX
142     % we assume all LaTeX versions have \@outputpage in the form of
143     % \@outputpage= ...\vbox{ ... \vbox{...}...}... , where 2nd \vbox
144     % contains the true content. 
share|improve this answer
    
Many thanks, that's indeed quite subtle :-) –  Marius Hofert Nov 27 '12 at 0:59

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.