0

I am writing an exam and I'm having some spacing issues with creating answer lines/rules between items in enumerate. If I use \vfill\hfill in between the items, sometimes it does not print the answer line write above the next item but instead pushes the answer line to the right in the middle of the items. Here's some sample code,

\documentclass[12pt]{extarticle}
\usepackage[margin=1in]{geometry}
\usepackage{enumitem,amsmath,amsfonts,amssymb}

\begin{document}

\begin{enumerate}[label=\bf (\alph*.),itemsep=64pt,topsep=4pt]
\item \textbf{[6 points]} Find the parameters $A, B, C$ in \textbf{exact form}.

\vfill\hfill $A = $ \rule[-0.75em]{4cm}{1.15pt} \quad $B = $\rule[-0.75em]{4cm}{1.15pt} \quad $C = $ \rule[-0.75em]{4cm}{1.15pt}

\item \textbf{[4 points]} Using the derivative of $g(z)$ and the values you found for $A,B,C$ in part (a.), determine the equation for the tangent line $T(z)$ of $g(z)$ at $z = 4$.
\end{enumerate}

\end{document}

which produces this enter image description here

I want the answer lines for A, B, and C to be right above the second item. Using \vspace, \hspace, or \vspace*{\fill}, etc. produced the same results. Any suggestions?

P.S. As I was typing this post, I learned from other questions that there is an exam documentclass package which I did not know about (first time writing an exam!), so maybe this would help this situation, but it's a bit too late for me to figure out exam documentclass and redo the LaTeX code now.

2
  • [itemsep=64pt] ? That is a pretty big gap! Commented Jul 25, 2023 at 12:41
  • @JohnKormylo Haha, yeah. One of those parameters takes a bit of work to find.
    – CyCeez
    Commented Jul 25, 2023 at 13:03

1 Answer 1

0

Instead of using itemsep=64pt you can insert an empty box with the desired height.

enter image description here

\documentclass[12pt]{extarticle}
\usepackage[margin=1in]{geometry}
\usepackage{enumitem,amsmath,amsfonts,amssymb}

\begin{document}
    
    \begin{enumerate}[label=\bf (\alph*.),itemsep=8pt,topsep=4pt] %changed <<<<<<<<<<
        \item \textbf{[6 points]} Find the parameters $A, B, C$ in \textbf{exact form}.
        
        \makebox(0,64){}    %added <<<<<<<<<<   
     
     $A = $ \rule[-0.75em]{4cm}{1.15pt} \quad $B = $\rule[-0.75em]{4cm}{1.15pt} \quad $C = $ \rule[-0.75em]{4cm}{1.15pt}

        \item \textbf{[4 points]} Using the derivative of $g(z)$ and the values you found for $A,B,C$ in part (a.), determine the equation for the tangent line $T(z)$ of $g(z)$ at $z = 4$.
    \end{enumerate}
    
\end{document}

From building boxes

\makebox(<x>,<y>){<text>}

builds a box of width <x> multiples of \unitlength (default 1pt) and height <y> multiples of \unitlength (so <x> and <y> can be decimal numbers, but not dimensions).

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .