将双面文档转换为带有页码、页眉和页脚的单面文档

将双面文档转换为带有页码、页眉和页脚的单面文档

我想将我的论文转换为带有页码、页眉和页脚的单面文档。

\documentclass[twosided,12pt]{book}
\usepackage{fancyhdr}
\usepackage{lipsum}
\renewcommand{\chaptermark}[1]{\markboth{#1}{}}
\renewcommand{\sectionmark}[1]{\markright{#1}}
\pagestyle{fancy}
\fancyhf{}
\fancyhead[LO]{\itshape\nouppercase{\rightmark}}
\fancyhead[RE]{\itshape\nouppercase{\leftmark}}
\fancyfoot[RO, LE]{\thepage}

\let\headruleORIG\headrule
\renewcommand{\headrule}{\color{dark-gray}\headruleORIG}
\renewcommand{\headrulewidth}{0.3 pt}
\let\footruleORIG\footrule
\renewcommand{\footrule}{\color{dark-gray}\footruleORIG}
\renewcommand{\footrulewidth}{0.3pt}
\usepackage{colortbl}
\arrayrulecolor{black}
\fancypagestyle{plain}{
    \fancyhf{}
    \fancyhead{}
    \fancyfoot[RO, LE]{\thepage}
    \renewcommand{\headrulewidth}{0pt}
    \renewcommand{\footrulewidth}{0pt}
}
\begin{document}
Title page here
Declaration here
Abstract here
TOC
main matter
Bibliography
\end{document}

答案1

我在下面的示例中应用了我在评论中建议的调整。它看起来像您期望的那样吗?我添加了一些占位符文本来演示页眉和页脚。另外,我不知道如何使用,所以我用包中定义的\color{dark-gray}替换了它。\color{darkgray}xcolor

\documentclass[oneside,12pt]{book}
\usepackage{fancyhdr}
\usepackage{lipsum}
\usepackage{xcolor}

\renewcommand{\chaptermark}[1]{\markboth{#1}{}}
\renewcommand{\sectionmark}[1]{\markright{#1}}
\pagestyle{fancy}
\fancyhf{}
\fancyhead[L]{\itshape\nouppercase{\rightmark}}
\fancyhead[R]{\itshape\nouppercase{\leftmark}}
\fancyfoot[R]{\thepage}

\let\headruleORIG\headrule
\renewcommand{\headrule}{\color{darkgray}\headruleORIG}
\renewcommand{\headrulewidth}{0.3pt}
\let\footruleORIG\footrule
\renewcommand{\footrule}{\color{darkgray}\footruleORIG}
\renewcommand{\footrulewidth}{0.3pt}

\usepackage{colortbl}
\arrayrulecolor{black}
\fancypagestyle{plain}{
    \fancyhf{}
    \fancyhead{}
    \fancyfoot[R]{\thepage}
    \renewcommand{\headrulewidth}{0pt}
    \renewcommand{\footrulewidth}{0pt}
}

\begin{document}

\chapter{Testing a}
\lipsum[1-6]
\section{Testing a1}
\lipsum[1-4]

\chapter{Testing b}
\lipsum[1-6]

\end{document}

上述 Latex 代码输出的屏幕截图

相关内容