[Tex/LaTex] Q&A Template in LaTeX

environmentstemplates

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

Best Answer

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}