枚举而不换行

枚举而不换行
% oblivoir is for korean characters
\documentclass{oblivoir}
% oblivoir contains enumerate package
% \usepackage{enumerate}

\begin{document}

\paragraph{Q: }
\begin{enumerate}[(a)]
\item Lorem ipsum dolor sit amet, consectetur adipiscing elit.
    Praesent ornare purus augue, ac consequat magna viverra vel.
    Donec auctor tortor vel aliquam tempus.
\item Praesent faucibus rutrum massa, iaculis vulputate risus faucibus a.
    Duis vel rhoncus ante.
    Quisque feugiat mattis turpis, in ultrices ipsum luctus ut.
    Sed volutpat id justo eget cursus.
\end{enumerate}

\end{document}

如果我运行上述代码,您将得到类似这样的结果。Enumerate 以换行符开始。

Q:
(a) blah blah blah..
    And the text is indented blah blah...
(b) blah blah blah
    Also this one is indented blah blah...

我想在段落旁边进行枚举,如下所示:

Q:  (a) blah blah blah..
        And the text is indented blah blah...
    (b) blah blah blah..
        Also this one is indented blah blah...

或者至少像这样:

Q:  (a) blah blah blah..
        And the text is indented blah blah...
(b) blah blah blah..
    Also this one is indented blah blah...

不幸的是,enumitem带有选项的包inline和使用enumerate*带有选项的环境itemjoin = \newline不是一个解决方案,因为它不会缩进文本。

Q:  (a) blah blah blah..
And the text is NOT indented blah blah...
(b) blah blah blah..
Also this one is NOT indented blah blah...

答案1

这更像是一种变通方法,而不是真正的解决方案,但如果您确实不需要\paragraph,您可以将“Q:”放在第一个项目里面。

\documentclass{oblivoir}
\newcommand*{\firstitem}{%
    \refstepcounter{enumi}%
    \item[\textbf{Q:} (\theenumi)]%
}
\begin{document}

\begin{enumerate}[(a)]
\firstitem Lorem ipsum dolor sit amet, consectetur adipiscing elit.
    Praesent ornare purus augue, ac consequat magna viverra vel.
    Donec auctor tortor vel aliquam tempus.
\item Praesent faucibus rutrum massa, iaculis vulputate risus faucibus a.
    Duis vel rhoncus ante.
    Quisque feugiat mattis turpis, in ultrices ipsum luctus ut.
    Sed volutpat id justo eget cursus.
\end{enumerate}

\end{document}

相关内容