## LaTeX forum ⇒ Text Formatting ⇒ How 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, ...)
Posts: 16
Joined: Thu Dec 10, 2015 5:55 am

### How do I uniformly typeset tabbing in enumerate?

tabbing_in_enumerate.png (101.51 KiB) Viewed 4097 times

I want to typeset the above picture. But, I have no idea on how to uniformly apply tabbing in enumerate. Can anyone help me?

Tags:

Stefan Kottwitz
Posts: 9567
Joined: Mon Mar 10, 2008 9:44 pm

shall I type text and code for you?

Perhaps show your enumerate code with the sample text and I gladly help to improve it. I just don't type everything from zero. If you save your reader's time, you would get more and quicker answers.

Stefan

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

shall I type text and code for you?

Perhaps show your enumerate code with the sample text and I gladly help to improve it. I just don't type everything from zero. If you save your reader's time, you would get more and quicker answers.

Stefan

It seems you're the most present contributor to this website. If you felt offended, I'm sorry. I don't need something that exactly looks like that. But, I wanted to separate enumerate items from (premiss) and (from ...) as in the picture above.

Below is the sample LaTeX code.

\documentclass[oneside,12pt]{article}\usepackage{geometry}\usepackage{microtype}\usepackage[utf8]{inputenc}\usepackage[T1]{fontenc}\usepackage{lmodern} \usepackage{enumitem}\setlist[enumerate,1]{label=\bfseries\Alph*,align=left,leftmargin=*,   labelsep=1.5em}\setlist[enumerate,2]{label= (\arabic*),leftmargin=*,align=right} \usepackage{amsthm}\theoremstyle{definition}\newtheorem*{sol}{Solution} \begin{document}\section*{Exercises 5}Which of the following arguments are valid? Where an argument is valid, pro-vide a proof. Some of the examples are enthymemes that need repair.\begin{enumerate}\item No philosopher is illogical. Jones keeps making argumentative blunders.No logical person keeps making argumentative blunders. All existentialists arephilosophers. So, Jones is not an existentialist.\begin{enumerate}\item No philosopher is illogical. (premiss)\item\label{ok1} Jones keeps making argumentative blunders. (premiss)\item\label{ok2} No logical person keeps making argumentative blunders.(premiss)\item All existentialists are philosophers. (premiss)\item Jones is illogical (from~\ref{ok1} and~\ref{ok2})\item Jones is not a philosopher.\item So, Jones is not an existentialist.\end{enumerate}\end{enumerate}\end{document}

Stefan Kottwitz
Posts: 9567
Joined: Mon Mar 10, 2008 9:44 pm
I'm not feeling offended, don't worry. I just like to see code to work with, as I don't have the time to construct code by myself for any screenshot I see in the forum. Working with real code is better.

I think this should be a tabular like environment. it's just not easy to mix enumerate and tabular. I will take a look.

Stefan

Stefan Kottwitz
Posts: 9567
Joined: Mon Mar 10, 2008 9:44 pm

here is a suggestion with tabularx. I did not use enumerate but a self made counter.

\documentclass[oneside,12pt]{article}\usepackage{geometry}\usepackage{microtype}\usepackage[utf8]{inputenc}\usepackage[T1]{fontenc}\usepackage{lmodern}\usepackage{enumitem}\setlist[enumerate,1]{label=\bfseries\Alph*,align=left,leftmargin=*,   labelsep=1.5em}\setlist[enumerate,2]{label= (\arabic*),leftmargin=*,align=right}\usepackage{tabularx}\newcounter{tab}\renewcommand*{\thetab}{(\arabic{tab})}\begin{document}\begin{enumerate}\item No philosopher is illogical. Jones keeps making argumentative blunders.No logical person keeps making argumentative blunders. All existentialists arephilosophers. So, Jones is not an existentialist. \setcounter{tab}{0}\begin{tabularx}{0.75\textwidth}{>{\stepcounter{tab}\thetab}rXl}   & No philosopher is illogical. &(premiss) \\   & Jones keeps making argumentative blunders. &(premiss) \\   & No logical person keeps making argumentative blunders.       & (premiss) \\   & All existentialists are philosophers. & (premiss) \\   & Jones is illogical & (from~(2) and~(3))\\   & Jones is not a philosopher. \\   & So, Jones is not an existentialist.\end{tabularx}\end{enumerate}\end{document}

list.png (25.89 KiB) Viewed 4068 times

It still has the disadvantage that \label and \ref don't work. This can be solved with some effort, but perhaps this already works for you.

Stefan

Johannes_B
Site Moderator
Posts: 4160
Joined: Thu Nov 01, 2012 4:08 pm
It still has the disadvantage that \label and \ref don't work. This can be solved with some effort, but perhaps this already works for you.

\refstepcounter ;-)
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.

Stefan Kottwitz
Posts: 9567
Joined: Mon Mar 10, 2008 9:44 pm
Hello Johannes,

that's correct, it needs to be changed then. But I get a line break already by just including \label at the beginning of a tabular cell. And we need to set an anchor, otherwise the reference goes to the earlier anchor, which belongs to the outer enumerate environment.

Stefan

Johannes_B
Site Moderator
Posts: 4160
Joined: Thu Nov 01, 2012 4:08 pm
Hm, seems i am doing something different.
\documentclass[oneside,12pt]{article}\usepackage{geometry}\usepackage{microtype}\usepackage[utf8]{inputenc}\usepackage[T1]{fontenc}\usepackage{lmodern}\usepackage{enumitem}\setlist[enumerate,1]{label=\bfseries\Alph*,align=left,leftmargin=*,labelsep=1.5em}\setlist[enumerate,2]{label= (\arabic*),leftmargin=*,align=right}\usepackage{tabularx}\newcounter{tab}\renewcommand*{\thetab}{(\arabic{tab})}\begin{document}\begin{enumerate}	\item No philosopher is illogical. Jones keeps making argumentative blunders.		No logical person keeps making argumentative blunders. All existentialists are		philosophers. So, Jones is not an existentialist. 		\setcounter{tab}{0}		\begin{tabularx}{0.75\textwidth}{>{\refstepcounter{tab}\thetab}rXl}			\label{first}& No philosopher is illogical. &(premiss) \\			\label{second}& Jones keeps making argumentative blunders. &(premiss) \\			& No logical person keeps making argumentative blunders.			& (premiss) \\			& All existentialists are philosophers. & (premiss) \\			& Jones is illogical & (from~(2) and~(3))\\			& Jones is not a philosopher. from~\ref{first} and~\ref{second}\\			& So, Jones is not an existentialist.		\end{tabularx}\end{enumerate}\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.

Stefan Kottwitz
Posts: 9567
Joined: Mon Mar 10, 2008 9:44 pm
Ah, this works. I had the \label together with the text in the second column, the column change is the problem. Though I still wonder why there's a line break then.

Stefan

Johannes_B
Site Moderator
Posts: 4160
Joined: Thu Nov 01, 2012 4:08 pm
Stefan_K wrote:Though I still wonder why there's a line break then.

I don't want to dive the source right now, but ...

\documentclass{standalone}\begin{document}\begin{tabular}{cp{1cm}}	l& \label{}No .  \\\end{tabular}\begin{tabular}{cp{1cm}}	l& \hbox{}No .  \\\end{tabular}\fbox{1	\parbox{1cm}{\hbox{} N}}\fbox{1	\parbox{1cm}{\mbox{} N}}\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.