如何使用乳胶在数学模式中的表达式上添加叉号,如下所示?
答案1
也许这有点过头了,但你可以构建一个\times
覆盖\longrightarrow
了
\documentclass[]{article}
\def\longxrightarrow{\mathrel{%
\mathchoice{\LongXRightArrow}{\LongXRightArrow}{\scriptsize\LongXRightArrow}{\tiny\LongXRightArrow}%
}}
\def\LongXRightArrow{{%
\setbox0\hbox{\ensuremath{\longrightarrow}}%
\rlap{\hbox to \wd0{\ensuremath{\hss\times\hss}}}\box0
}}
\begin{document}
$ a^b \longxrightarrow c^d $
\end{document}
表现为
答案2
\nrightarrow
+ 镜像\nrightarrow
也许十字架有点小,至少十字架的大小和位置来自字体设计师,因为示例\nrightarrow
与它的镜像版本重叠:
\documentclass{article}
\usepackage{amssymb}
\usepackage{graphicx}
\makeatletter
\newcommand*{\crossrightarrow}{%
\mathrel{%
\mathpalette\@crossrightarrow{}%
}%
}
\newcommand*{\@crossrightarrow}[2]{%
% #1: math style
% #2: unused
\sbox0{$#1\nrightarrow\m@th$}%
\sbox2{$#1\vcenter{}$}%
\sbox2{\raisebox{\ht2}{\scalebox{1}[-1]{\raisebox{-\ht2}{\copy0}}}}%
\ht2=\ht0 %
\dp2=\dp2 %
\rlap{\unhcopy2}%
\copy0 %
}
\makeatother
\begin{document}
\[
a^b \crossrightarrow a^c
\]
\end{document}
\rightarrow
++\setminus
镜像\setminus
带有较大十字架的变体(对我的口味来说它太大了):
\documentclass{article}
\usepackage{graphicx}
\makeatletter
\newcommand*{\crossrightarrow}{%
\mathrel{%
\mathpalette\@crossrightarrow{}%
}%
}
\newcommand*{\@crossrightarrow}[2]{%
\sbox0{$#1\rightarrow\m@th$}%
\sbox2{$#1\setminus\m@th$}%
\copy0 %
\kern-\wd0 %
\hbox to \wd0{%
\hspace{0pt plus 1fil}%
\rlap{\scalebox{-1}[1]{\copy2}}%
\copy2 %
\hspace{0pt plus 1.5fil}%
% the factor for `fil' controls the horizontal position of the cross
}%
}
\makeatother
\begin{document}
\[
a^b \crossrightarrow a^c
\]
\end{document}
评论:
\mathpalette
用于获得符号对四种数学风格的采用。
答案3
\times
与长右箭头重叠的更简单方法:
\documentclass{article}
\makeatletter
\newcommand{\longxarrow}[1]{%
\mathrel{\vphantom{\to}\mathpalette\longx@rrow{#1}}% arrows are bigger than \times
}
\newcommand{\longx@rrow}[2]{%
\ooalign{\hidewidth$#1\times\m@th$\hidewidth\cr$#1#2\m@th$\cr}%
}
\makeatother
\newcommand{\longxrightarrow}{\longxarrow{\longrightarrow}}
\newcommand{\longxleftarrow}{\longxarrow{\longleftarrow}}
\begin{document}
$A\longxrightarrow B_{\longxrightarrow}$
$A\longxleftarrow B_{\longxleftarrow}$
\end{document}
答案4
\documentclass{article}
\usepackage{stackengine}
\usepackage{graphicx}
\usepackage{xcolor}
\begin{document}
$a^b
\mathrel{\stackengine{-1.3pt}{$\rightarrow$}%
{\color{red}\scalebox{1.6}{$\times$}\kern3pt}{O}{c}{F}{T}{L}}
a^c$
\end{document}