# a line after text?

I am not aware of having a text with a colon and a line as a command. Is this possible? I am using the exam document class so I can use the \question command for the proper numbering.

example:

 \documentclass{exam}
\begin{document}
\begin{questions}
\question{Good} \oolonline
\question{happy} \colonline
\question{nervous} \colonline
\question{angry} \colonline
\end{questions}

\end{document}


and it will appear like this:

-
It looks like the colons are supposed to be aligned, except when the word on the left is too long. Is that what you have in mind? –  Charles Staats Dec 11 '12 at 16:19
Is this what you are looking for: \newcommand{\colonline}[1]{\question{#1\,:\rule{75pt}{0.4pt}}} –  azetina Dec 11 '12 at 16:34

Using the exam class, you can have the following:

\documentclass{exam}
\usepackage{multicol}
\newcommand{\colonline}[1]{\question{#1\,:\rule{75pt}{0.4pt}}}
\begin{document}
\begin{multicols}{2}
\begin{questions}
\colonline{Good}
\colonline{Happy}
\colonline{Nervous}
\colonline{Good}
\colonline{Happy}
\colonline{Nervous}
\colonline{Good}
\colonline{Happy}
\colonline{Nervous}
\colonline{Good}
\colonline{Happy}
\colonline{Nervous}
\colonline{Good}
\colonline{Happy}
\colonline{Nervous}
\colonline{Good}
\colonline{Happy}
\colonline{Nervous}
\colonline{Good}
\colonline{Happy}
\colonline{Nervous}
\end{questions}
\end{multicols}
\end{document}


You can use the multicol package to split the questions in two columns if there are more than 30 questions. If you want it in a command like format, you can use:

\newcommand{\synquestions}[2][2]{%
\begin{multicols}{#1}
\begin{questions}
#2
\end{questions}
\end{multicols}
}


and implement it like this:

\synquestions{%
\colonline{Good}
\colonline{Happy}
\colonline{Nervous}
}

-
If the number of question for example is 30 numbers no longer fil for one page, how would it be let to second column instead? –  Kayla Dec 11 '12 at 17:17
@kayla see my updated answer. –  azetina Dec 11 '12 at 18:32

Something like that?

\documentclass{exam}

\usepackage{tikz}
\newcommand{\colonline}[1][2cm]{: \tikz[baseline={([yshift=0.3ex]current bounding box.center)}]{\draw (0,0) -- (#1,0);}}

\begin{document}

\begin{questions}
\question{Good} \colonline
\question{happy} \colonline
\question{nervous} \colonline
\question{angry} \colonline
\end{questions}

\end{document}


Edit : For the follow-up question you asked in comment, you can use an alternative questions environment defined with help of the multicol package.

\documentclass{exam}

\usepackage{tikz}
\newcommand{\colonline}[1][2cm]{: \tikz[baseline={([yshift=0.3ex]current bounding box.center)}]{\draw (0,0) -- (#1,0);}}

\usepackage{multicol}

\newenvironment{manyquestions}{\begin{multicols}{2}\begin{questions}}{\end{questions}\end{multicols}}

\begin{document}

\begin{manyquestions}
\question{Good} \colonline
\question{happy} \colonline
\question{nervous} \colonline
\question{angry} \colonline
\question{Good} \colonline
\question{happy} \colonline
\question{nervous} \colonline
\question{angry} \colonline
\question{Good} \colonline
\question{happy} \colonline
\question{nervous} \colonline
\question{angry} \colonline
\question{Good} \colonline
\question{happy} \colonline
\question{nervous} \colonline
\question{angry} \colonline
\question{Good} \colonline
\question{happy} \colonline
\question{nervous} \colonline
\question{angry} \colonline
\question{Good} \colonline
\question{happy} \colonline
\question{nervous} \colonline
\question{angry} \colonline
\question{Good} \colonline
\question{happy} \colonline
\question{nervous} \colonline
\question{angry} \colonline
\question{Good} \colonline
\question{happy} \colonline
\question{nervous} \colonline
\question{angry} \colonline
\question{Good} \colonline
\question{happy} \colonline
\question{nervous} \colonline
\question{angry} \colonline
\end{manyquestions}

\end{document}

-
@Verron: how would I let this one lane proceed to a new column to prevent its continuation to the next page? example the question goes up to 30 plus number of question. for it to not proceed to the next page, how will I make this proceed to 2nd column? –  Kayla Dec 11 '12 at 17:07
@kayla : I editted to include a solution. However, such follow-up questions should be asked as a separate question, to maintain a clear Q/A interface for the site. –  T. Verron Dec 11 '12 at 17:45

Something simpler if you are not after the alignment of the \colonlines

\documentclass{exam}

\newcommand{\colonline}{: \makebox[0.75in]{\hrulefill}}

\begin{document}

\begin{questions}
\question{Good} \colonline
\question{happy} \colonline
\question{nervous} \colonline
\question{angry} \colonline
\end{questions}

\end{document}


As suggested by morbusg, it looks nicer to have the line align at the end.

\documentclass[twocolumn]{exam}

\newcommand{\colonline}{: \hrulefill}

\begin{document}

\begin{questions}
\question{Good} \colonline
\question{happy} \colonline
\question{nervous} \colonline
\question{angry} \colonline
\end{questions}

\end{document}


You can combine the answers here to come up with your own command. Generally, the definition of commands in LaTeX is given by:

\newcommand{<command>}{<definition>}

In our second definition of \colonline, \colonline is the command and what it does is to print : \hrulefill.

Sometimes, you can also see something like


It would be a good place to start reading The Not So Short Introduction to LaTeX2e to learn some of these useful tricks.

-
Maybe it would be nice to even go one step further and drop the makebox, leaving just the \hrulefill so it uses the whole horizontal space, thus aligning at end; used with two columns should work well overall. –  morbusg Dec 11 '12 at 19:43