如何在 Overleaf 中绘制水平线

如何在 Overleaf 中绘制水平线

我正在使用 overleaf 来制作这张工作表,但无法获得正确的间距。

这是我要去的地方的照片。在此处输入图片描述

这是我目前的代码!

\documentclass{exam}

\usepackage[a4paper, total={7in, 10in}]{geometry}

\usepackage{setspace}
\doublespacing

\begin{flushright}
\textbf{Name: }\rule{4cm}{0.2mm}
\end{flushright}

% \begin{flushright}
% \textbf{Marks }\rule{1.5cm}{0.2mm}/ 10
% \end{flushright}

\begin{center}
{\Large \textbf{Quiz}}
\end{center}

\begin{questions}

\question Solve each of the following for $x$. \

\begin{parts}

\begin{multicols}{2}
\part $(2-x)(x-3) > 0$ 
\vspace{0.75cm}
\hline\\
\vspace{1cm}
\hline\\
\vspace{1cm}
\hline\\
\vspace{1cm}
\hline\\
\vspace{1cm}

\part $x^2 -4x +3 = 0$

\end{multicols}

\end{parts}

答案1

考试类别以自己的方式做很多事情,并且往往与几何和集合空间等包不兼容。

我还用 paracol 替换了 multicol。两者都可以,但使用 paracol 更容易从左到右、从上到下对齐。

\documentclass[a4paper]{exam}
\extrawidth{1in}% default is 1in margins on all sides
\extraheadheight{0.5in}
\extrafootheight{0.5in}
\setlength\linefillheight{1cm}

\usepackage{paracol}
\globalcounter*

\begin{document}

\hspace*{\fill}\begin{tabular}{l@{}}
  {\textbf{Name: }\rule{4cm}{0.2mm}}\\[0.75cm]
  {\textbf{Marks }\rule{1.5cm}{0.2mm}/20}
\end{tabular}

\begin{center}
{\Large \textbf{Quiz}}
\end{center}

\begin{questions}

\question Solve each of the following for $x$. \

\begin{paracol}{2}
\begin{parts}
\part $(2-x)(x-3) > 0$
\fillwithlines{4cm}

\switchcolumn
\part $x^2 -4x +3 = 0$
\fillwithlines{4cm}
\end{parts}
\end{paracol}
\end{questions}
\end{document}

答案2

对 John Kormylo 的回答有一些补充:

\documentclass[a4paper]{exam}

\extrawidth{1in}% default is 1in margins on all sides
\extraheadheight{0.5in}
\extrafootheight{0.5in}
\setlength\linefillheight{1cm}

\usepackage{paracol,tikz}
\globalcounter*

\begin{document}
    
    \hfill{\textbf{Name: }\rule{4.5cm}{0.2mm}}\\
    
    \hfill \textbf{Marks: \hspace{30pt} /20}
    
\begin{center}
        {\Large \textbf{Quiz}}
    \end{center}
    
    \begin{questions}
        
        \question Solve each of the following for $x$. 
        
        \begin{paracol}{2}
            \begin{parts}
                \part $x^2 -4x +3 = 0$
                \fillwithlines{4.5cm}
                \hfil Marks: \hspace{15pt} /2
                \switchcolumn 
                \part $2x^2 -4x -3 = 0$
                \fillwithlines{4.5cm}
                \hfil  Marks: \hspace{15pt} /2
            \end{parts}
        \end{paracol}
        \question Solve each of the following for $x$. 
        
        \begin{paracol}{2}
            \begin{parts}
                \part $(2-x)(x-3) > 0$
                \fillwithlines{4.5cm}
                \hfil Marks: \hspace{15pt} /2
                \switchcolumn
                \part $(3-x)(x-3) > 0$
                \fillwithlines{4.5cm}
                \hfil Marks: \hspace{15pt} /2
            \end{parts}
        \end{paracol}
        \question Plot the following functions
        \begin{paracol}{2}
            \begin{parts}
                \part $y=2x+3$
                
                \begin{tikzpicture}[scale=.5]
                    \draw[gray!20,dashed] (-4,-4) grid (4,4);
                    \draw[-latex] (-4.2,0)--(4.3,0) node[right] () {\footnotesize $x$};
                    \foreach \i in {-4,...,-1,1,2,...,4}
                    \draw (\i,-0)--(\i,-0.1) node[below] () {\footnotesize \i};
                    \draw[-latex] (0,-4.2)--(0,4.3) node[above] () {\footnotesize $y$};
                    \foreach \i in {-4,...,-1,1,2,...,4}
                    \draw (0,\i)--(-.1,\i) node[left] () {\footnotesize \i};
                    \draw (-.2,-.2) node () {\footnotesize $O$};        
                \end{tikzpicture}
            
                \hfil Marks: \hspace{15pt} /3
                \switchcolumn
                \part $y=-\frac{1}{4}x^2+1$
                
                \begin{tikzpicture}[scale=.5]
                    \draw[gray!20,dashed] (-4,-4) grid (4,4);
                    \draw[-latex] (-4.2,0)--(4.3,0) node[right] () {\footnotesize $x$};
                    \foreach \i in {-4,...,-1,1,2,...,4}
                    \draw (\i,-0)--(\i,-0.1) node[below] () {\footnotesize \i};
                    \draw[-latex] (0,-4.2)--(0,4.3) node[above] () {\footnotesize $y$};
                    \foreach \i in {-4,...,-1,1,2,...,4}
                    \draw (0,\i)--(-.1,\i) node[left] () {\footnotesize \i};
                    \draw (-.2,-.2) node () {\footnotesize $O$};        
                \end{tikzpicture}
            
                \hfil  Marks: \hspace{15pt} /3
            \end{parts}
        \end{paracol}
    \end{questions}
\end{document}

输出:

在此处输入图片描述

相关内容