0

I have a description list at the beginning of a proof environment and want the first label to begin in the same column as the remaining labels. When I put a \leavevmode before the first \item, the label for the first item overlays the label for the second item.

\documentclass{article}
\usepackage{amsmath}
\usepackage{amsthm}

\theoremstyle{definition}

\theoremstyle{remark}

\numberwithin{equation}{section}

\usepackage[colorlinks,hidelinks,draft=false]{hyperref}

\usepackage{cleveref}

% \newtheorem must follow cleveref
\newtheorem{theorem}{Theorem}[section]
\newtheorem{corollary}[theorem]{Corollary}
\def\corollaryautorefname{Corollary}         % Needed for \autoref
\newtheorem{definition}[theorem]{Definition}
\def\definitionautorefname{Definition}       % Needed for \autoref
\newtheorem{example}[theorem]{Example}
\newtheorem{lemma}[theorem]{Lemma}
\def\lemmaautorefname{Lemma}                 % Needed for \autoref

\newtheorem{remark}[theorem]{Remark}
\newtheorem{xca}[theorem]{Exercise}
\usepackage[draft]{showlabels}
\showlabels{cite}
\showlabels{cref}
\showlabels{crefrange}

\begin{document}
\begin{theorem}
foo
\begin{proof}
\begin{description}
\leavevmode
\item[prop1:]
proof of prop1.
\item[prop2:]
proof of prop2
\end{description}
\end{proof}
\end{theorem}
\end{document}
4
  • a latex list should only have items preceded by \item. \leavevmode is a syntax error, what is the intention? Commented Dec 31, 2019 at 19:31
  • The intent is for the first label to not begin on the same line as "Proof." A \\ is invalid either after \begin{proof} or after \begin{description}.
    – shmuel
    Commented Dec 31, 2019 at 19:55
  • oh you could put it before \begin{description} (or \mbox{} is more idiomatic LaTeX than the \leavevmode primitive. Commented Dec 31, 2019 at 19:56
  • That works. If you care to put the information in an answer I'll upcheck it and mark it as solving the problem. Thanks.
    – shmuel
    Commented Dec 31, 2019 at 20:19

1 Answer 1

1

A latex list should only have items preceded by \item. \leavevmode is a syntax error, what is the intention?

If you want a "normal" paragraph to hole the proof label before the list starts you could put \leavevmode (or \mbox{} would be better LaTeX) before the

\begin{description}

Not after it.

3
  • It turns out that I can also do
    – shmuel
    Commented Jan 2, 2020 at 17:38
  • It turns out that I can also use "\ " after "\proof". Is that considered goog form, or is "\mbox{}" preferred?
    – shmuel
    Commented Jan 2, 2020 at 17:40
  • \mbox{} is better \ takes up horizontal space so may force a linebreak if your proof label is long Commented Jan 2, 2020 at 17:42

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .