我正在使用setspace
,\spacing
。我有许多函数可以创建数组,当我使用\begin{spacing} {1.5}
这些特殊函数时,我会得到空格,w \documentclass{article}
\usepackage{cancel,amsmath}
\usepackage{setspace}
\newcommand{\stackBelowCancel}[2]{\begin{array}[t]{@{}c@{}}\cancel{#1}\\#2\end{array}} % stacking BELOW canceling number(NOT FRACTION)
\begin{document}
\begin{flushleft}
\begin{spacing}{1.5}
1. $\dfrac{1}{3\cancel{0}}\cdot\dfrac{1\cancel{0}}{\stackBelowCancel{27}{3}}=\dfrac{1}{9}$ (Have spacing)
\end{spacing}
2. $\dfrac{1}{3\cancel{0}}\cdot\dfrac{1\cancel{0}}{\stackBelowCancel{27}{3}}=\dfrac{1}{9}$ (Not in spacing)
\end{flushleft}
\end{document}
答案1
array
这是伴随的普遍问题setspace
,可以通过重置\arraystretch
来抵消\baselinestretch
。
\documentclass{article}
\usepackage{cancel,amsmath}
\usepackage{setspace}
\usepackage{xfp}
\makeatletter
\renewcommand{\setstretch}[1]{%
\def\baselinestretch{#1}\@currsize
\edef\arraystretch{\fpeval{1/(#1)}}%
}
\makeatother
\newcommand{\stackBelowCancel}[2]{%
\begin{array}[t]{@{}c@{}}\cancel{#1}\\#2\end{array}%
} % stacking BELOW canceling number(NOT FRACTION)
\begin{document}
\begin{spacing}{1.5}
1. $\dfrac{1}{3\cancel{0}}\cdot\dfrac{1\cancel{0}}{\stackBelowCancel{27}{3}}=
\dfrac{1}{9}$ (Have spacing)
\end{spacing}
\begin{doublespacing}
2. $\dfrac{1}{3\cancel{0}}\cdot\dfrac{1\cancel{0}}{\stackBelowCancel{27}{3}}=
\dfrac{1}{9}$ (Have spacing)
\end{doublespacing}
3. $\dfrac{1}{3\cancel{0}}\cdot\dfrac{1\cancel{0}}{\stackBelowCancel{27}{3}}=
\dfrac{1}{9}$ (Not in spacing)
\end{document}
顺便说一句,这些简化是错误的。
答案2
忘记array
...只是\stackunder
。请注意,默认是文本模式堆叠。如果您想要数学模式,\stackMath
序言中的声明将执行此操作。
\documentclass{article}
\usepackage{cancel,amsmath,stackengine}
\usepackage{setspace}
\newcommand{\stackBelowCancel}[2]{\stackunder[4pt]{\cancel{#1}}{#2}} % stacking BELOW canceling number(NOT FRACTION)
\begin{document}
\begin{flushleft}
\begin{spacing}{1.5}
1. $\dfrac{1}{3\cancel{0}}\cdot\dfrac{1\cancel{0}}{\stackBelowCancel{27}{3}}=\dfrac{1}{9}$ (Have spacing)
\end{spacing}
2. $\dfrac{1}{3\cancel{0}}\cdot\dfrac{1\cancel{0}}{\stackBelowCancel{27}{3}}=\dfrac{1}{9}$ (Not in spacing)
\end{flushleft}
\end{document}
答案3
\underset
也许可以代替array
?来使用。
\documentclass{article}
\usepackage{cancel,amsmath}
\usepackage{setspace}
% always textstyle
\newcommand{\stackBelowCancel}[2]{\underset{\textstyle#2}{\cancel{#1}}}
% adapt to outer style
%\newcommand{\stackBelowCancel}[2]{\mathpalette\dostackBelowCancel{{#1}{#2}}}
%\newcommand{\dostackBelowCancel}[2]{\dostackBelowCancelIndeed{#1}#2}
%\newcommand{\dostackBelowCancelIndeed}[3]{\underset{#1#3}{\cancel{#2}}}
\begin{document}
\begin{flushleft}
\begin{spacing}{1.5}
1. $\dfrac{1}{3\cancel{0}}\cdot\dfrac{1\cancel{0}}{\stackBelowCancel{27}{3}}=\dfrac{1}{9}$ (Have spacing)
\end{spacing}
2. $\dfrac{1}{3\cancel{0}}\cdot\dfrac{1\cancel{0}}{\stackBelowCancel{27}{3}}=\dfrac{1}{9}$ (Not in spacing)
\end{flushleft}
\end{document}