我正在使用考试课程准备试卷。有人能告诉我如何在页眉中插入图片吗?我的目标是在试卷顶部插入大学的信头。问候 Leo
答案1
这有帮助吗?图像可以放置在 3 个位置(左、中、右)。建议的解决方案还包括第一个/运行页眉和页脚。
代码
\documentclass[12pt,a4paper,addpoints,answers]{exam}
\usepackage{tikz,graphicx,lipsum}
\usepackage[T1]{fontenc}
\usepackage{helvet}
\usepackage{amssymb,amsmath}
\usepackage{pgfplots,geometry}
\usetikzlibrary{shapes,decorations,arrows,automata}
%\headheight 10pt
\geometry{paperheight=29.7cm,paperwidth=21cm,textheight=25cm,textwidth=19cm,top=2cm,footskip=1cm}
\pagestyle{headandfoot}
\firstpageheader{\sffamily 25 March, 2014
\includegraphics[width=1cm]{example-image}} %left header
{\fontfamily{phv}\selectfont{\huge{\bfseries First Midterm}}} % middle header
{\sffamily Prof. ABC} % right header
\runningheader{\sffamily Math 101}{xxxx}{\sffamily 25 March 2014}
\runningheadrule
\firstpagefooter{}{\sffamily Page~\thepage\ of~\numpages\ }{\iflastpage{\sffamily End of Exam}{\sffamily Next page, Please\ldots}}
\runningfooter{}{\sffamily Page \thepage\ of \numpages}{\iflastpage{\sffamily End of Exam}{Next page, Please\ldots}}
\begin{document}
\textbullet\ {\color{red} This exam has \numquestions\ questions, totaling \numpoints\ points and \numbonuspoints\ bonus points.}
\begin{questions}
\question[10] This is question one
\lipsum[1]
\question[10] This is question two
\lipsum[2]
\end{questions}
\end{document}