我正在使用acmart
document 类,并希望在各种align
环境中全局调整行高。但是我似乎无法使用\addtolength
来修改\jot
,我认为这是推荐方法。以下是我想要实现的大致目标,可以通过手动使用[0.5em]
或[-0.5em]
逐行破解来实现:
\documentclass{acmart}
% these don’t seem to do anything
% \addtolength{\jot}{0.5em}
% \addtolength{\jot}{-0.5em}
\begin{document}
\begin{align}
Here’s
\\
the
\\
default
\\
spacing
\end{align}
\begin{align}
Want
\\[-0.5em]
to
\\[-0.5em]
have
\\[-0.5em]
smaller
\end{align}
\begin{align}
Want
\\[0.5em]
to
\\[0.5em]
have
\\[0.5em]
bigger
\end{align}
\end{document}
我已经检查过是否可以\addtolength
按预期工作article
:
\documentclass{article}
\usepackage{amsmath}
\begin{document}
\begin{align}
Here's
\\
the
\\
default
\\
spacing
\end{align}
\addtolength{\jot}{-0.5em}
\begin{align}
Want
\\
to
\\
have
\\
smaller
\end{align}
\addtolength{\jot}{1em}
\begin{align}
Want
\\
to
\\
have
\\
bigger
\end{align}
\end{document}
我怎样才能使它工作acmart
?
答案1
不要改变\jot
,但要使用\openup
。
\documentclass{acmart}
\begin{document}
\begin{align}
Here’s
\\
the
\\
default
\\
spacing
\end{align}
\begingroup\openup-\jot
\begin{align}
Want
\\
to
\\
have
\\
smaller
\end{align}\endgroup
\begingroup\openup\jot
\begin{align}
Want
\\
to
\\
have
\\
bigger
\end{align}\endgroup
\end{document}
最好为此定义一个合适的环境。参数可以是任何十进制数,正数表示增加空间,负数表示减少空间。
\documentclass{acmart}
\newenvironment{changespacing}[1]{\openup#1\jot}{\ignorespacesafterend}
\begin{document}
\begin{align}
Here’s
\\
the
\\
default
\\
spacing
\end{align}
\begin{changespacing}{-1}
\begin{align}
Want
\\
to
\\
have
\\
smaller
\end{align}
\end{changespacing}
\begin{changespacing}{1}
\begin{align}
Want
\\
to
\\
have
\\
bigger
\end{align}
\end{changespacing}
\end{document}