我正在使用 Memoir 类来编写一份 85 页的报告,其中我必须复制客户的格式。它在页眉中有 2 个左对齐的 isologotipes,在页脚中有 2 个左对齐的地址(加上一些似乎与这个问题无关的其他内容)。
我已经成功创建了奇数页的页眉和页脚。我阅读了 Memoir 文档,但仍然找不到或无法理解如何对偶数页重复相同的页眉和页脚。
我目前的 MWE 是:
\documentclass[a4paper,oneside,openany,isopage]{memoir}
\usepackage{... many packages...}
\hypersetup{colorlinks=true,linkcolor={Blue},urlcolor={Blue}}
\usepackage[spanish]{babel}
\usepackage{lastpage}
\makepagestyle{plain}
\makeoddhead{plain}{\includegraphics[height=1cm]{img/isologotype-1.pdf} ~~~~~~~~~~~ \includegraphics[height=1cm]{img/isologotype-2.pdf}}{}{}
\makeoddfoot{plain}{\miniscule \begin{tabular}{ll} Org 1 & Org 2 \\address 1 & address 2 \\tel 1, email 1 & tel 2, email 2 \\website 1 & website 2 \end{tabular}}{}{página \thepage\ de \pageref{LastPage}}
\setcounter{secnumdepth}{3}
\author{Author name}
\title{Report title}
\hypersetup{...}
\begin{document}
\maketitle
\tableofcontents
\chapter{Síntesis}
\label{sec:orgheadline7}
Ipsum lorens
\section{Resultados generales}
\chapter{chapter's title}
...
\end{document}
答案1
在中创建自定义页眉/页脚memoir
在第节中描述7.3 制作页眉和页脚的memoir
基本用户手册。
下面通过创建新的页面样式来实现您想要的效果mypagestyle
:
\documentclass{memoir}
\usepackage{graphicx}
\usepackage{lipsum}% Just for this example
\renewcommand{\thesection}{\arabic{section}}% Just for this example
\newcommand{\headerleft}{%
\includegraphics[width=2cm]{example-image-a}\quad
\includegraphics[width=2cm]{example-image-b}}
\newcommand{\footerleft}{%
\begin{tabular}[t]{@{}l@{}}
Address A line 1 \\
Address A line 2 \\
Address A line 3
\end{tabular}\quad
\begin{tabular}[t]{@{}l@{}}
Address B line 1 \\
Address B line 2 \\
Address B line 3
\end{tabular}}
\makepagestyle{mypagestyle}
% \make<even/odd><head/foot>{<style>}{<left>}{<center>}{<right>}
\makeevenhead{mypagestyle}{\headerleft}% <left>
{}{}% <center><right>
\makeoddhead{mypagestyle}{\headerleft}% <left>
{}{}% <center><right>
\makeevenfoot{mypagestyle}{\footerleft}% <left>
{}% <center>
{Page \thepage{} of \thelastpage}% <right>
\makeoddfoot{mypagestyle}{\footerleft}% <left>
{}% <center>
{Page \thepage{} of \thelastpage}% <right>
\pagestyle{mypagestyle}% Set page style
\setheadfoot{47pt}{\footskip}% <headheight><footskip>
\begin{document}
\sloppy% Just for this example
\section{A section}\lipsum[1-10]
\section{A section}\lipsum[1-10]
\section{A section}\lipsum[1-10]
\section{A section}\lipsum[1-10]
\section{A section}\lipsum[1-10]
\section{A section}\lipsum[1-10]
\section{A section}\lipsum[1-10]
\section{A section}\lipsum[1-10]
\section{A section}\lipsum[1-10]
\section{A section}\lipsum[1-10]
\end{document}
47pt
值的选择<headheight>
源自第一次编译期间显示的警告。