如果箭头小于 .7em 或 .3cm,为什么不放在等号下面?
\documentclass{article}
\usepackage{mathtools}
\usepackage{tikz}
\usetikzlibrary{arrows.meta}
\newcommand{\bigswarrow}[1]{\tikz{\draw[->](#1,3ex)--(0,0);}}
\begin{document}
\foreach \wid in {.1,.2,...,1}
{\bigswarrow{\wid em}}
\foreach \wid in {.1,.2,...,1}
{$\underset{\bigswarrow{\wid em}}{=}$}
\foreach \wid in {.1,.2,...,1}
{\bigswarrow{\wid}}
\foreach \wid in {.1,.2,...,1}
{$\underset{\bigswarrow{\wid}}{=}$}
\end{document}
答案1
我相信添加后baseline
就能修复该问题。
\documentclass{article}
\usepackage{mathtools}
\usepackage{tikz}
\usetikzlibrary{arrows.meta}
\newcommand{\bigswarrow}[1]{\tikz[baseline]{\draw[->](#1,3ex)--(0,0);}}
\begin{document}
\foreach \wid in {.1,.2,...,1}
{\bigswarrow{\wid em}}
\foreach \wid in {.1,.2,...,1}
{$\underset{\bigswarrow{\wid em}}{=}$}
\foreach \wid in {.1,.2,...,1}
{\bigswarrow{\wid}}
\foreach \wid in {.1,.2,...,1}
{$\underset{\bigswarrow{\wid}}{=}$}
\end{document}
答案2
不知道为什么,但这里有一个解决办法。我把下划箭头放在\hbox{...}
\documentclass{article}
\usepackage{mathtools}
\usepackage{tikz}
\usetikzlibrary{arrows.meta}
\newcommand{\bigswarrow}[1]{\tikz{\draw[->](#1,3ex)--(0,0);}}
\begin{document}
\foreach \wid in {.1,.2,...,1}
{\bigswarrow{\wid em}}
\foreach \wid in {.1,.2,...,1}
{$\underset{\hbox{\bigswarrow{\wid em}}}{=}$}
\foreach \wid in {.1,.2,...,1}
{\bigswarrow{\wid}}
\foreach \wid in {.1,.2,...,1}
{$\underset{\hbox{\bigswarrow{\wid}}}{=}$}
\end{document}
另外,向 marmot 致敬,我可以\bigswarrow
通过以下方式强制进入基线stackengine
:
\usepackage{stackengine}
\newcommand{\bigswarrow}[1]{\abovebaseline[0pt]{\tikz{\draw[->](#1,3ex)--(0,0);}}}
那么,我就不需要\hbox
es 了。