I am trying to have a fill in the blank paragraph inside of a box. I've been using mdframed with great success, but the underline blank doesn't wrap inside of the box. I'm newer to Latex; I've tried using the mdframed documentation and tried Why does underlined text not get wrapped once it hits the end of a line ? and Underlined blank that wraps (the latter being pretty complex for my abilities right now). Thank you for your help!
\documentclass{article}
\usepackage{mdframed}
\newcommand{\hard}[1] {\unskip\underline{\hspace{#1}}\ignorespaces}
\begin{document}
\begin{mdframed}
The population in a study refers to the \hard{2in} \\or \hard{2.5in}. A sample is a (typically small) \hard{2in} from whom or about which data are gathered to learn about \hard{2in}. If the sample is selected carefully, so it is \hard{1.5in} of (\hard{2in}) the population, you can learn \hard{2in}. The number of observational units studied in a sample is the \hard{1in}.
\end{mdframed}
\end{document}
tcolorboxinstead ofmdframed, however. If I remember correctly,\underlinecan't wrap. Try\underline{A very long long long long long long long long long long long long long long long long long long line}for example. It should leak into the right margin for your textwidth settings – Sep 08 '17 at 19:39\unskipshifts the line too much to the left, in my point of view – Sep 08 '17 at 19:45tcolorboxenvironment does always use the\linewidth(which is the\textwidthusually in a normal page), unless some explicitwidthstatement is used. In my opinion,tcolorboxis the more powerful package. Try\begin{tcolorbox}[enhanced,sharp corners,boxsep=0pt] ... \end{tcolorbox}– Sep 08 '17 at 20:08