# Q&A Template in LaTeX

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

• There are only one answer per question is it? Should the first words be bold like shown? May 3, 2012 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. May 3, 2012 at 15:29

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 second question would come}
\Ans{\lipsum[1]\lipsum[1]}
\end{document}

• Thank you for this template. Two thoughts about it: 1) maybe it's better to remove the dot after A for consistency; 2) maybe it's better to change \textbf{#1} #2\par to \textbf{#1}#2\par. This will make sure that the space after the long dash is the same as in the question part. Dec 27, 2013 at 15:01
• @Exeleration-G Both are good suggestions and there is also more improvements one could add. I just wanted to illustrate that it is fairly easy to build macros for such tasks, rather than spending time to learn the ins and outs of one of the larger packages. Please feel free to edit and improve. Dec 27, 2013 at 15:42