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}
  • a latex list should only have items preceded by \item. \leavevmode is a syntax error, what is the intention? – David Carlisle Dec 31 '19 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 Dec 31 '19 at 19:55
  • oh you could put it before \begin{description} (or \mbox{} is more idiomatic LaTeX than the \leavevmode primitive. – David Carlisle Dec 31 '19 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 Dec 31 '19 at 20:19
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.

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.