第一頁兩側頁碼對齊

第一頁兩側頁碼對齊

我有一個文檔,第一頁沒有作為“前面”,而是內容緊隨其後\maketitle

它開始於:

\documentclass[twoside,a4paper,12pt]{article}
\usepackage{fancyhdr}
\pagestyle{fancy}

我嘗試設定頁首和頁尾:

\fancyhf{}
\usepackage{titling}
\fancyhf[HC]{\thetitle}
\fancyhf[HL]{\theauthor}
\fancyhf[HR]{\today}
\fancyhf[FLO,FRE]{\thepage}

它有效,但第一頁上的數字居中,而不是按預期右對齊。第二頁上的數字向右對齊,並且應該在左側。怎麼了?


根據要求,這是整個文件(縮短)

\documentclass[twoside,a4paper,12pt]{article}
\usepackage[a4paper]{geometry}
\geometry{verbose,tmargin=2.5cm,bmargin=2cm,lmargin=2cm,rmargin=2cm}
\usepackage{fancyhdr}
\pagestyle{fancy}


\setlength{\parindent}{0pt}
\setlength{\parskip}{0.3em}

\fancyhf{}
\usepackage{titling}
\fancyhf[HC]{\thetitle}
\fancyhf[HL]{\theauthor}
\fancyhf[HR]{\today}
\fancyhf[FRO,FLE]{\thepage}

\title{Title}
\author{Jonny Gangsta}
\date{\today}

\begin{document}

    \maketitle

    Lorem ipsum blah blah... many paragraphs

\end{document}

答案1

\maketitle設定\thispagestyle{plain}為您通常不希望標題位於標題上方。但是,您可以使用 fancyhdr 重新定義普通頁面樣式,或者只是將

\thispagestyle{fancy}

\maketitle 

也在首頁使用定義的頁面樣式。

相關內容