4

I am preparing a document that has some questions with boxes for answering? It's should look like this: (red marks indicates indentation/alignment)

![enter image description here

I have created this instead which needs improvement. I tried to use a table but tables have some left side indentation that is not desired. How can I do the exact figure with proper alignment?

\documentclass{article}

\begin{document}

\noindent Here is the question: The question is long enough in 2/3 sentences with a stem. The stem describes a scenario.

\noindent Here is the fill in the blank or box for answering. \hfill Total \fbox{\phantom{text}} types

\noindent The option box or fill in the blank may contain multiple lines but it should be the same length as the previous one. No m- atter how long the question, length must be the same. \hfill Total \fbox{\phantom{text}} fruits

\end{document}

CarLaTeX
  • 62,716
mmr
  • 2,249
  • 5
  • 22

1 Answers1

4

Try using a [t]op-aligned \parbox:

enter image description here

\documentclass{article}

\begin{document}

\noindent Here is the question: The question is long enough in 2/3 sentences with a stem. The stem describes a scenario.

\bigskip

\noindent \parbox[t]{.6667\linewidth}{\strut Here is the fill in the blank or box for answering.} \hfill Total \fbox{\phantom{text}} types

\medskip

\noindent \parbox[t]{.6667\linewidth}{\strut The option box or fill in the blank may contain multiple lines but it should be the same length as the previous one. No matter how long the question, length must be the same.} \hfill Total \fbox{\phantom{text}} fruits

\end{document}

If you consistently have no paragraph indentation, you might as well \setlength{\parindent}{0pt} and drop the use of \noindent.

You can achieve a similar result/output using tabular in this way:

\documentclass{article}

\usepackage{array}

\begin{document}

\noindent Here is the question: The question is long enough in 2/3 sentences with a stem. The stem describes a scenario.

\bigskip

\noindent \begin{tabular}{@{} p{.6667\linewidth} @{} >{\raggedleft\arraybackslash} p{.3333\linewidth} @{}} Here is the fill in the blank or box for answering. & Total \fbox{\phantom{text}} types \[\medskipamount] The option box or fill in the blank may contain multiple lines but it should be the same length as the previous one. No matter how long the question, length must be the same. & Total \fbox{\phantom{text}} fruits \end{tabular}

\end{document}

Werner
  • 603,163