3

I'm trying to create a document with exercies and solutions. Since exercises often come in different parts (such as (a), (b) and so on), I want to use lists for the solutions. However, solutions are often complicated and need some formatting to be well understable. Therefore I need a list environment with flexible formatting such as stetting different paragraphs within an item.

I am using enumitem, but the inline list environment enumerate* doesn't accept paragraphs and seems to cause other minor problems. What alternatives do I have?

Here is a piece of code:

\begin{solution}
  \begin{enumerate*}[label=(\alph*)]
    \item {Text with, separated by an empty line

    to set a new paragraph}
  \end{enumerate*}
\end{solution}

An this is the output I get:

no paragraph is set

Here is a full minimal example:

\documentclass{scrreprt}

\PassOptionsToPackage{amsmath,thmmarks,thref}{ntheorem}
\PassOptionsToPackage{inline}{enumitem}

\usepackage{amsmath,MnSymbol}   
\usepackage{ntheorem,thmtools}
\usepackage{
    enumitem,
}

\declaretheoremstyle{plain}
\declaretheorem[style=plain,numbered=no,name=Proof]{proof}

\begin{document}

\begin{proof}
  \begin{enumerate*}[label=(\alph*),mode=unboxed]

    \item {A text

      separated by an empty line}
  \end{enumerate*}
\end{proof}

\end{document}

Again, here is my output:

no inserted paragraph

  • Does it have to be an inline list? The standard enumerate would allow paragraph breaks within items. IMHO it does not make sense to have paragraph breaks in an inline list. – clemens Nov 7 '12 at 21:14
  • @cgnieder I think you're right. Maybe I just want to refer to the listed questions instead of answering them in a listed environment. I'll take council with my pillow. – k.stm Nov 7 '12 at 21:20
  • Referring should be pretty straight forward using \label and \ref... – clemens Nov 7 '12 at 21:23
2

I am not sure of I understand your question correctly. Using the series concept (refer to the package documentation for further details) you can use a standard enumerate environment when you need paragraphs and then enumerate* when you want an in-line enumeration, but using resume=<series-name> to keep the numbering consistent:

\documentclass{scrreprt}

\PassOptionsToPackage{amsmath,thmmarks,thref}{ntheorem}
\PassOptionsToPackage{inline}{enumitem}

\usepackage{amsmath,MnSymbol}   
\usepackage{ntheorem,thmtools}
\usepackage{enumitem}

\declaretheoremstyle{plain}
\declaretheorem[style=plain,numbered=no,name=Proof]{proof}

\begin{document}

\begin{proof}
  \begin{enumerate}[series=a,label=(\alph*),mode=unboxed]
    \item A text

      separated by an empty line
  \end{enumerate}
  \begin{enumerate*}[resume=a,label=(\alph*),mode=unboxed]
    \item A text
    \item A text
  \end{enumerate*}
\end{proof}

\end{document}

enter image description here

  • This is good and helps. But I dislike the indent and margin which comes from not using the inline environment. Is there a way to solve this, too? ("separated" should begin at the same indent as "(b)" in the line below. – k.stm Nov 3 '12 at 23:07
1

Since you asked for alternatives, it works with plain TeX's \item:

\item{1.} {Text with, separated by an empty line

    to set a new paragraph}

\bye
  • Yeah, great. TeX. – k.stm Nov 3 '12 at 19:36

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.