在左右角上编排页码?

在左右角上编排页码?

我正在为儿童故事等编写书籍风格的文档。我为每张纸的页面背景找到了一个漂亮的边框,并在每个页码的角落附近有一个特殊位置。

我现在需要的是将每页的页码放在左下角或右下角(但靠近角落这本书的奇偶逻辑决定了每页的页数。

到目前为止,我只能设法fancyhdr正确地放置奇偶页码,并以一种简单的方法将页码推到侧面来抑制“正文”边距。但我无法使用这种简单的方法抑制奇数页和偶数页的“正文”边框\hspace

我试过\checkoddpage(if-then 逻辑)等,但效果并不好。右奇数 (RO) 页脚根本不想被推入!!!

有什么想法可以将剩余的奇数推到一边吗?下面是代码示例。有点长,抱歉!(我不能包括边框背景……但我希望你能想象理解这里需要实现什么。)提前感谢您的时间。

\documentclass[openany]{book}
\usepackage[a4paper]{geometry}
\usepackage{multicol}
\usepackage{parskip}
\usepackage{graphicx}
\usepackage{changepage}
\usepackage{fancyhdr}
\usepackage{lipsum}
\pagestyle{plain}


 %CHAPTER FORMAT
\usepackage{titlesec}
\titleformat{\chapter}[display]
{\centering\Huge\bfseries}
{\chaptername\ \thechapter}{0pt}{\Huge}
\titleformat{\section}
{\Huge\bfseries}
{}{1em}{}
\titleformat{\subsection}
{\LARGE}
{}{1em}{}

%TABLE OF CONTENTS 
\usepackage[titles]{tocloft}
\usepackage[toc]{multitoc}
\renewcommand\cftchapfont{}
\renewcommand\cftsecfont{}
\renewcommand\cftchappagefont{\normalsize}
\renewcommand\cftsecpagefont{\small}
\renewcommand\cftchapafterpnum{\par\addvspace{3pt}}
\renewcommand\cftsecafterpnum{\par\addvspace{3pt}}
\renewcommand{\contentsname}{\centering Contents}

%PAGE NUM (RIGHT/LEFT)
\pagestyle{plain}
\fancypagestyle{plain}{
\fancyhf{} % clear all header and footer fields
\fancyfoot[LE]{\hspace*{-2.5cm}\LARGE{\textbf{\thepage}}}
\fancyfoot[RO]{\hspace*{1.5cm}\LARGE{\textbf{\thepage}}} 
\renewcommand{\headrulewidth}{0pt}
\renewcommand{\footrulewidth}{0pt}
\renewcommand{\footskip}{110pt}
\hoffset =0pt
}

%BEGIN DOC
\title{Pax Romana}
\begin{document}
\maketitle
\tableofcontents
\thispagestyle{empty}
\clearpage\pagestyle{plain}
\chapter{Introduction}
\begin{multicols}{2}
\lipsum
\end{multicols}
\chapter{Chp1}
\begin{multicols}{2}
\lipsum
\end{multicols}
\end{document}

答案1

这是一个非常简单的解决方案,titleps通过pagestylestitlesec 选项加载,而不是 fancyhdr:

\documentclass[openany]{book}
\usepackage[a4paper]{geometry}
\usepackage{multicol}
\usepackage{parskip}
\usepackage{graphicx}
\usepackage{changepage}
\usepackage{lipsum}
\pagestyle{plain}


 %CHAPTER FORMAT
\usepackage[pagestyles]{titlesec}
\titleformat{\chapter}[display]
{\centering\Huge\bfseries}
{\chaptername\ \thechapter}{0pt}{\Huge}
\titleformat{\section}
{\Huge\bfseries}
{}{1em}{}
\titleformat{\subsection}
{\LARGE}
{}{1em}{}

%TABLE OF CONTENTS
\usepackage[titles]{tocloft}
\usepackage[toc]{multitoc}
\renewcommand\cftchapfont{}
\renewcommand\cftsecfont{}
\renewcommand\cftchappagefont{\normalsize}
\renewcommand\cftsecpagefont{\small}
\renewcommand\cftchapafterpnum{\par\addvspace{3pt}}
\renewcommand\cftsecafterpnum{\par\addvspace{3pt}}
\renewcommand{\contentsname}{\centering Contents}

%PAGE NUM (RIGHT/LEFT)
\pagestyle{plain}
\renewpagestyle{plain}{
\widenhead[2.5cm][0cm]{0cm}{1.5cm}
\sethead{}{}{}%
\setfoot[\LARGE\bfseries\thepage][][]{}{}{\LARGE\bfseries\thepage}
}
%BEGIN DOC
\title{Pax Romana}
\begin{document}
\maketitle
\tableofcontents
\thispagestyle{empty}
\clearpage\pagestyle{plain}
\chapter{Introduction}
\begin{multicols}{2}
\lipsum
\end{multicols}
\chapter{Chp1}
\begin{multicols}{2}
\lipsum
\end{multicols}
\end{document} 

奇数页:

在此处输入图片描述

在此处输入图片描述

相关内容