Mixing enumerate and tabbing, what's wrong here?
You cannot nest the tabbing
environment inside an enumerate
in this way. Perhaps this is what you're after - alignment after the -
:
\documentclass[11pt]{article}
\newcommand{\df}[1]{\textbf{#1}}
\begin{document}
\section{Midterm 1}
\subsection{Definitions}
\begin{enumerate}
\item \df{Determinism} - blabhablabhabhalbha
\item \leavevmode\rlap{\df{Parsimony}}\phantom{\df{Determinism}} - alalalalalalala
\end{enumerate}
\end{document}
\leavevmode
initializes the \item
, while \rlap
causes a r
ight overlap
(zero-width, left-aligned box) of the \phantom
(non-existent) content.
This can be automated to some extent using the following setup:
\documentclass[11pt]{article}
\newcommand{\df}[1]{\textbf{#1}}
\newlength{\maxitemwidth}
\newcommand{\maxitem}[1]{\settowidth{\maxitemwidth}{#1}}
\makeatletter
\newcommand{\Item}[1]{%
\item #1%
\sbox\@tempboxa{#1}%
\ifdim\maxitemwidth>\z@\hspace*{\dimexpr\maxitemwidth-\wd\@tempboxa}\fi%
}
\begin{document}
\section{Midterm 1}
\subsection{Definitions}
\begin{enumerate}
\item \df{Determinism} - blabhablabhabhalbha
\item \df{Parsimony} - alalalalalalala
\end{enumerate}
Some text.
\maxitem{\df{Determinism}}\showthe\maxitemwidth
\begin{enumerate}
\Item{\df{Determinism}} - blabhablabhabhalbha
\Item{\df{Parsimony}} - alalalalalalala
\end{enumerate}
\end{document}
You set the maximum-width item using \maxwidth
and then use \Item{<item>}
in the enumerate
list. All subsequent lists will then be typeset with this in mind. There are other ways of doing this, but not knowing the exact usage makes this sufficient, I guess.
if you want also possible linebreaks in the definition
\documentclass[11pt]{article}
\usepackage{tabularx,lipsum}
\newcolumntype{S}{@{\stepcounter{Definition}\theDefinition.~} >{\bfseries}l @{~--~}X@{}}
\newcounter{Definition}[subsection]
\begin{document}
\section{Midterm 1}
\subsection{Definitions}
\begin{tabularx}{\linewidth}{S}
Determinism & blabhablabhabhalbha \\
Parsimony & \lipsum[4]
\end{tabularx}
\end{document}