LaTeX forum ⇒ Text FormattingNested enumeration with brackets Topic is solved

Information and discussion about LaTeX's general text formatting features (e.g. bold, italic, enumerations, ...)
ge0rg
Posts: 9
Joined: Sat Jul 25, 2015 7:00 am

Nested enumeration with brackets

Postby ge0rg » Tue Jul 28, 2015 5:50 am

Hello people of the internet,

I have the following question:

I would like to do the following (excerpt from my seminar paper):

(1) The Turing Test is decisive:
(1.1) If S passes the Turing Test, it has a mind.
(1.2) If S does not pass the Turing Test, it does not have a mind.

(2) The Turing Test is too strong:
(2.1) If S passes the Turing Test, it has a mind.
(2.2) If S does not pass the Turing Test, it may or may not have a mind.

(3) The Turing Test is too weak:
(3.1) If S passes the Turing Test, it may or may not have a mind.
(3.2) If S does not pass the Turing Test, it does not have a mind.

(4) The Turing Test does not correlate to having minds at all:
(4.1) If S passes the Turing Test, it may or may not have a mind.
(4.2) If S does not pass the Turing Test, it may or may not have a mind.


The subpoints should be tabbed but I can't seem to make that work here. Anyhow, I have managed to do this:

  1. \begin{enumerate}[label*=\arabic*.]
  2. \item
  3. The Turing Test is decisive:
  4. \begin{enumerate}[label*=\arabic*]
  5. \item If S passes the Turing Test, it has a mind.
  6. \item If S does not pass the Turing Test, it does not have a mind.
  7. \end{enumerate}
  8. \item
  9. The Turing Test is too strong:
  10. \begin{enumerate}[label*=\arabic*]
  11. \item If S passes the Turing Test, it has a mind.
  12. \item If S does not pass the Turing Test, it may or may not have a mind.
  13. \end{enumerate}
  14. \item
  15. The Turing Test is too weak:
  16. \begin{enumerate}[label*=\arabic*]
  17. \item If S passes the Turing Test, it may or may not have a mind.
  18. \item If S does not pass the Turing Test, it does not have a mind.
  19. \end{enumerate}
  20. \item
  21. The Turing Test does not correlate to having minds at all:
  22. \begin{enumerate}[label*=\arabic*]
  23. \item If S passes the Turing Test, it may or may not have a mind.
  24. \item If S does not pass the Turing Test, it may or may not have a mind.
  25. \end{enumerate}
  26. \end{enumerate}


Which yields a similar reslut, but insead of (1) and (1.1) and so on, I get 1 and 1.1.
How can I make this work with the parenthesis being where I want them to be? If I do something like \begin{enumerate}[label*=(\arabic*)], I will get something like 1.(1) or (1).(1) .

Tags:

ge0rg
Posts: 9
Joined: Sat Jul 25, 2015 7:00 am

Postby ge0rg » Wed Jul 29, 2015 1:02 am

Problem solved. In case it interest someone:

  1. \begin{enumerate}[label=(\arabic*)]
  2. \item
  3. The Turing Test is decisive:
  4. \begin{enumerate}[label=(\arabic{enumi}.\arabic*)]
  5. \item If S passes the Turing Test, it has a mind.
  6. \item If S does not pass the Turing Test, it does not have a mind.
  7. \end{enumerate}
  8. \item
  9. The Turing Test is too strong:
  10. \begin{enumerate}[label=(\arabic{enumi}.\arabic*)]
  11. \item If S passes the Turing Test, it has a mind.
  12. \item If S does not pass the Turing Test, it may or may not have a mind.
  13. \end{enumerate}
  14. \item
  15. The Turing Test is too weak:
  16. \begin{enumerate}[label=(\arabic{enumi}.\arabic*)]
  17. \item If S passes the Turing Test, it may or may not have a mind.
  18. \item If S does not pass the Turing Test, it does not have a mind.
  19. \end{enumerate}
  20. \item
  21. The Turing Test does not correlate with having minds at all:
  22. \begin{enumerate}[label=(\arabic{enumi}.\arabic*)]
  23. \item If S passes the Turing Test, it may or may not have a mind.
  24. \item If S does not pass the Turing Test, it may or may not have a mind.
  25. \end{enumerate}
  26. \end{enumerate}

User avatar
Stefan Kottwitz
Site Admin
Posts: 8453
Joined: Mon Mar 10, 2008 9:44 pm
Location: Hamburg, Germany
Contact:

Postby Stefan Kottwitz » Wed Jul 29, 2015 10:15 am

Thank you for telling us the solution! It could help other people who come here via google, with a similar problem, so it's useful to read it here.

Hopefully I can answer another question. Feel free to open a new topic about any LaTeX problem you see.

Stefan
Site admin

User avatar
cgnieder
Site Moderator
Posts: 1974
Joined: Sat Apr 16, 2011 7:27 pm
Location: Germany
Contact:

Postby cgnieder » Fri Jul 31, 2015 6:08 pm

Just to add one information for users who find this thread: package enumitem is necessary for above examples to compile.

Regards
Clemens
------------------------------
chemmacros · chemformula · leadsheets · xsim

User avatar
cgnieder
Site Moderator
Posts: 1974
Joined: Sat Apr 16, 2011 7:27 pm
Location: Germany
Contact:

Postby cgnieder » Fri Jul 31, 2015 6:26 pm

BTW: instead of setting the label properties each time again you can also setup {enumerate} with enumitem's \setlist command:

  1. \setlist[enumerate,1]{label=(\arabic*),ref=\arabic*}
  2. \setlist[enumerate,2]{label=(\theenumi.\arabic*),ref=\theenumi.\arabic*}


or maybe even

  1. \newcommand*\enparen[1]{(#1)}
  2. \setlist[enumerate]{format=\enparen}
  3. \setlist[enumerate,1]{label=\arabic*}
  4. \setlist[enumerate,2]{label*=.\arabic*}


This would also set the parentheses when the items are referenced, while in the first examples references would have no parantheses.

A complete example:

  1. \documentclass{article}
  2. \usepackage{enumitem}
  3.  
  4. \setlist[enumerate,1]{label=(\arabic*),ref=\arabic*}
  5. \setlist[enumerate,2]{label=(\theenumi.\arabic*),ref=\theenumi.\arabic*}
  6.  
  7. \begin{document}
  8.  
  9. \begin{enumerate}
  10. \item The Turing Test is decisive:
  11. \begin{enumerate}
  12. \item If S passes the Turing Test, it has a mind.
  13. \item If S does not pass the Turing Test, it does not have a mind.
  14. \end{enumerate}
  15. \item The Turing Test is too strong:
  16. \begin{enumerate}
  17. \item If S passes the Turing Test, it has a mind.
  18. \item If S does not pass the Turing Test, it may or may not have a mind.
  19. \end{enumerate}
  20. \item The Turing Test is too weak:
  21. \begin{enumerate}
  22. \item If S passes the Turing Test, it may or may not have a mind.
  23. \item If S does not pass the Turing Test, it does not have a mind.
  24. \end{enumerate}
  25. \item The Turing Test does not correlate with having minds at all:
  26. \begin{enumerate}
  27. \item If S passes the Turing Test, it may or may not have a mind.
  28. \item If S does not pass the Turing Test, it may or may not have a mind.
  29. \end{enumerate}
  30. \end{enumerate}
  31.  
  32. \end{document}


Regards
Clemens
------------------------------
chemmacros · chemformula · leadsheets · xsim


Return to “Text Formatting”

Who is online

Users browsing this forum: No registered users and 5 guests