Is it possible to create a footer with numbers like this in xelatex?

非 Y 不嫁゛ 提交于 2021-02-05 12:24:04

问题


Is it possible to create footers like above in xelatex? on the first page the number to be aligned on the right and on the second page on the left side. The top border would be a nice addition but it is not necessary. I don't need any text (section names) beside the numbers.

\documentclass[11pt,a4paper]{article}
                  \usepackage{fontspec}
                  \setmainfont{Charis SIL}
                  \usepackage{geometry}
                  \geometry{a4paper, left=1in, right=1in,
                             top=0.5in, bottom=0.65in}
                  \setlength{\parindent}{0pt}
                  \setlength{\parskip}{1em}
                  \setcounter{secnumdepth}{0}
                  \usepackage{sectsty}
                  \sectionfont{\huge}
                  \subsectionfont{\Large}
                  \subsubsectionfont{\large}
                  \paragraphfont{\normalsize}
                  \usepackage{hyperref}
                  \subparagraphfont{\normalsize}
                  \renewcommand{\baselinestretch}{1.5}"

回答1:


If you are using the twoside documentclass option, then you can use the fancyhdr package to add such a footline:

\documentclass[11pt,a4paper,twoside]{article}
\usepackage{fontspec}
\setmainfont{Charis SIL}
\usepackage{geometry}
\geometry{a4paper, left=1in, right=1in,
top=0.5in, bottom=0.65in}
\setlength{\parindent}{0pt}
\setlength{\parskip}{1em}
\setcounter{secnumdepth}{0}
\usepackage{sectsty}
\sectionfont{\huge}
\subsectionfont{\Large}
\subsubsectionfont{\large}
\paragraphfont{\normalsize}
\usepackage{hyperref}
\subparagraphfont{\normalsize}
\renewcommand{\baselinestretch}{1.5}

\usepackage{fancyhdr}
\pagestyle{fancy}
\renewcommand{\headrulewidth}{0pt}
\renewcommand{\footrulewidth}{1pt}
\fancyhead{} 
\fancyfoot{} 
\fancyfoot[LE,RO]{\thepage}

\usepackage{duckuments}

\begin{document}

\duckument

\end{document}



来源:https://stackoverflow.com/questions/64857304/is-it-possible-to-create-a-footer-with-numbers-like-this-in-xelatex

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!