文章类别右侧的页码

文章类别右侧的页码

如何将文章类别页脚中的页码刷新到右侧?

\documentclass{article}
\usepackage[english]{babel}
\usepackage{fancyhdr}
\pagestyle{fancy}
\headheight=14pt
\renewcommand\headrule{}
\fancyhf{}
\rhead{\textit{header}}
\thispagestyle{fancy}


\begin{document}

\section{Lorem Ipsum}

Tart jelly-o oat cake gingerbread cupcake cake icing croissant. Bear claw cake halvah oat cake pie carrot cake bonbon. Tiramisu applicake bonbon oat cake toffee cheesecake candy croissant. Topping candy canes cotton candy apple pie tart croissant caramels. Cupcake toffee sweet roll sesame snaps dessert biscuit oat cake. Sweet roll powder applicake chocolate bar icing chocolate cake dessert. Lollipop bear claw sugar plum gummi bears caramels sugar plum wafer jelly beans. Drage gummi bears wafer. Pie wypas chocolate bar lemon drops tiramisu. Topping wafer biscuit cake liquorice. Jujubes marshmallow tart liquorice marzipan applicake applicake. Dragee sweet roll jelly macaroon sesame snaps. Donut applicake macaroon dessert.


\subsection{Cupcake Ipsum}
Cake sesame snaps jelly sugar plum. Cotton candy cheesecake chocolate cake bonbon sweet. Liquorice pastry drage muffin oat cake sugar plum lollipop topping. Lemon drops chocolate bonbon. Topping jujubes topping. Lollipop bear claw biscuit chupa chups. Ice cream oat cake sesame snaps oat cake jelly beans jelly sweet roll apple pie. Chocolate cake jelly beans jelly beans applicake chupa chups cupcake powder. Applicake sweet roll danish cheesecake jujubes sweet cotton candy pie. Caramels bear claw halvah. Toffee cupcake sweet roll topping cheesecake. Jelly-o danish croissant jelly brownie wypas sweet chocolate. 

Topping powder candy canes. Jelly-o jelly topping macaroon bear claw.
Sweet roll danish souffle jujubes powder biscuit. Sesame snaps apple pie pie pie brownie jujubes. Gummi bears jujubes lemon drops tart fruitcake tart applicake tart macaroon. Muffin tart danish. Candy canes lemon drops liquorice marzipan gummies icing tootsie roll cupcake. Gummi bears chocolate tart fruitcake liquorice wafer applicake. Macaroon danish faworki jelly beans lollipop. Cupcake chupa chups dessert cake gummies halvah. Fruitcake cake brownie gummies sweet. Chocolate bar cotton candy applicake cotton candy biscuit toffee chocolate bar brownie souffle. Souffle lemon drops dragee bear claw oat cake bonbon chocolate cake tootsie roll. Candy topping marzipan gingerbread sweet roll pie. Carrot cake bear claw candy canes cake liquorice.
Chupa chups chupa chups gummi bears chocolate cake carrot cake gingerbread icing. Gummi bears sugar plum candy canes cookie sweet brownie cotton candy.

\section{Cupcake Ipsum}

Fruitcake gummi bears candy canes candy canes cheesecake sweet. Marzipan danish chocolate bar croissant applicake. Oat cake biscuit chocolate cake jujubes ice cream pudding. Dessert marzipan jujubes wafer jelly-o. Jelly jelly faworki bonbon cupcake wypas candy canes gummies jelly-o. Liquorice donut wafer sweet roll croissant. Sweet roll fruitcake lollipop jelly beans. Tart cotton candy marshmallow donut croissant souffle. Dragee chupa chups cookie dragee caramels. Cheesecake caramels sweet roll muffin wafer.
Sweet roll danish souffle jujubes powder biscuit. Sesame snaps apple pie pie pie brownie jujubes. Gummi bears jujubes lemon drops tart fruitcake tart applicake tart macaroon. Muffin tart danish. Candy canes lemon drops liquorice marzipan gummies icing tootsie roll cupcake. 

Gummi bears chocolate tart fruitcake liquorice wafer applicake. Macaroon danish faworki jelly beans lollipop. Cupcake chupa chups dessert cake gummies halvah. Fruitcake cake brownie gummies sweet. Chocolate bar cotton candy applicake cotton candy biscuit toffee chocolate bar brownie souffle. Souffle lemon drops dragee bear claw oat cake bonbon chocolate cake tootsie roll. Candy topping marzipan gingerbread sweet roll pie. Carrot cake bear claw candy canes cake liquorice.
Chupa chups chupa chups gummi bears chocolate cake carrot cake gingerbread icing. Gummi bears sugar plum candy canes cookie sweet brownie cotton candy.

\end{document}

答案1

手册中对此有明确解释fancyhdr。之后

\pagestyle{fancy}

您应该定义页眉和页脚的外观。命令

\fancyhf{}

清除所有六个字段(三个用于页眉,三个用于页脚,左、中、右)。

现在你可以填充它们:

\fancyheader[R]{\textit{header}}

将在页眉右侧字段中以斜体设置“header”。要获取页脚右侧的页码,请执行类似操作:

\fancyfoot[R]{\thepage}

其他字段可通过\fancyheader[L]{...}\fancyheader[C]{...}\fancyfoot[L]{...}访问\fancyfoot[C]{...}

如果选择此twoside选项,则可以在奇数页(右)和偶数页(左)上设置不同的字段;例如,

\fancyhead[LE,RO]{\textit{header}}

将在偶数页的左侧字段中设置“页眉”,在奇数页的右侧字段中设置“页眉”。

相关内容