如何用 LaTeX 制作试卷?

如何用 LaTeX 制作试卷?

在此处输入图片描述

\documentclass[11pt,paper=a4,answers]{exam}
\usepackage{graphicx,lastpage}
\usepackage{upgreek}
\usepackage{censor}
\censorruledepth=-.2ex
\censorruleheight=.1ex
\hyphenpenalty 10000
   \usepackage[paperheight=10.5in,paperwidth=8.27in,bindingoffset=0in,left=0.8in,right=1in,
top=0.7in,bottom=1in,headsep=.5\baselineskip]{geometry}
\flushbottom
\usepackage[normalem]{ulem}
\renewcommand\ULthickness{2pt}   %%---> For changing thickness of underline
\setlength\ULdepth{1.5ex}%\maxdimen ---> For changing depth of underline
\renewcommand{\baselinestretch}{1}
\pagestyle{empty}

\pagestyle{headandfoot}
\headrule
\newcommand{\continuedmessage}{%
\ifcontinuation{\footnotesize Question \ContinuedQuestion\ continues\ldots}{}%
 }
\runningheader{\footnotesize Mathematics}
{\footnotesize Mathematics --- Differential Geometry}
{\footnotesize Page \thepage\ of \numpages}
\footrule
\footer{\footnotesize Student's name:}
{}
{\ifincomplete{\footnotesize Question \IncompleteQuestion\ continues
on the next page\ldots}{\iflastpage{\footnotesize End of exam}     {\footnotesize Please go        on to the next page\ldots}}}

\usepackage{cleveref}
\crefname{figure}{figure}{figures}
\crefname{question}{question}{questions}
%==============================================================
\renewcommand\thequestion{Q.\arabic{question}}
\renewcommand{\questionlabel}{\thequestion)}
\renewcommand{\questionshook}{%
\setlength{\leftmargin}{0pt}%
\setlength{\labelwidth}{-\labelsep}%
}


\pointsinrightmargin
\pointsdroppedatright
\marksnotpoints
\marginpointname{ \points}
\pointformat{\boldmath\themarginpoints}
%\bracketedpoints
\begin{document}

\thispagestyle{empty}

\noindent
\begin{minipage}[t]{\textwidth}%
\centering
\includegraphics[width=1cm]{por} \par
\underline{Name of the University}\par
\underline{Campus name} \par
\underline{Mid term examination -- Spring 2013} \par
\underline{SUBJECTIVE}
\end{minipage}
\par
\bigskip\bigskip
\begin{minipage}[t]{.5\textwidth}%
Degree Program: Mathematics \par
Course Title:  Course Title\par
Date of Examination: 9.6.2014 \par
Teacher's name: ABCD \par
Student's name: \makebox[1.5in]{\hrulefill} \par
Course Code: Math-506
\end{minipage}%
\hfill
\begin{minipage}[t]{.4\textwidth}%
Class: BS \par
Semester: 2nd \par
Time duration: 3 hours \par
Total Marks: 60 \par
Roll No: \makebox[1in]{\hrulefill}
\end{minipage}
\par
\bigskip
\begin{questions}

\question[6]
\label{Q:perunit}
For a surface $\vec{r}= \vec{r} (u \cos v, u \sin v, f(u))$. Write down   the first fundamental form of the surface. Show that the parametric curves  are orthogonal.
\droppoints
\question[10]
\label{Q:zbus}
Prove that necessary conditions for the curve $u = u(t), v = v(t)$ on a surface $\vec(r) = \vec(r)(u,v)$ to be geodesic is that \begin{equation}U    \frac{\partial T}{\partial \dot{v}} - V    \frac{\partial T}{\partial    \dot{u}}\end{equation}
where
$$ U = \frac{d}{dt} \Big(\frac{\partial T}{\partial \dot{u}}\Big) -    \frac{\partial T}{\partial u} = \frac{1}{2T}\frac{dT}{dt}\frac{\partial T}{\partial \dot{u}}$$
$$ V = \frac{d}{dt} \Big(\frac{\partial T}{\partial    \dot{v}}\Big) - \frac{\partial T}{\partial v} = \frac{1}{2T}\frac{dT}{dt}\frac{\partial T} {\partial \dot{v}}$$
\droppoints
\question[8]
\label{Q:zbus}
For the curve
$$
x = a(3u - u^{3}),\qquad y = 3au^{2},\qquad z = a(3u + u^{3})
$$
show that $$\uptau = k  =  \frac{1}{3a(1+u^{2})^{2}}$$
\droppoints
\question[8]
\label{Q:zbus}
 A curve is uniquely determined except as the position in space, when its   curvature and            torsion are given functions of its arc length.
\droppoints
\question[8]
\label{Q:zbus}
Show that there exists an infinite family of involutes for a  gives curve.
\droppoints
\newpage
\question[08]
\label{Q:ybus}
Give short answers of the following questions.
\begin{enumerate}
\item
\item If equation of the circle is $x^{2} + y^{2} = a^{2}$ then the  parametric equations            of circles are \xblackout{forty     two}?
\end{enumerate}
\end{questions}
\begin{center}
\rule{.5\textwidth}{1pt}
\end{center}
\end{document} 

我希望图标(徽标)位于左侧。我的代码将其放在大学名称上方。

我如何将徽标放在大学名称等的左侧?

答案1

使用tabular;我在图像和标题之间设置了 1cm 的间隔,请进行调整以适合您。

请注意,标题位于中央,因为图像包含在零宽度框中。

请使用粗体或斜体来强调,不要使用下划线。在 LaTeX 中也应避免使用;我在第二个问题中$$展示了用法。gather*

\documentclass[11pt,paper=a4,answers]{exam}

\usepackage[
  paperheight=10.5in,
  paperwidth=8.27in,
  bindingoffset=0in,
  left=0.8in,
  right=1in,
  top=0.7in,
  bottom=1in,
  headsep=.5\baselineskip
]{geometry}

\usepackage{amsmath,graphicx,lastpage}

\usepackage{upgreek}
\usepackage{censor}
\censorruledepth=-.2ex
\censorruleheight=.1ex

\flushbottom

\usepackage{cleveref}

\pagestyle{headandfoot}
\headrule
\newcommand{\continuedmessage}{%
  \ifcontinuation{\footnotesize Question \ContinuedQuestion\ continues\ldots}{}%
}
\runningheader{\footnotesize Mathematics}
  {\footnotesize Mathematics --- Differential Geometry}
  {\footnotesize Page \thepage\ of \numpages}
\footrule
\footer{\footnotesize Student's name:}
  {}
  {\ifincomplete{\footnotesize Question \IncompleteQuestion\ continues
   on the next page\ldots}{\iflastpage{\footnotesize End of exam}
  {\footnotesize Please go on to the next page\ldots}}}

\crefname{figure}{figure}{figures}
\crefname{question}{question}{questions}
%==============================================================
\renewcommand\thequestion{Q.\arabic{question}}
\renewcommand{\questionlabel}{\thequestion)}
\renewcommand{\questionshook}{%
  \setlength{\leftmargin}{0pt}%
  \setlength{\labelwidth}{-\labelsep}%
}


\pointsinrightmargin
\pointsdroppedatright
\marksnotpoints
\marginpointname{ \points}
\pointformat{\boldmath\themarginpoints}
%\bracketedpoints

\begin{document}

\thispagestyle{empty}

\begin{center}
\makebox[0pt][r]{%
  \begin{tabular}{@{}c@{}}
  \includegraphics[width=1cm]{example-image-9x16}
  \end{tabular}%
  \hspace{1cm}% <----- CHANGE HERE THE SEPARATION
}%
\begin{tabular}{@{}c@{}}
\bfseries Name of the University\\
\itshape Campus name \\
\bfseries Mid term examination -- Spring 2013 \\
\bfseries SUBJECTIVE
\end{tabular}
\end{center}

\begin{tabular}[t]{@{}l@{}}%
Degree Program: Mathematics \\
Course Title:  Course Title\\
Date of Examination: 9.6.2014 \\
Teacher's name: ABCD \\
Student's name: \makebox[1.5in]{\hrulefill} \\
Course Code: Math-506
\end{tabular}\hspace{\stretch{2}}%
\begin{tabular}[t]{@{}l@{}}
Class: BS \\
Semester: 2nd \\
Time duration: 3 hours \\
Total Marks: 60 \\
Roll No: \makebox[1in]{\hrulefill}
\end{tabular}\hspace*{\stretch{1}}

\bigskip


\begin{questions}

\question[6]
\label{Q:perunit}
For a surface $\vec{r}= \vec{r} (u \cos v, u \sin v, f(u))$. Write down the first fundamental form of 
the surface. Show that the parametric curves are orthogonal.
\droppoints

\question[10]
\label{Q:zbus}
Prove that necessary conditions for the curve $u = u(t), v = v(t)$ on a surface $\vec(r) = 
\vec(r)(u,v)$ to be geodesic is that
\begin{equation}
U \frac{\partial T}{\partial \dot{v}} - V \frac{\partial T}{\partial \dot{u}}
\end{equation}
where
\begin{gather*}
U = \frac{d}{dt} \Bigl(\frac{\partial T}{\partial \dot{u}}\Bigr) - 
    \frac{\partial T}{\partial u} = \frac{1}{2T}\frac{dT}{dt}\frac{\partial T}{\partial \dot{u}}
\\
V = \frac{d}{dt} \Bigl(\frac{\partial T}{\partial \dot{v}}\Bigr) -
    \frac{\partial T}{\partial v} = \frac{1}{2T}\frac{dT}{dt}\frac{\partial T} {\partial \dot{v}}
\end{gather*}
\droppoints

\end{questions}

\end{document} 

在此处输入图片描述

答案2

加载array包(针对m列类型),然后使用tabular类似的

\begin{tabular}{cm{\dimexpr\linewidth-1cm-4\tabcolsep\relax}}%
  \includegraphics[width=1cm]{example-image}
  &
\centering
\underline{Name of the University}\par
\underline{Campus name} \par
\underline{Mid term examination -- Spring 2013} \par
\underline{SUBJECTIVE}\par
\end{tabular}

完整代码(感谢泄露整个试卷;-)):

\documentclass[11pt,paper=a4,answers]{exam}
\usepackage{graphicx,lastpage,array}
\usepackage{upgreek}
\usepackage{censor}
\censorruledepth=-.2ex
\censorruleheight=.1ex
\hyphenpenalty 10000
   \usepackage[paperheight=10.5in,paperwidth=8.27in,bindingoffset=0in,left=0.8in,right=1in,
top=0.7in,bottom=1in,headsep=.5\baselineskip]{geometry}
\flushbottom
\usepackage[normalem]{ulem}
\renewcommand\ULthickness{2pt}   %%---> For changing thickness of underline
\setlength\ULdepth{1.5ex}%\maxdimen ---> For changing depth of underline
\renewcommand{\baselinestretch}{1}
\pagestyle{empty}

\pagestyle{headandfoot}
\headrule
\newcommand{\continuedmessage}{%
\ifcontinuation{\footnotesize Question \ContinuedQuestion\ continues\ldots}{}%
 }
\runningheader{\footnotesize Mathematics}
{\footnotesize Mathematics --- Differential Geometry}
{\footnotesize Page \thepage\ of \numpages}
\footrule
\footer{\footnotesize Student's name:}
{}
{\ifincomplete{\footnotesize Question \IncompleteQuestion\ continues
on the next page\ldots}{\iflastpage{\footnotesize End of exam}     {\footnotesize Please go        on to the next page\ldots}}}

\usepackage{cleveref}
\crefname{figure}{figure}{figures}
\crefname{question}{question}{questions}
%==============================================================
\renewcommand\thequestion{Q.\arabic{question}}
\renewcommand{\questionlabel}{\thequestion)}
\renewcommand{\questionshook}{%
\setlength{\leftmargin}{0pt}%
\setlength{\labelwidth}{-\labelsep}%
}


\pointsinrightmargin
\pointsdroppedatright
\marksnotpoints
\marginpointname{ \points}
\pointformat{\boldmath\themarginpoints}
%\bracketedpoints
\begin{document}

\thispagestyle{empty}

\noindent
\begin{tabular}{cm{\dimexpr\linewidth-1cm-4\tabcolsep\relax}}%
  \includegraphics[width=1cm]{example-image}
  &
\centering
\underline{Name of the University}\par
\underline{Campus name} \par
\underline{Mid term examination -- Spring 2013} \par
\underline{SUBJECTIVE}\par
\end{tabular}
\par
\bigskip\bigskip
\begin{minipage}[t]{.5\textwidth}%
Degree Program: Mathematics \par
Course Title:  Course Title\par
Date of Examination: 9.6.2014 \par
Teacher's name: ABCD \par
Student's name: \makebox[1.5in]{\hrulefill} \par
Course Code: Math-506
\end{minipage}%
\hfill
\begin{minipage}[t]{.4\textwidth}%
Class: BS \par
Semester: 2nd \par
Time duration: 3 hours \par
Total Marks: 60 \par
Roll No: \makebox[1in]{\hrulefill}
\end{minipage}
\par
\bigskip
\begin{questions}

\question[6]
\label{Q:perunit}
For a surface $\vec{r}= \vec{r} (u \cos v, u \sin v, f(u))$. Write down   the first fundamental form of the surface. Show that the parametric curves  are orthogonal.
\droppoints
\question[10]
\label{Q:zbus}
Prove that necessary conditions for the curve $u = u(t), v = v(t)$ on a surface $\vec(r) = \vec(r)(u,v)$ to be geodesic is that \begin{equation}U    \frac{\partial T}{\partial \dot{v}} - V    \frac{\partial T}{\partial    \dot{u}}\end{equation}
where
$$ U = \frac{d}{dt} \Big(\frac{\partial T}{\partial \dot{u}}\Big) -    \frac{\partial T}{\partial u} = \frac{1}{2T}\frac{dT}{dt}\frac{\partial T}{\partial \dot{u}}$$
$$ V = \frac{d}{dt} \Big(\frac{\partial T}{\partial    \dot{v}}\Big) - \frac{\partial T}{\partial v} = \frac{1}{2T}\frac{dT}{dt}\frac{\partial T} {\partial \dot{v}}$$
\droppoints
\question[8]
\label{Q:zbus}
For the curve
$$
x = a(3u - u^{3}),\qquad y = 3au^{2},\qquad z = a(3u + u^{3})
$$
show that $$\uptau = k  =  \frac{1}{3a(1+u^{2})^{2}}$$
\droppoints
\question[8]
\label{Q:zbus}
 A curve is uniquely determined except as the position in space, when its   curvature and            torsion are given functions of its arc length.
\droppoints
\question[8]
\label{Q:zbus}
Show that there exists an infinite family of involutes for a  gives curve.
\droppoints
\newpage
\question[08]
\label{Q:ybus}
Give short answers of the following questions.
\begin{enumerate}
\item
\item If equation of the circle is $x^{2} + y^{2} = a^{2}$ then the  parametric equations            of circles are \xblackout{forty     two}?
\end{enumerate}
\end{questions}
\begin{center}
\rule{.5\textwidth}{1pt}
\end{center}
\end{document}

在此处输入图片描述

如果您想要将徽标移得更近,请使用tabular如下所示的两个 s:

.
.
.
\thispagestyle{empty}

\noindent
{
\centering
\begin{tabular}{c}%
  \includegraphics[width=1cm]{example-image}
\end{tabular}
\begin{tabular}{c}%
\underline{Name of the University}\\
\underline{Campus name} \\
\underline{Mid term examination -- Spring 2013} \\
\underline{SUBJECTIVE}\
\end{tabular}
\par
}
\bigskip\bigskip
.
.
.

在此处输入图片描述

相关内容