[Tex/LaTex] Compilation error when including enumitem and paralist packages

enumitemincompatibilitylistsparalist

I encounter an error when I compile a LaTeX document which includes both the enumitem and the paralist packages.
Here is my MWE code:

\documentclass{article}

\usepackage{enumitem}
\usepackage{paralist}

\begin{document}

\begin{tabular}{lp{10cm}}
\scshape Assume: & \begin{compactenum}
\item $(p_1, p_2)$ is an optimal price sequence
\item $p_2 > p_1 > 0$
\end{enum}
\\
\scshape Prove: & False
\end{tabular}


\begin{enumerate}[label=\bfseries Case \arabic*:,leftmargin=*]
\item
It rains today.
\item
It does not rain today.
\end{enumerate}

\end{document}

How do I fix the error?
Is there a way to define my own compactenum using enumitem so I don't need to include the paralist package?

Best Answer

You don;t need to use the paralist package at all. Just use the starred variant of the environments from the enumitem package -- requires to add the inline option to the enumitem package:

enter image description here

If you don't want the enumerat in the tabular to be on its own line you can tweak all the paramaters used for vertical spacing. Below I used [topsep=0pt,partopsep=0pt,itemsep=0pt, parsep=0pt] to achieve:

enter image description here

References:


Compilation Error

You original compilation error can be fixed via:

  1. Load paralist before enumitem.
  2. Replace the \end{cenum} with \end{compactenum}

Code: inline

\documentclass{article}

\usepackage[inline]{enumitem}
%\usepackage{paralist}

\begin{document}

\begin{tabular}{lp{10cm}}
\scshape Assume: & \begin{enumerate*}
\item $(p_1, p_2)$ is an optimal price sequence
\item $p_2 > p_1 > 0$
\end{enumerate*}
\\
\scshape Prove: & False
\end{tabular}


\begin{enumerate}[label=\bfseries Case \arabic*:,leftmargin=*]
\item
It rains today.
\item
It does not rain today.
\end{enumerate}

\end{document}

Code: Tight Spacing:

\documentclass{article}

\usepackage{enumitem}
%\usepackage{paralist}

\begin{document}

\begin{tabular}{lp{10cm}}
\scshape Assume: & \begin{enumerate}[topsep=0pt,partopsep=0pt,itemsep=0pt, parsep=0pt]
\item $(p_1, p_2)$ is an optimal price sequence
\item $p_2 > p_1 > 0$
\end{enumerate}
\\
\scshape Prove: & False
\end{tabular}


\begin{enumerate}[label=\bfseries Case \arabic*:,leftmargin=*]
\item
It rains today.
\item
It does not rain today.
\end{enumerate}

\end{document}

Code: Fix Compilation Error

\documentclass{article}

\usepackage{paralist}
\usepackage{enumitem}

\begin{document}

\begin{tabular}{lp{10cm}}
\scshape Assume: & \begin{compactenum}
\item $(p_1, p_2)$ is an optimal price sequence
\item $p_2 > p_1 > 0$
\end{compactenum}
\\
\scshape Prove: & False
\end{tabular}


\begin{enumerate}[label={\bfseries Case \arabic*:},leftmargin=*]
\item
It rains today.
\item
It does not rain today.
\end{enumerate}

\end{document}