Tell me more ×
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 preparing a Q&A document. I created the image below in MS Word. I was wondering if there is a way this can be accomplished in LaTeX. I want to keep formatting consistent through out the document.

Is there such a template available? If not then how can i create my own templates/ environments

Q&A

share|improve this question
There are only one answer per question is it? Should the first words be bold like shown? – Martin Scharrer May 3 '12 at 15:23
Yes there is only one answer per question. If there are more than one answers then it would be displayed starting on a new line. Bold would be nice, increases readability. – Raama May 3 '12 at 15:29

1 Answer

up vote 8 down vote accepted

For something simple like you specified I would go for two simple definitions, \Que and \Ans. For more complicated formatting and features check the answers package.

\documentclass{article}
\usepackage{lipsum}
\newcounter{question}
\setcounter{question}{0}
\begin{document}

\newcommand\Que[1]{%
   \leavevmode\par
   \stepcounter{question}
   \noindent
   \thequestion. Q --- #1\par}

\newcommand\Ans[2][]{%
    \leavevmode\par\noindent
   {\leftskip37pt
    A. --- \textbf{#1} #2\par}}

\Que{Here first question would come}
\Ans{\lipsum[1]\lipsum[1]}

\Que{Here first question would come}
\Ans{\lipsum[1]\lipsum[1]}
\end{document}
share|improve this answer
thanks a lot for your help – Raama May 3 '12 at 18:07

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.