TransWikia.com

enumerate without newline

TeX - LaTeX Asked by CookieHCl on May 31, 2021

% 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}

If I run the above code, you’ll get something like this.
Enumerate begins with a newline.

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

I want to make enumerate right next to the paragraph like this.

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

Or at least like this.

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

Unfortunately, enumitem package with inline option and using enumerate* environment with itemjoin = newline option was not a solution because it won’t indent the text.

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...

One Answer

This is more a workaround than a real solution, but if you don't really need the paragraph, you could place the "Q:" inside of the first item.

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}

Correct answer by Vincent on May 31, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP