我想要一个像这样的页面显示:
[n] 是页码。我不需要在右侧和底部写任何东西。(我只需要这些空间来写手写评论)。章节页和目录应该有一个经典的显示。
目前,我有以下代码:
\documentclass[12pt]{report}
\usepackage[left=1in, right=1in, bottom=1in, top=1in]{geometry}
\usepackage{fancyhdr}
\pagestyle{fancy}
\renewcommand{\footrulewidth}{1pt}
\fancyfoot[L]{Comments : }
\fancyfoot[R]{\thepage}
\fancyfoot[C]{}
\fancyhead[L]{}
\fancyhead[R]{\rule{\footrulewidth}{.5in} Keys Words : }
\renewcommand{\headrulewidth}{0pt}
\def\footrule{{\if@fancyplain\let\footrulewidth\plainfootrulewidth\fi
\vskip-\footruleskip\vskip-\footrulewidth
\leavevmode\rlap{\hspace*{-2in}\rule{2\paperwidth}{\footrulewidth}}
\vskip\footruleskip}}
\begin{document}
\newgeometry{left=.5in, right=1.5in, bottom=2.5in, top=.5in}
\hspace{\fill}\rule{\footrulewidth}{575pt}
\end{document}
它的输出是这样的:
右上角偏移了,页码也放错了位置。我觉得我需要彻底重写代码来克服这些困难,但我不知道该怎么做。
答案1
由于您只需要在右侧和底部手写,因此我认为可以使用tikz
作为页面背景轻松创建布局。
我还添加了这两行代码Mico 的回答使该章节像其他章节一样成为第一页:
\usepackage{etoolbox}
\patchcmd{\chapter}{\thispagestyle{plain}}{\thispagestyle{fancy}}{}{}
这是我的 MWE:
\documentclass[12pt]{report}
\usepackage[left=.5in, right=2in, bottom=2.5in, top=.5in, marginparwidth=0pt]{geometry}
%\usepackage{showframe}
\usepackage{eso-pic}
\usepackage{tikz}
\usepackage{fancyhdr}
\pagestyle{fancy}
\fancyfoot[L]{Comments:}
\fancyfoot[R]{}
\fancyfoot[C]{}
\fancyhead[L]{}
\fancyhead[R]{}
\renewcommand{\headrulewidth}{0pt}
\renewcommand{\footrulewidth}{0pt}
% the following two lines of code are from: https://tex.stackexchange.com/a/117334/101651
\usepackage{etoolbox}
\patchcmd{\chapter}{\thispagestyle{plain}}{\thispagestyle{fancy}}{}{}
\usepackage{mwe}% for testing purpose only
\begin{document}
\AddToShipoutPictureBG{%
\AtPageLowerLeft{%
\begin{tikzpicture}[overlay,remember picture]
% horizontal line
\draw[line width=1pt] (0,.214\paperheight) -- (\paperwidth,.214\paperheight);
% vertical line
\draw[line width=1pt] (.8\paperwidth,\paperheight) -- (.8\paperwidth,.214\paperheight);
% page number at the very bottom
\node[text width=4em, align=right] at (.93\paperwidth,.03\paperheight) {\thepage};
% "Key Words:" at the very top
\node at (.88\paperwidth,.97\paperheight) {Keys Words:};
\end{tikzpicture}}}
% The following lines are for testing purpose only
\tableofcontents
\chapter{This is for testing purpose only}
\section{Some text with a footnote}
\blindtext\footnote{A test footnote.}
\blindtext[3]
\section{Some text without footnotes}
\blindtext
\chapter{Just to show the page numbering}
\blindtext[10]
\end{document}
以下是一些示例页面: