Text Formatting ⇒ How do I uniformly typeset tabbing in enumerate?
How do I uniformly typeset tabbing in enumerate?
Learn LaTeX easily with newest books:
The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis
The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more
LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis
- Stefan Kottwitz
- Site Admin
- Posts: 10397
- Joined: Mon Mar 10, 2008 9:44 pm
Re: How do I uniformly typeset tabbing in enumerate?
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
How do I uniformly typeset tabbing in enumerate?
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.Stefan_K wrote:Hi mado,
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
Below is the sample LaTeX code.
Code: Select all
\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 are
philosophers. 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
- Site Admin
- Posts: 10397
- Joined: Mon Mar 10, 2008 9:44 pm
How do I uniformly typeset tabbing in enumerate?
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
- Site Admin
- Posts: 10397
- Joined: Mon Mar 10, 2008 9:44 pm
How do I uniformly typeset tabbing in enumerate?
here is a suggestion with
tabularx. I did not use enumerate but a self made counter.Code: Select all
\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}{>{\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}\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: 4182
- Joined: Thu Nov 01, 2012 4:08 pm
How do I uniformly typeset tabbing in enumerate?
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 ;-)- Stefan Kottwitz
- Site Admin
- Posts: 10397
- Joined: Mon Mar 10, 2008 9:44 pm
How do I uniformly typeset tabbing in enumerate?
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: 4182
- Joined: Thu Nov 01, 2012 4:08 pm
How do I uniformly typeset tabbing in enumerate?
Code: Select all
\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}
- Stefan Kottwitz
- Site Admin
- Posts: 10397
- Joined: Mon Mar 10, 2008 9:44 pm
Re: How do I uniformly typeset tabbing in enumerate?
Stefan
- Johannes_B
- Site Moderator
- Posts: 4182
- Joined: Thu Nov 01, 2012 4:08 pm
How do I uniformly typeset tabbing in enumerate?
I don't want to dive the source right now, but ...Stefan_K wrote:Though I still wonder why there's a line break then.
Code: Select all
\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}