Центрирование нижнего колонтитула относительно бумаги в мемуарах

Центрирование нижнего колонтитула относительно бумаги в мемуарах

Я хотел бы центрировать нижний колонтитул стиля страницы не относительно полей страницы, а относительно ширины физической бумаги. Я создал стиль страницы специально для титульного листа. Я думал, что линия \makerunningwidthправильно вычислит центр страницы, но, как вы можете ясно видеть, номер страницы не выровнен с остальным текстом (который абсолютно выровнен относительно центра бумаги).

Документ создан с помощью

\documentclass{memoir}

\copypagestyle{INRSDocExamTitle}{plain}
\makerunningwidth{INRSDocExamTitle}{\paperwidth}
\makeoddfoot{INRSDocExamTitle}{}{\thepage}{}
\makeevenfoot{INRSDocExamTitle}{}{\thepage}{}

\begin{document}

\thispagestyle{INRSDocExamTitle}
\newlength{\centeradjust}
\calccentering{\centeradjust}  % Calculate center length and stores in centeradjust
\begin{adjustwidth*}{\centeradjust}{-\centeradjust}   % Adjust center
\begin{adjustwidth}{-1cm}{-1cm}  
  \begin{center}
  \begin{OnehalfSpace}
    \vspace*{3\baselineskip}
     {\Large Centered text using adjustwidth (as per the \texttt{memoir} manual)}

     \vfill

    {\large This foooter is not centered with respect to the page,\\
    but with respect to the type block. \\
    $\downarrow$
    }
   \vspace*{3\baselineskip}
 \end{OnehalfSpace}
 \end{center}
\end{adjustwidth}
\end{adjustwidth*}

\end{document}

Есть ли способ отцентрировать нижний колонтитул относительно страницы, а не полей?

Образец PDF-файла

решение1

Идея состоит в том, чтобы сместить номер страницы, чтобы компенсировать неровные поля.

\documentclass{memoir}
\copypagestyle{INRSDocExamTitle}{plain}
\makeoddfoot{INRSDocExamTitle}{}{\thepage\offset}{}
\makeevenfoot{INRSDocExamTitle{}{\thepage\offset}{}
\newcommand{\offset}% center page number in text area
{\ifodd\value{page}\hspace{\dimexpr 2in+2\oddsidemargin+\textwidth-\paperwidth}%
\else\hspace{\dimexpr 2in+2\evensidemargin+\textwidth-\paperwidth}%
\fi}

\usepackage{tikzpagenodes}% used only to show center of page

\begin{document}
\pagestyle{INRSDocExamTitle}
\begin{tikzpicture}[remember picture,overlay]
\draw[red] (current page.north) -- (current page.south);
\end{tikzpicture}

odd page
\newpage
\begin{tikzpicture}[remember picture,overlay]
\draw[red] (current page.north) -- (current page.south);
\end{tikzpicture}

even page
\end{document}

решение2

На мой взгляд, проще всего вручную закодировать этот конкретный стиль страницы:

\makeatletter
\@namedef{ps@INRSDocExamTitle}{%
  \@namedef{@oddfoot}{%
    \hspace{-\spinemargin}%
      \parbox[b]{\paperwidth}{%
        \strut\hfill \thepage \hfill\strut%
        }%
    }%
}
\makeatother

Просто чтобы показать эффект

\documentclass[a4paper]{memoir}

\setlrmarginsandblock{1cm}{4cm}{*}
\checkandfixthelayout

\makeatletter
\@namedef{ps@INRSDocExamTitle}{%
  \@namedef{@oddfoot}{%
    \hspace{-\spinemargin}%
      \parbox[b]{\paperwidth}{%
        \strut\hfill \thepage \hfill\strut%
        }%
    }%
}
\makeatother

\begin{document}


\thispagestyle{INRSDocExamTitle}

\newlength{\centeradjust}
\calccentering{\centeradjust}  % Calculate center length and stores in centeradjust
\begin{adjustwidth*}{\centeradjust}{-\centeradjust}   % Adjust center
\begin{adjustwidth}{-1cm}{-1cm}  
  \begin{center}
  \begin{OnehalfSpace}
    \vspace*{3\baselineskip}
     {\Large Centered text using adjustwidth (as per the \texttt{memoir} manual)}

     \vfill

     This foooter is not centered with respect to the page,\\
    but with respect to the type block. 

    $\downarrow$

   \noindent
   test\hfill\smash{%
      \rule[-3.7cm]{0.4pt}{4cm}%
    }\hfill test%



   \vspace*{3\baselineskip}
 \end{OnehalfSpace}
 \end{center}
\end{adjustwidth}
\end{adjustwidth*}

\end{document}

введите описание изображения здесь

Связанный контент