将定理与项目符号对齐

将定理与项目符号对齐

我正在尝试定理。与子弹对齐。我尝试使用\vspace{-\topsep},但这会使子弹与定理。

\documentclass{article}

\usepackage{amsthm}

\newtheorem{theorem}{Theorem}

\begin{document}
\begin{itemize}
    \item \begin{theorem}
        $a^2 + b^2 = c^2$
    \end{theorem}
\end{itemize}
\end{document}

答案1

由于定理具有列表结构,因此您只需补偿相应的垂直间距:

\documentclass{article}

\usepackage{amsthm}

\newtheorem{theorem}{Theorem}

\begin{document}

\begin{itemize}
    \item \leavevmode\vspace{-\dimexpr \baselineskip + \topsep}\begin{theorem}
        $a^2 + b^2 = c^2$. Some text some text some text. Some text some text some text. Some text some text some text. Some text some text some text.
    \end{theorem}
\end{itemize}

\end{document} 

在此处输入图片描述

答案2

我的建议:

\documentclass{article}

\usepackage{amsthm}

\newtheorem{theorem}{Theorem}

\newenvironment{ittheorem}[1][t]{\begin{minipage}[#1]{0.1\textwidth}\begin{itemize}\item \end{itemize}\end{minipage}\begin{minipage}{0.88\textwidth}\begin{theorem}}{\end{theorem}\end{minipage}}

\begin{document}
\begin{itemize}
  \item
\begin{theorem}
        $a^2 + b^2 = c^2$
    \end{theorem}
\end{itemize}

\begin{ittheorem}[t]
  $a^2+b^2=c^2$
  you can include some text and whatever accepted in a real theorem environment
\end{ittheorem}
\end{document}

输出:

在此处输入图片描述

相关内容