如何使用其他证实者使用的模板中的 fancyhdr 缩放备用页面上的图形?
下面的第一个清单是一个有效示例,第二个清单是一个失败示例。唯一的区别是“\rhead”的定义
texerr.sty(无需缩放即可工作):
\usepackage{fancyhdr}
\usepackage{graphicx}
\usepackage{epstopdf}
\usepackage[letterpaper, headheight=80px, top=.5in, bottom=.5in, left=1in, right=.5in, includeheadfoot]{geometry}
\pagestyle{fancy}
\lhead[\thepage]{\includegraphics[scale = 0.08]{images/logo.eps}}
\chead{Sample Title}
\rhead[\includegraphics{images/logo.eps}]{\thepage}
\cfoot{Jon}
\title{
My Title
}
texerr.sty(包含缩放时失败):
\usepackage{fancyhdr}
\usepackage{graphicx}
\usepackage{epstopdf}
\usepackage[letterpaper, headheight=80px, top=.5in, bottom=.5in, left=1in, right=.5in, includeheadfoot]{geometry}
\pagestyle{fancy}
\lhead[\thepage]{\includegraphics[scale = 0.08]{images/logo.eps}}
\chead{Sample Title}
\rhead[\includegraphics[scale = 0.08]{images/logo.eps}]{\thepage}
\cfoot{Jon}
\title{
My Title
}
第二个例子的错误:
! LaTeX Error: Missing \begin{document}.
See the LaTeX manual or LaTeX Companion for explanation.
Type H <return> for immediate help.
...
l.9 ...cludegraphics[scale = 0.08]{images/logo.eps}]
{\thepage}
通用实现.tex 文件:
\documentclass[letterpaper, 10pt, twoside]{article}
\usepackage{texerr}
\usepackage{lipsum}
\begin{document}
\maketitle
\thispagestyle{empty}
\newpage
Todo: Copyright Page
\thispagestyle{empty}
\newpage
\setcounter{page}{1}
\pagenumbering{arabic}
\section{Introduction}
\lipsum
\end{document}
答案1
您的问题是方括号内有方括号。这会让 TeX 感到困惑。
只需将可选参数放在附加括号中即可,[{...}]
如下所示:
\rhead[{\includegraphics[scale = 0.08]{images/logo.eps}}]{\thepage}