LaTeX forum ⇒ Text FormattingHow do I uniformly typeset tabbing in enumerate? Topic is solved

Information and discussion about LaTeX's general text formatting features (e.g. bold, italic, enumerations, ...)
User avatar
Stefan Kottwitz
Site Admin
Posts: 9445
Joined: Mon Mar 10, 2008 9:44 pm

Re: How do I uniformly typeset tabbing in enumerate?

Postby Stefan Kottwitz » Mon Jan 04, 2016 8:40 pm

Well, the line break goes away when I insert an \mbox{} before.

Stefan

Tags:

mado
Posts: 16
Joined: Thu Dec 10, 2015 5:55 am

Postby mado » Tue Jan 05, 2016 10:03 am

Thanks for support. The code works well.

How do I make the table fill the width of the surrounding enumerate item? Is there a way to obtain the width of the surrounding enumerate item?

User avatar
Johannes_B
Site Moderator
Posts: 4044
Joined: Thu Nov 01, 2012 4:08 pm

Postby Johannes_B » Tue Jan 05, 2016 10:24 am

  1. \documentclass[oneside,12pt]{article}
  2. \usepackage[showframe]{geometry}
  3. \usepackage{microtype}
  4. \usepackage[utf8]{inputenc}
  5. \usepackage[T1]{fontenc}
  6. \usepackage{lmodern}
  7. \usepackage{enumitem}
  8. \setlist[enumerate,1]{label=\bfseries\Alph*,align=left,leftmargin=*,
  9. labelsep=1.5em}
  10. \setlist[enumerate,2]{label= (\arabic*),leftmargin=*,align=right}
  11. \usepackage{tabularx}
  12. \newcounter{tab}
  13. \renewcommand*{\thetab}{(\arabic{tab})}
  14. \begin{document}
  15. \begin{enumerate}
  16. \item No philosopher is illogical. Jones keeps making argumentative blunders.
  17. No logical person keeps making argumentative blunders. All existentialists are
  18. philosophers. So, Jones is not an existentialist.
  19.  
  20. \setcounter{tab}{0}
  21. \begin{tabularx}{\linewidth}{@{}>{\refstepcounter{tab}\thetab}rX@{\quad\quad}l@{}}
  22. \label{first}& No philosopher is illogical. &(premiss) \\
  23. \label{second}& Jones keeps making argumentative blunders. &(premiss) \\
  24. & No logical person keeps making argumentative blunders.
  25. & (premiss) \\
  26. & All existentialists are philosophers. & (premiss) \\
  27. & Jones is illogical & (from~(2) and~(3))\\
  28. & Jones is not a philosopher. from~\ref{first} and~\ref{second}\\
  29. & So, Jones is not an existentialist.
  30. \end{tabularx}
  31. \end{enumerate}
  32. \end{document}
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.

mado
Posts: 16
Joined: Thu Dec 10, 2015 5:55 am

Postby mado » Tue Jan 05, 2016 10:54 am

What is \thetab? Ah, it's defined in preamble.
Why do you insert @{} in preamble of tabularx? It doesn't seem to make a difference.

User avatar
Johannes_B
Site Moderator
Posts: 4044
Joined: Thu Nov 01, 2012 4:08 pm

Postby Johannes_B » Tue Jan 05, 2016 7:28 pm

[latex]\thetab[\latex] defines the graphical representation of the tab counter.
In this case, this is an opening parenthesis, the value of the counter in arabic numerals (possible would be also roman, Roman, alph and Alph numerals) and a closing paren.

The other question is dealt with in the followup: Why do people insert @{} in table preamble?
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.

mado
Posts: 16
Joined: Thu Dec 10, 2015 5:55 am

Postby mado » Wed Jan 06, 2016 1:42 am

Great.

User avatar
Johannes_B
Site Moderator
Posts: 4044
Joined: Thu Nov 01, 2012 4:08 pm

Postby Johannes_B » Mon Jan 18, 2016 7:36 pm

@Stefan, neither hbox nor label enter horizontal mode. But the reerence point is moved, see texdoc grfguide, page 6, footnote dor reference.
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.


Return to “Text Formatting”

Who is online

Users browsing this forum: No registered users and 7 guests