如何使用乳膠在數學模式內的表達式上放置十字標記,如下所示?
答案1
也許這有點矯枉過正,但你可以用\times
overlaid\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}