Text FormattingModify enumerated Lists to show Nesting on same Line

Information and discussion about LaTeX's general text formatting features (e.g. bold, italic, enumerations, ...)
Post Reply
JL-Quant
Posts: 3
Joined: Sat Mar 03, 2012 3:20 pm

Modify enumerated Lists to show Nesting on same Line

Post by JL-Quant »

Hi everyone,

I have just started learning LaTex. I am not sure how to modify the enumerate environment to show nestings on the same line. Could someone please kindly show me how to code the following list arrangment (not the actual text) in LaTex
enumeratemod.png
enumeratemod.png (19.89 KiB) Viewed 3817 times
My whole document contains maths questions with some questions containing nested parts like (a), (b). Other questions have further nestings like (i) and (ii).

Thank you for your help.
Last edited by localghost on Sat Mar 03, 2012 4:37 pm, edited 1 time in total.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

Stefan Kottwitz
Site Admin
Posts: 10345
Joined: Mon Mar 10, 2008 9:44 pm

Re: Modify enumerated Lists to show Nesting on same Line

Post by Stefan Kottwitz »

Hi,

welcome to the board!

Generally, it's a good idea to post some code. For example here, you could copy a sample into the post showing what you did already, the reader could test and improve it. For now, if a reader would have an idea, he would have to type dummy text on his own or type the text from your screenshot, instead of just copy & paste. It's possible that nobody does it if you don't post a code sample.

It reminds me of questions such as "can somebody create this document for me" with an image and without any effort such as code to start - even if your question is a smaller one.

Stefan
LaTeX.org admin
JL-Quant
Posts: 3
Joined: Sat Mar 03, 2012 3:20 pm

Modify enumerated Lists to show Nesting on same Line

Post by JL-Quant »

Hello Stefan,

My apologies for not posting code. My best attempt is with the following:

Code: Select all

\begin{enumerate}
  
\item Question line 1
\begin{enumerate}
\item Part (a) text
\item Part (b) text
\begin{enumerate}
\item Part (b)(i) text
\item Part (b)(ii) text
\end{enumerate}  
\end{enumerate}
  
\item Question line 2
\item Question line 3

\end{enumerate}
I'm not sure how to get the text at (a) to go on the same line as 1. (as per picture) and I'm not sure how to split (b) into (i) and (ii).

Thank you
Last edited by Stefan Kottwitz on Sat Mar 03, 2012 5:00 pm, edited 1 time in total.
User avatar
Stefan Kottwitz
Site Admin
Posts: 10345
Joined: Mon Mar 10, 2008 9:44 pm

Modify enumerated Lists to show Nesting on same Line

Post by Stefan Kottwitz »

It's on the same line if you would start the new enumeration right after \item:

Code: Select all

\documentclass[12pt]{article}
\begin{document}
    \begin{enumerate}
    \item
      \begin{enumerate}
        \item Part (a) text
        \item
          \begin{enumerate}
            \item Part (b)(i) text
            \item Part (b)(ii) text
          \end{enumerate}  
      \end{enumerate}
         \item Question line 2
    \item Question line 3
    \end{enumerate}
\end{document}
list.png
list.png (9.98 KiB) Viewed 3808 times
Stefan
LaTeX.org admin
JL-Quant
Posts: 3
Joined: Sat Mar 03, 2012 3:20 pm

Re: Modify enumerated Lists to show Nesting on same Line

Post by JL-Quant »

This is exactly how I wanted it. Thank you so much Stefan for your patience and help. I am most grateful.
Post Reply