3

i am working with a simple question but i can't include underline before the \question.

Code

documentclass{myclass}

\newcommand{\line}{\begin{tabular}{p{2cm}}
\\[-.35em]
\hline
\end{tabular}
 }

 \begin{questions}
 \question What is the color of your shirt? \line

\end{questions}

Output:

  1. What is the color of your shirt? __

    but i'm trying to make something like this by:

Output:

__ 1.What is the color of your shirt?

How can I create this?

3
  • The answer probably depends greatly on what the myclass class is--in particular, on the definition of the questions environment. Oct 24, 2012 at 11:12
  • That's not a minimal working example (MWE). In addition to the unknown document class, you're missing the \begin{document} ... \end{document}. Oct 24, 2012 at 11:22
  • @Kayla: Please post your TeX/LaTeX/etc. related questions here, on the main site! TeX - LaTeX Meta, however, is intended for questions about the main site, e.g. if you don't know how to accept an answer, if your reputation seems odd, or if you would like to discuss the reasons for a question being closed.
    – doncherry
    Oct 24, 2012 at 17:53

2 Answers 2

7

Assuming the questions environment is that of the exam class: Redefine \questionlabel.

\documentclass{exam}

\renewcommand{\questionlabel}{\rule{1cm}{0.4pt}\thequestion.}

\begin{document}

\begin{questions}
\question\label{q:test} What is the color of your shirt? 
\end{questions}

See question~\ref{q:test}.

\end{document}

enter image description here

1
  • redefining the command indid make it. Thank You so much!
    – Kayla
    Oct 30, 2012 at 0:00
2

like spaces, drawn rules (e.g. \hline) get ignored at the beginning of a line, so you need to put a "stopper" in front if you want it to be output. add \leavevmode before \hdline.

You must log in to answer this question.

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