外边距中的页码会影响垂直标尺

外边距中的页码会影响垂直标尺

我改编了这里将页码放在外边距中。但是,这样做会导致垂直标尺消失。我最初以为调整标尺的水平间距参数可能会让它恢复,但似乎不行。如何解决这个问题?

\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}

答案1

相当微妙。:)

vruler包通过查看宏是否定义来区分 LaTeX 和 Plain TeX \pageno。因此,使用该代码,它会错误地猜测该文档是 Plain TeX 文档。

變成或任何\pageno形式\xpageno

以下是相关部分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. 

相关内容