1

I'd like the line under the quesion to go fron the left to the right by adding "something"in the qformat line

\documentclass[a4paper,addpoints,12pt,answers]{exam} 
\qformat{\textbf{Oefening \thequestion}. \hrulefill \thepoints}

\begin{document}
\begin{questions}
\question [5]
\end{questions}

\end{document}

but this gives (obviously), so no complete line. How can i add it? enter image description here

3 Answers 3

1

While \underline does not work, \uline from the ulem package seems ok.

\documentclass[a4paper,addpoints,12pt,answers]{exam}
\usepackage[normalem]{ulem}
\qformat{\uline{\textbf{Oefening \thequestion}. \hfill \thepoints}}
\begin{document}
\begin{questions}
\question [5]
Een trace heeft een weerstand van $0,050\Omega$. Bepaal de spanningsval en het vermogensverlies bij een omgevingstemperatuur van 25\textdegree C.
\end{questions}

\end{document}

enter image description here

1

You can also use \llap at the end of the line.

\documentclass[a4paper,addpoints,12pt,answers]{exam} 
\qformat{\textbf{Oefening \thequestion}. \hfill\thepoints\llap{\rule[-\dp\strutbox]{\textwidth}{0.4pt}}}

\begin{document}
\begin{questions}
\question [5]
\end{questions}

\end{document}
0

If you look into exam.cls you'l see it varies formats of output a lot, depending on context, options etc.

This sometimes gives surprising results. E.g. the natural approach to wrap everything into a \underline{} makes the line "collapse".

So this one collapses:

\qformat{\underline{\textbf{Oefening \thequestion}. \hfill {\thepoints}}}

while this one is just fine (without any extra rules)

\qformat{\textbf{Oefening \thequestion}. \hfill {\thepoints}}

So, it's probably better to change your layout wish. E.g. this one is easy to do, where, just another surprise, it doesn't matter where you put the \hrule:

\documentclass[a4paper,addpoints,12pt,answers]{exam} 

\begin{document}
\qformat{\textbf{Oefening \thequestion}. \hfill {\thepoints}}
 \begin{questions}
    \question  [5]\hrule
    sadf sd jsdfa j
     
    \hrule\question  [7]
     sdj sdjksad f
 \end{questions}

\end{document}

result

You must log in to answer this question.

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