2

I'm trying to produce a set of questions and answers. I want the question's label and text to start on the same line, but have the text slightly indented. I then want subsequent lines of the text to be indented by the same amount.

I initially used the changepage package as advised in this post:

\textbf{(a)} \begin{adjustwidth}{1cm}{1cm}A coin is flipped 1000 times at the result is a 70/30 split between heads and tales, respectively.  What could possibly have contributed toward this result, without referencing the supernatural?
\end{adjustwidth}

However the result is that 'A coin...' begins on a new line after (a).

I made a second attempt using the advise around \par, given on this post, but it produces the same result as just allowing the text to jump to a new line.

Finally, I defined a new environment that uses a list with \setlength to define the indent (modified the instructions given here). But again, because it's using a list the question text is bumped onto a new line.

Ultimately, what I want is for (a) and 'A coin is...' to start on the same line, and for the text on the second line to be in line with 'A coin is...' on the line above.

I feel like I'm 90% of the way to figuring it out, but I'm tired and have run out of oranges. Any help is much appreciated.

2

Is this how you want to do it?

enter image description here

Perhaps what you need is an enumerate environment. Here is an example of a minimal working example (MWE) that shows my point. (Notice that this is a minimal compilable code that illustrates my point about the use of the enumerate environment. You can construct similar MWE in future posts.)

\documentclass{article}
\usepackage[showframe]{geometry}
\usepackage{enumitem}
\begin{document}
This is a reference paragraph.
\begin{enumerate}[label=\textbf{\alph*},ref=\alph*,leftmargin=5em]
\item A coin is flipped 1000 times at the result is a 70/30 split between heads and tales, respectively.  What could possibly have contributed toward this result, without referencing the supernatural?

Here is a new line in the same item.
\end{enumerate}
\end{document}

The showframe option of the geometry package was just used here to show the frames.

  • Why do you use the changepage package and adjustwidth? With the options provided by enumitem you can adjust the margins without additional packages. – Gonzalo Medina Jul 20 '13 at 16:41
  • Hellow, @GonzaloMedina. Thank you for your comment. I fixed my answer to show how it can be done with only the enumitem package. – hpesoj626 Jul 20 '13 at 17:11
  • I'd use label=\textbf{\alph*},ref=\alph* instead of \textbf{(a)} – egreg Jul 20 '13 at 18:10
  • @hpesoj626 - Bingo. Works a treat, and I don't need changepage! (Thanks @Gonzalo!) – dr_faulk Jul 20 '13 at 20:47
  • @egreg, done. I also removed the shortlabels option from enumitem as there is no longer need for it with the change. Thanks. – hpesoj626 Jul 20 '13 at 23:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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