# How can I create a Question/Answer format for reports?

I would like to create a question/answer format to use on lab reports. What I would like to achieve is something like this:

a. This is the first question (in bold)?

This is the answer (it is indented and regular text).

b. This is the second question (bold)?

This is the answer (indented and regular text).

I have no idea where to start. Thank you very much for your help!

• Welcome to TeX.sx! Do you know the document class exam? – Mensch Dec 28 '12 at 17:33
• Hey! I know this document class but I was wondering if there was some good way of doing this on the document class article. – Lynx Dec 28 '12 at 17:42
• – cmhughes Dec 29 '12 at 1:07

I would define an enumerate list and create an answer environment: consider the following:

\documentclass{article}
\usepackage{enumitem}
\newenvironment{QandA}{\begin{enumerate}[label=\bfseries\alph*.]\bfseries}
{\end{enumerate}}
\usepackage{lipsum}
\pagestyle{empty}
\begin{document}

\noindent%
\lipsum[1]
\begin{QandA}
\item question one

\item question two
\lipsum[3]
\end{QandA}
\lipsum[4]
\end{document}


This gives you some flexibility in terms of how you format the questions and how you format the answers. Notice that I kind of sledgehammer the bold font. To counteract this, I call \normalfont inside the answered environment.

The enumitem package gives you a lot of room for controlling margins.
To get further indentation on both the left and right margins, you can write

\newenvironment{QandA}{\begin{enumerate}[label=\bfseries\alph*.,leftmargin=2em,rightmargin=2em]\bfseries}
{\end{enumerate}}


If you want a paragraph indent at the beginning of the answer, then rewrite the answered environment to be:

\newenvironment{answered}{\setlength{\parindent}{1em}\par\normalfont}{}


If you play with these suggestions, you'll find you have a lot of control over the look and feel of the answered environment.

By adding these changes to the MWE, you'll get something like:

• Awesome! I tested this and works flawlessly!, I have another question... is there a possible way of indenting inside the answers? – Lynx Dec 29 '12 at 1:22
• If you could explain what you mean by indenting, I'd be happy to do so. Lest you think I'm being snarky, I'm asking for clarification since within the enumerate environment paragraphs are usually already indented. – A.Ellett Dec 29 '12 at 1:33
• Dont worry! What I mean by indenting is that the first line of every answer paragraph is indented. I know the paragraph is already indented but I was wondering if the first line can have 2 indentations. Thank you very much for the help! – Lynx Dec 29 '12 at 1:41