3

I'm using the itemize environment to take notes and sometimes I want to add definitions and theorems in the flow.

However, amsthm adds a linebreak between the item bullet and the theorem statement, so they are not aligned.

Here's the fabled minimal working example :

\documentclass[11pt]{article}
\usepackage{amsthm}

\newtheorem{deff}{Definition}
\begin{document}
\begin{itemize}
\item In line.
\item \begin{deff}
This is not in line.
\end{deff}
\end{itemize}

\end{document}  
1

Insert a manual vertical skip back to the baseline of the \item (a total of \baselineskip plus \topsep):

enter image description here

\documentclass[11pt]{article}

\usepackage{amsthm}    
\newtheorem{deff}{Definition}

\begin{document}
\noindent
\begin{tabular}{@{}p{.48\linewidth}p{.48\linewidth}@{}}
  \begin{itemize}
  \item In line.
  \item \leavevmode\par\vspace*{\dimexpr-\baselineskip-\topsep}\begin{deff}
  This is in line.
  \end{deff}
  \end{itemize} &
  \begin{itemize}
  \item In line.
  \item \textbf{Definition 1.} \itshape This is in line.
  \end{itemize}
\end{tabular}

\end{document}

The tabular arrangement is merely to show the equivalence. I don't think there's much use/advantage is making this part of the definition of deff, as theorems are meant to usually stand on their own.

  • Meh, I can't upvote your answer. Anyway thanks, it works fine, but I wish there was something more pretty than that. It's just that my document is all made of bullets of various depth (using the outline package). Also, I realized that it already worked when I don't import amsthm. – Literal Nov 1 '14 at 19:41
  • @Neuschwanstein: If all you're using is a bunch of bullets and never setting a theorem (or deff) on a line of its own, then you could update the definition of deff by adding \let\olddeff\deff \renewcommand{\deff}{\leavevmode\par\vspace*{\dimexpr-\baselineskip-\topsep}\olddeff} to your document preamble. Now you can use it and it will always "jump up". – Werner Nov 1 '14 at 19:48

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.