## LaTeX forum ⇒ Text Formatting ⇒ How to write a math test paper Topic is solved

Information and discussion about LaTeX's general text formatting features (e.g. bold, italic, enumerations, ...)
lyj_aizj
Posts: 5
Joined: Wed Mar 25, 2020 8:23 am

### How to write a math test paper

Hello everyone, I like latex very much. Now I want to write a math paper, but I don't know how to start. I downloaded the template but it didn't work. Hope God, give me some help.

Ijon Tichy
Posts: 233
Joined: Mon Dec 24, 2018 10:12 am
Templates are often a mess. Better start with a minimal document using a standard class, a KOMA-Script class or memoir and add only the packages and definitions you need. A good package for writing math is amsmath or its extension mathtools.

lyj_aizj
Posts: 5
Joined: Wed Mar 25, 2020 8:23 am
Thank you very much, but I do n’t know where to start, I do n’t have books to read, or examples of writing math papers. Hope the great god gives me an instruction. Where to start? I study latex, generally watching videos on the website, or downloading books in pdf format, and I learn that way, but those books do not introduce how to typeset test papers for mathematics. I am sad.

Ijon Tichy
Posts: 233
Joined: Mon Dec 24, 2018 10:12 am
What do you mean with “test papers”? Do you mean doing some tests to see how to typeset math using LaTeX? Or do you mean typesetting examination/exercise documents?

The first are simply math documents. See a good introduction to LaTeX like “LaTeX for Complete Novices” (it is not really up-to-date but still good) and the amsmath user guide amsldoc.pdf.

The second are something completely different. There are several packages for examination/exercise documents, e.g., xsim. Almost all packages have manuals, that also contain examples.

One short note about how you are learning LaTeX: This can be successful, but there is a high risk to learn things, you should not do. For example there are a lot of very nice looking video tutorials on youtube with very bad content (in German until now I don't find really good youtube tutorial for LaTeX). Internet examples are often related to a special purpose at a special time and special circumstances. If you try to transfer them to another situation they can break several other things. And there are much more bad templates than good once. So in general it is better to read an up-to-date introduction to learn the basics and then search for suitable packages, read their manual and ask questions. So the start is always the same:
\documentclass{article}% or scrartcl\begin{document}\end{document}

or
\documentclass{report}% or scrreprt or memoir\begin{document}\end{document}

And then add all the packages you need, but only the packages you need.

Switching from a document with chapters to a real book is very easy, because report and book or scrreprt and scrbook are extremely compatible classes.

Switching to extended, specialized classes, e.g., for publications depending on a dedicated series of a publisher, can also be done by replacing the class. Sometimes you additionally have to remove some packages in this case, because publishers often already load several packages into their classes. This can result in incompatibilities and is one reason to use only those packages you really need. And sometimes publishers explicitly forbid some packages because of their workflow.

lyj_aizj
Posts: 5
Joined: Wed Mar 25, 2020 8:23 am
Oh, I will write latex for articles and books. I want to talk about the packages. I ca n’t find a suitable one. I want to see some examples of papers and see how the gods wrote them. If the god can write, can you help me? Write a practice paper on A4 paper. The exam papers on my side are all the size of A3 paper.

lyj_aizj
Posts: 5
Joined: Wed Mar 25, 2020 8:23 am
\documentclass{BHCexam}

\begin{document}
\biaoti{2018期末}
\fubiaoti{}
\maketitle
\begin{questions}
\qs 若$\log_2a+\log_{\frac{1}{2}}b=2$，则有\xx
\onech{$a=2b$}{$b=2a$}{$a=4b$}{$b=4a$}
\qs 已知直线$x-y+m=0$与圆$O:x^2+y^2=1$相交于$A,B$两点，且$\triangle OAB$为正三角形，则实数$m$的值为\xx
\onech{$\dfrac{\sqrt{3}}{2}$}{$\dfrac{\sqrt{6}}{2}$}{$\dfrac{\sqrt{3}}{2}\text{或}-\dfrac{\sqrt{3}}{2}$}{$\dfrac{\sqrt{6}}{2}\text{或}-\dfrac{\sqrt{6}}{2}$}

\qs 从编号分别为$1,2,3,4,5,6$的六个大小完全相同的小球中，随机取出三个小球，则恰有两个小球编号相邻的概率是\xx
\onech{$\dfrac{1}{5}$}{$\dfrac{2}{5}$}{$\dfrac{3}{5}$}{$\dfrac{4}{5}$}
\qs 在$\triangle ABC$中，$AB=AC=1, \ D$是$AC$边的中点，则$\vv{BD}\bm{\cdot}\vv{CD}$的取值范围是\xx
\onech{$\left(-\dfrac{3}{4},\dfrac{1}{4}\right)$}{$\left(-\infty,\dfrac{1}{4}\right)$}{$\left(-\dfrac{3}{4},+\infty\right)$}{$\left(\dfrac{1}{4},\dfrac{3}{4}\right)$}
\qs 已知$M$为曲线C:\Bigg\{\begin{aligned} & x=3+\cos\theta,\\ & y=\sin\theta \end{aligned}\left(\theta\text{为参数}\right)上的动点，设$O$为原点，则$\abs{OM}$的最大值是\xx
\onech{$1$}{$2$}{$3$}{$4$}
\qs 设$\bm{a,b}$是非零向量，且$\bm{a,b}$不共线，则“$\abs{\bm{a}}=\abs{\bm{b}}$”是“$\abs{\bm{a+2b}}=\abs{\bm{2a+b}}$”的\xx
\twoch{充分而不必要条件}{必要而不充分条件}{充分必要条件}{既不充分也不必要条件}
\qs 函数$f(x)=2\sin\left(\omega x+\varphi\right)\left(\omega>0,\abs{\varphi}<\dfrac{\pi}{2}\right)$的部分图象如图所示，则$\omega,\varphi$的值分别是\xx
\begin{center}
\begin{tikzpicture}[>=latex]
\tikzmath{
\a = 5*pi/12;
\b=11*pi/12;
}
\draw[->](-1,0)--(4,0) node[below](x){$x$};
\draw[->](0,-2.3)--(0,2.3) node[left](y){$y$};
\node[below left](O) at(0,0){$\small O$};
\draw[domain=0:pi,samples=1000] plot (\x,{2*sin((2*(\x)-pi/3) r)});
\draw[dashed] (0,2)node[left](a){$2$}-|(\a,0)node[below](a1){$\dfrac{5\pi}{12}$} ;;
\draw[dashed](0,-2)node[left](b){$-2$}-|(\b,0)node[above](b1){$\dfrac{11\pi}{12}$} ;
% \draw[dashed] (0,2)-|($(5*pi/12,0)$);
\end{tikzpicture}
\end{center}
\onech{$2,-\dfrac{\pi}{3}$}{$2,-\dfrac{\pi}{6}$}{$4,-\dfrac{\pi}{6}$}{$4,\dfrac{\pi}{3}$}
\qs 以角$\theta$的顶点为坐标原点，始边为$x$轴的非负半轴，建立平面直角坐标系，角$\theta$终点过点$P(2,4)$，则$\tan\left(\theta+\dfrac{\pi}{4}\right)=$\xx
\onech{$-\dfrac{1}{3}$}{$-3$}{$\dfrac{1}{3}$}{$3$}
\qs 实数$x,y$满足$\begin{dcases} x-1\ge 0,\\ x+y-1\ge 0,\\ x-y+1\ge 0. \end{dcases}$则$2x-y$的取值范围是\xx
\onech{$\left[0,2\right]$}{$\left(-\infty,0\right]$}{$\left[-1,2\right]$}{$\left[0,+\infty\right)$}

\qs 已知函数$f(x)=\sin\left(x+\varphi\right)$的图象记为曲线$C$，则“$f(0)=f\left(\pi\right)$”是“曲线$C$关于直线$x=\dfrac{\pi}{2}$对称”的\xx
\twoch{充分而不必要条件}{必要而不充分条件}{充分必要条件}{既不充分也不必要条件}
\qs “$m>10$”是“方程$\dfrac{x^2}{m-10}+\dfrac{y^2}{m-8}=1$表示双曲线”的\xx
\twoch{充分而不必要条件}{必要而不充分条件}{充分必要条件}{既不充分也不必要条件}
\qs 已知点$F$为抛物线$C:y^2=2px(p>0)$的焦点，点$K$为$F$关于原点的对称点，点$M$在抛物线$C$上，则下列说法错误的是\xx
\fourch{使得$\triangle MFK$为等腰三角形的点$M$有且仅有$4$个}{使得$\triangle MFK$为直角三角形的点$M$有且仅有$4$个}{使得$\angle MKF=\dfrac{\pi}{4}$的点$M$有且仅有$4$个}{使得$\angle MKF=\dfrac{\pi}{6}$的点$M$有且仅有$4$个}

%海淀文第8题
\qs 已知正方体$ABCD-A_1B_1C_1D_1$的棱长为$2$，$M,N$分别是棱$BC,\ C_1D_1$的中点，点$P$在平面$A_1B_1C_1D_1$内，点$Q$在线段$A_1N$上.若$PM=\sqrt{5}$，则$PQ$长度的最小值是\xx
\begin{center}
\swht{
\coordinate[label=above right:\footnotesize$D$](D) at(0,0);
\coordinate[label=below left:\footnotesize$A$](A) at(6,0);
\coordinate[label=right:\footnotesize$C$](C) at(0,4);
\coordinate[label=below:\footnotesize$B$](B) at(6,4);
\foreach \i in {A,D}
\draw (\i)--+(0,0,3) node[coordinate,label=left:\footnotesize$\i_1$](\i_1) {$\i_1$};
\foreach \j in {B,C}
\draw (\j)--+(0,0,3) node[coordinate,label=right:\footnotesize$\j_1$](\j_1) {$\j_1$};
\coordinate[label=\footnotesize$N$](N) at($(C_1)!0.5!(D_1)$);
\coordinate[label=below:\footnotesize$Q$](Q) at($(A_1)!0.7!(N)$);
\coordinate[label=above:\footnotesize$P$] (P) at(4,3.5,3);
\coordinate[label=right:\footnotesize$M$](M) at($(B)!0.5!(C)$);
\draw(P)--(Q);
\draw[dashed] (A)--(D)--(C);
\draw (A)--(B)--(C);
\draw(A_1)--(B_1)--(C_1)--(D_1)--cycle;
\draw(A_1)--(N);
\draw[densely dashed] (P)--(M);
}
\end{center}
\vspace{-1.2em}
\onech{$\sqrt{2}-1$}{$\sqrt{2}$}{$\dfrac{3\sqrt{5}}{5}-1$}{$\dfrac{3\sqrt{5}}{5}$}
\qs 现有$n$个小球，甲、乙两位同学轮流且不放回抓球，每次最少抓$1$个球，最多抓$3$个球，规定谁先抓到最后一个球谁赢.如果甲先抓，那么以下推断正确的是\xx
\twoch{若$n=4$，则甲有必赢的策略}{若$n=6$，则乙有必赢的策略}{若$n=9$，则甲有必赢的策略}{若$n=11$，则乙有必赢的策略}
\qs 已知$A,B$是函数$y=2^x$的图象上的相异两点，若点$A,B$到直线$y=\dfrac{1}{2}$的距离相等，则点$A,B$的横坐标之和的取值范围是\xx
\onech{$\left(-\infty,-1\right)$}{$\left(-\infty,-2\right)$}{$\left(-\infty,-3\right)$}{$\left(-\infty,-4\right)$}

%%%填空
\qs 函数$f(x)=\begin{dcases} 2^x,&x\le0\\ x(2-x),&x>0 \end{dcases}$的最大值为\tk;若函数$f(x)$的图象与直线$y=k(x-1)$有且只有一个公共点，则实数$k$的取值范围是\tk.
\qs 若$a=\ln\dfrac{1}{2},\ b=\left(\dfrac{1}{3}\right)^{0.8},\ c=2^{\frac{1}{3}}$，则$a,b,c$的大小关系是\tk.
\qs 设常数$a\inR$，若$\left(x^2+\dfrac{a}{x}\right)^5$的二项展开式中$x^7$的系数为$-10$，则$a=$\tk.
\qs 在$\triangle ABC$中，$H$为$BC$上异于$B,\ C$的任一点，$M$为$AH$的中点，若$\vv{AM}=\lambda\vv{AB}+\mu\vv{AC},\$则$\lambda+\mu =$\tk.
\qs 若集合$\left\{a,b,c,d\right\} =\left\{1,2,3,4\right\}$，且下列四个关系：\\
\ding{192}$a=1$\qquad \ding{193}$b\ne1$\qquad\ding{194}$c=2$，\qquad\ding{195}$d\ne4$

\qs 已知正方体$ABCD-A_1B_1C_1D_1$的棱长为$4\sqrt{2}$，点$M$是棱$BC$的中点，点$P$在底面$ABCD$内，点$Q$在线段$A_1C_1$上，若$PM=1$，则$PQ$的长度的最小值为\tk.
\qs 设抛物线$C:y^2=4x$的顶点为$O$，经过抛物线$C$的焦点且垂直于$x$轴的直线和抛物线$C$交于$A,~B$两点，则$\abs{\vv{OA}+\vv{OB}}$=\tk.
\qs 已知$\left(5x-1\right)^n$展开式中，各项系数的和与各项二项式系数的和之比为$64:1$，则$n$=\tk.
\qs 已知点$M\left(x,y\right)$的坐标满足条件$\begin{dcases} x-1\le 0,\\ x+y-1\ge 0,\\ x-y+1\ge 0. \end{dcases}$设$O$为原点，则$\abs{OM}$的最小值是\tk.

\qs 已知函数$f(x)=\begin{dcases} x^2-2x-3,&x>a,\\ -x,&x\le a. \end{dcases}$当$a=0$时，$f(x)$的值域为\tk;当$f(x)$有两个不同的零点时，实数$a$的取值范围是\tk.
\qs 已知函数$f(x)=\begin{dcases} x^2+x,&-x\le x\le c,\\ \dfrac{1}{x},&c<x\le 3. \end{dcases}$若$c=0$，则$f(x)$的值域是\tk;若$f(x)$的值域是$\left[-\dfrac{1}{4},2\right]$，则实数$c$的取值范围是\tk.
\qs 对任意实数$k$，定义集合$D_k=\left\{\left(x,y\right)\left|\begin{dcases} x-y+2\ge0\\ x+y-2\le 0\\ kx-y\le0 \end{dcases},x,y\inR \right.\right\}$.\par
\ding{192}若集合$D_k$表示的平面区域是一个三角形，则实数$k$的取值范围是\tk;\\
\ding{193}当$k=0$时，若对任意的$\left(x,y\right)\in D_0$，有$y\ge a(x+3)-1$恒成立，且存在$\left(x,y\right)\in D_0$，使得$x-y\le a$成立，则实数$a$的取值范围是\tk.
\clearpage
%%%简答
\qs 已知等差数列$\{a_n\}$的前$n$项和为$S_n$，且 $a_2=5,S_3=a_7$.
\begin{parts}
\part 求数列$\{a_n\}$的通项公式；
\part 若$b_n=2^{a_n},$求数列$\left\{a_n+b_n\right\}$的前$n$项和$S_n$
\end{parts}
\kb
\qs 已知数列$\{a_n\}$是公比为$\dfrac{1}{3}$的等比数列，且$a_2+6$是$a_1$和$a_3$的等差中项.
\begin{parts}
\part 求$\left\{a_n\right\}$的通项公式；
\part 设数列$\{a_n\}$的前$n$项积为$T_n$，求$T_n$的最大值.
\end{parts}
\clearpage
\qs 如图，在$\triangle ABC$中，$D$为边$BC$上一点，$AD=6,\ BD=3,\ DC=2$.
\begin{parts}
\part 若$\angle ADB=\dfrac{\pi}{2}$，求$\angle BAC$的大小；
\part 若$\angle ADB=\dfrac{2\pi}{3}$，求$\triangle ABC$的面积.
\end{parts}
\mbox{\hspace{1em}}\hfill
\begin{tikzpicture}[scale=0.5]
\begin{scope}
\coordinate[label=below:\small $B$](B)at(0,0);
\coordinate[label=below:\small$D$](D)at(3,0);
\coordinate[label=below:\small$C$](C)at(5,0);
\coordinate[label=left:\small$A$](A)at(3,6);
\draw (B)--(C)--(A)--cycle;
\draw (A)--(D);
\node[below](c)at(2.5,-0.5) {$\text{图}1$};
\end{scope}
\begin{scope}[xshift=8cm]
\coordinate[label=below:\small$B$](B)at(0,0);
\coordinate[label=below:\small$D$](D)at(3,0);
\coordinate[label=below:\small$C$](C)at(5,0);
\coordinate[label=above:\small$A$](A)at(6,5);
\draw (B)--(C)--(A)--cycle;
\draw (A)--(D);
\node[below](c)at(2.5,-0.5) {$\text{图}2$};
\end{scope}
\end{tikzpicture}

\kb
\qs 已知函数$f(x)=\cos 2x\bm{\cdot}\tan\left(x-\dfrac{\pi}{4}\right)$.
\begin{parts}
\part 求函数$f(x)$的定义域；
\part 求函数$f(x)$的值域.
\end{parts}
\newpage
\qs 已知函数$f(x)=2\sin ^2x-\cos\left(x+\dfrac{\pi}{3}\right)$.
\begin{parts}
\part 求$f(x)$的最小正周期；
\part 求证：当$x\in\left[0,\dfrac{\pi}{2}\right]$时，$f(x)\ge -\dfrac{1}{2}$.
\end{parts}
\kongbai
\qs 如图，在$\triangle ABC$中，点$D$在$AC$边上，且$AD=3DC ,\ AB=\sqrt{7},\ \angle ADB=\dfrac{\pi}{3},\ \angle C=\dfrac{\pi}{6}$.
\begin{parts}
\part 求$DC$的值；
\part $\tan \angle ABC$的值.
\end{parts}
\begin{flushright}
\begin{tikzpicture}
\coordinate[label=left:$A$](A) at (0,0);
\coordinate[label=below:$D$](D) at (3,0);
\coordinate[label=right:$C$](C) at (4,0);
\coordinate[label=above:$B$](B) at ($(25:sqrt(7)$);
\draw (A)--(C)--(B)--cycle;
\draw (B)--(D);
\end{tikzpicture}
\end{flushright}
%%%石景山整理未完成

\newpage
%%%西城文科整理完成
\qs 已知椭圆$C$：$\dfrac{x^2}{a^2}+\dfrac{y^2}{b^2}=1~(a>b>0)$过点$A(2,0),B(0,1)$两点.
\begin{parts}
\part 求椭圆$C$的方程及离心率；
\part 设点$Q$在椭圆上，试问直线$x+y-4=0$上是否存在点$P$，使得四边形$PAQB$是平行四边形？若存在，求出点$P$的坐标；若不存在，说明理由.
\end{parts}
\kongbai
\qs 已知椭圆$C$：$\dfrac{x^2}{a^2}+\dfrac{y^2}{b^2}=1~(a>b>0)$过点$A(2,0)$，且离心率为$\dfrac{\sqrt{3}}{2}$.
\begin{parts}
\part 求椭圆$C$的方程；
\part 设直线$y=kx+\sqrt{3}$与椭圆$C$交于$M,N$两点，若直线$x=3$上存在点$P$，使得四边形$PAMN$是平行四边形，求$k$ 的值.
\end{parts}
\newpage
\qs 已知椭圆$C$：$\dfrac{x^2}{a^2}+\dfrac{y^2}{b^2}=1~(a>b>0)$的离心率等于$\dfrac{1}{2}$，$P\left(2,3\right) ,Q\left(2,-3\right)$是椭圆$C$上的两点.
\begin{parts}
\part 求椭圆$C$的方程；
\part $A,B$是椭圆$C$上位于直线$PQ$两侧的动点，当$A,B$运动时，满足$\angle APQ=\angle BPQ$，试问直线$AB$的斜率是否为定值？如果为定值，请求出此定值，如果不是定值，说明理由.
\end{parts}
\kongbai
\qs 已知椭圆$C:\dfrac{x^2}{3m} +\dfrac{y^2}{m}=1$，直线$l:x+y-2=0$与椭圆$C$相交于$P,Q$两点，与$x$轴交于点$B$，点$P,Q$与点$B$不重合.
\begin{parts}
\part 求椭圆$C$的离心率；
\part 当$S_{\triangle OPQ} =2$时，求椭圆$C$的方程；
\part 过原点$O$作直线$l$的垂线，垂足为$N$，若$\abs{PN}=\lambda \abs{BQ}$，求$\lambda$的值.
\end{parts}
\newpage
\qs 已知椭圆$C$：$\dfrac{x^2}{a^2}+\dfrac{y^2}{b^2}=1~(a>b>0)$的左右焦点分别为$F_1,\ F_2$，点$B\left(0,\sqrt{3}\right)$在椭圆$C$上，$\triangle F_1BF_2$是等边三角形.
\begin{parts}
\part 求椭圆$C$的标准方程；
\part 点$A$在椭圆$C$上，线段$AF_1$与线段$BF_2$交于点$M$，若$\triangle MF_1F_2$与$\triangle AF_1F_2$的面积之比为$2:3$，求点$M$的坐标.
\end{parts}
\kb
\qs 已知椭圆$C$：$\dfrac{x^2}{a^2}+\dfrac{y^2}{b^2}=1~(a>b>0)$的右焦点$F(1,0)$与短轴两个端点的连线互相垂直.
\begin{parts}
\part 求椭圆$C$的方程；
\part 设点$Q$为椭圆$C$上一点，过原点$O$且垂直于$QF$的直线与直线$y=2$交于点$P$，求$\triangle OPQ$面积$S$的最小值.
\end{parts}
\newpage
\qs 已知函数$f(x)=x^2\ln x-2x$.
\begin{parts}
\part 求曲线$y=f(x)$在点$\left(1,f(1)\right)$处的切线方程；
\part 求证：存在唯一的$x_0\in\left(1,2\right)$，使得曲线$y=f(x)$在点$\left(x_0,f(x_0)\right)$处的切线的斜率为$f\left(2\right)-f\left(1\right)$;
\part 比较$f(1.01)$与$-2.01$的大小，并加以证明.
\end{parts}
\kongbai
\qs 已知函数$f(x)=e^{ax}\cdot \sin x-1$，其中$a>0$.
\begin{parts}
\part 当$a=1$时，求曲线$y=f(x)$在点$\left(0,f(0)\right)$处的切线方程；
\part 证明：$f(x)$在区间$\left[0,\pi\right]$上恰有$2$个零点.
\end{parts}
\newpage
\qs 已知函数$f(x)=\dfrac{\ln\left(x-a\right)}{x}$.
\begin{parts}
\part 若$a=1$，确定函数$f(x)$的零点；
\part 若$a=-1$，证明：函数$f(x)$是$\left(0,+\infty\right)$上的减函数；
\part 若曲线$y=f(x)$在点$\left(1,f(1)\right)$处的切线与直线$x-y=0$平行，求$a$的值.
\end{parts}
\kb
\qs 已知函数$f(x)=\left(x-1 \right)e^x+ax^2$.
\begin{parts}
\part 求曲线$y=f(x)$在点$\left(0,f(0)\right)$处的切线方程；
\part 求证：“$a<0$”是“函数$f(x)$有且仅有一个零点”的充分不必要条件.
\end{parts}

\end{questions}
\end{document}

Ijon Tichy
Posts: 233
Joined: Mon Dec 24, 2018 10:12 am
Currently you are throwing topics without explanation. If you want information about bhcexam, please explicitly ask for them. If you want general information about how to typeset exams etc. see my package link in my previous post. It also contains a link to the manual and a topic link that directs to a page with lots of alternatives.

Note also, typesetting CJK languages is different from typesetting European languages. So if you require to typeset CJK you should always tell us. Same if someone need to typeset right-to-left languages like Hebrew. I do not know much about typesetting CJK languages, so I leave this thread now.

lyj_aizj
Posts: 5
Joined: Wed Mar 25, 2020 8:23 am
thank you very much