我注意到,当我addmargin
在scrextend
包中使用时,在 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
addmargin
和claim
都是列表。内部列表\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}