如果我在 scrextend 中使用 addmargin,它会把所有内容都塞在一起

如果我在 scrextend 中使用 addmargin,它会把所有内容都塞在一起

我注意到,当我addmarginscrextend包中使用时,在 addmargin 环境内,垂直间距变得很奇怪。

\documentclass[12pt]{article}

\usepackage{amsthm}
\usepackage{amsmath}
\usepackage{scrextend}

\newtheorem*{claim}{Claim}

\begin{document}
Let $A$ and $B$ be commutative $R$ algebras.
\begin{claim}
A map $A \xrightarrow{\varphi}B$ is an $R$ algebra map $\iff \varphi(f(x_1, \dotsc, x_n)) = f(\varphi x_1, \dotsc, \varphi x_n)\,\,\,\,\,\, \forall f$
\end{claim}
\begin{proof}
$\varphi(r_0 + r_1 \alpha + \dotsb + r_n \alpha^n) = r_0 + r_1 \varphi(\alpha) + \dotsb + r_n \varphi(\alpha)^n$.
\end{proof}
\begin{addmargin}[3em]{3cm}
Let $A$ and $B$ be commutative $R$ algebras.
\begin{claim}
A map $A \xrightarrow{\varphi}B$ is an $R$ algebra map $\iff \varphi(f(x_1, \dotsc, x_n)) = f(\varphi x_1, \dotsc, \varphi x_n)\,\,\,\,\,\, \forall f$
\end{claim}
\begin{proof}
$\varphi(r_0 + r_1 \alpha + \dotsb + r_n \alpha^n) = r_0 + r_1 \varphi(\alpha) + \dotsb + r_n \varphi(\alpha)^n$.
\end{proof}
\end{addmargin}
\end{document}

生产在此处输入图片描述

答案1

addmarginclaim都是列表。内部列表\topsep为 0pt,amsthm用作\topsep定理的 preskip 和 postskip。

有一个下一个 KOMA 版本 3.22 的预发布它可按预期与您的代码配合使用。您可以从KOMA-Script 网站

\documentclass[12pt]{article}
\usepackage{scrextend}[2016/10/21]
\usepackage{amsmath}
\usepackage{amsthm}
\newtheorem*{claim}{Claim}

\begin{document}
Used KOMA-Script version: \KOMAScriptVersion

Let $A$ and $B$ be commutative $R$ algebras.
\begin{claim}
A map $A \xrightarrow{\varphi}B$ is an $R$ algebra map $\iff \varphi(f(x_1, \dotsc, x_n)) = f(\varphi x_1, \dotsc, \varphi x_n)\,\,\,\,\,\, \forall f$
\end{claim}
\begin{proof}
$\varphi(r_0 + r_1 \alpha + \dotsb + r_n \alpha^n) = r_0 + r_1 \varphi(\alpha) + \dotsb + r_n \varphi(\alpha)^n$.
\end{proof}
\begin{addmargin}[3em]{3cm}
Let $A$ and $B$ be commutative $R$ algebras.
\begin{claim}
A map $A \xrightarrow{\varphi}B$ is an $R$ algebra map $\iff \varphi(f(x_1, \dotsc, x_n)) = f(\varphi x_1, \dotsc, \varphi x_n)\,\,\,\,\,\, \forall f$
\end{claim}
\begin{proof}
$\varphi(r_0 + r_1 \alpha + \dotsb + r_n \alpha^n) = r_0 + r_1 \varphi(\alpha) + \dotsb + r_n \varphi(\alpha)^n$.
\end{proof}
\end{addmargin}
\end{document}

在此处输入图片描述


作为 KOMA-Script 的解决方法3.21 或更早版本您可以使用

\usepackage{amsthm}
\makeatletter
%amsthm theorem in list hack (suggested by Markus Kohm)
\AtBeginDocument{\thm@space@setup\renewcommand*{\thm@space@setup}{}}
\makeatother

在此处输入图片描述

代码:

\documentclass[12pt]{article}
\usepackage{scrextend}
\usepackage{amsmath}
\usepackage{amsthm}
%Workaround for KOMA-Script version 3.21 or older:
\makeatletter
%amsthm theorem in list hack (suggested by Markus Kohm)
\AtBeginDocument{\thm@space@setup\renewcommand*{\thm@space@setup}{}}
\makeatother

\newtheorem*{claim}{Claim}

\begin{document}
Used KOMA-Script version: \KOMAScriptVersion

Let $A$ and $B$ be commutative $R$ algebras.
\begin{claim}
A map $A \xrightarrow{\varphi}B$ is an $R$ algebra map $\iff \varphi(f(x_1, \dotsc, x_n)) = f(\varphi x_1, \dotsc, \varphi x_n)\,\,\,\,\,\, \forall f$
\end{claim}
\begin{proof}
$\varphi(r_0 + r_1 \alpha + \dotsb + r_n \alpha^n) = r_0 + r_1 \varphi(\alpha) + \dotsb + r_n \varphi(\alpha)^n$.
\end{proof}
\begin{addmargin}[3em]{3cm}
Let $A$ and $B$ be commutative $R$ algebras.
\begin{claim}
A map $A \xrightarrow{\varphi}B$ is an $R$ algebra map $\iff \varphi(f(x_1, \dotsc, x_n)) = f(\varphi x_1, \dotsc, \varphi x_n)\,\,\,\,\,\, \forall f$
\end{claim}
\begin{proof}
$\varphi(r_0 + r_1 \alpha + \dotsb + r_n \alpha^n) = r_0 + r_1 \varphi(\alpha) + \dotsb + r_n \varphi(\alpha)^n$.
\end{proof}
\end{addmargin}
\end{document}

相关内容