## LaTeX forum ⇒ Text Formatting ⇒ Reducing some text width in exam class

Information and discussion about LaTeX's general text formatting features (e.g. bold, italic, enumerations, ...)
Cham
Posts: 896
Joined: Sat Apr 02, 2011 4:06 pm

### Reducing some text width in exam class

Stefan, I need some opinion on this solution. Adding \vspace{-1ex} gives some nice output, but I'm not even sure to understand what I'm doing here!

\documentclass[11pt]{exam}\begin{document}\begin{questions}\question[10] Some true or false questions to answer very quickly, without thinking : \medskip \begin{parts}	\part \parbox[t]{0.8\textwidth}{Is it true that this sentence is false ?} 	\vspace{-1ex}\hfill\makebox[0.5in]{\dotfill}%	\smallskip	\part \parbox[t]{0.8\textwidth}{Your name is the same as what it was ten thousands of years ago.} 	\vspace{-1ex}\hfill\makebox[0.5in]{\dotfill}%	\smallskip	\part \parbox[t]{0.8\textwidth}{This is a long, very long and boring sentence that means absolutely nothing, and is here to amuse you.} 	\vspace{-1ex}\hfill\makebox[0.5in]{\dotfill}%	\smallskip	\part \parbox[t]{0.8\textwidth}{This is a true-false question which doesn't have any true or false answer, just to annoy you like hell.  Failing this kind of exam is fun!} 	\vspace{-1ex}\hfill\makebox[0.5in]{\dotfill}%\end{parts} \end{questions}\end{document}

Stefan Kottwitz
Posts: 9313
Joined: Mon Mar 10, 2008 9:44 pm
Here's a way: it puts a parbox with the needed height, and the dots in the last line:


Stefam

Cham
Posts: 896
Joined: Sat Apr 02, 2011 4:06 pm
That's a bit complicated for my taste. How to achieve a similar result, manually (without using a macro)?

Or how to change the \vspace{-1ex} that I used above, so the answer line is well aligned with the last line of text?

Stefan Kottwitz
Posts: 9313
Joined: Mon Mar 10, 2008 9:44 pm
I used the macro to simplify things in the document itself. In the text, it looks pretty clear.

Stefan

Cham
Posts: 896
Joined: Sat Apr 02, 2011 4:06 pm
Well, I would like to know how to do the same manually, without the macros. It's not clear to me how the macro is working. And in some cases, I may even have some longer text (that would be very rare, though).

Or in other words : how can I change my use of \vspace{-1ex} so the answer line is properly aligned with the last line of text?