Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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?

share|improve this question

migrated from meta.tex.stackexchange.com Oct 24 '12 at 11:07

This question came from our discussion, support, and feature requests site for users of TeX, LaTeX, ConTeXt, and related typesetting systems.

    
The answer probably depends greatly on what the myclass class is--in particular, on the definition of the questions environment. –  Andrew Uzzell Oct 24 '12 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}. –  Loop Space Oct 24 '12 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 '12 at 17:53

2 Answers 2

up vote 7 down vote accepted

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

share|improve this answer
    
redefining the command indid make it. Thank You so much! –  Kayla Oct 30 '12 at 0:00

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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.