|
\begin{测试代码}
\documentclass{ctexart}
\usepackage{amsmath,amssymb}
\usepackage{mathtools}
%符号重叠命令\fhcd[类型]{符号}{符号}
%类型是最终输出的符号的类型(bin, rel, ord 等,默认 bin),两符号顺序随意
\makeatletter
\newcommand\fhcd[3][bin]{
\csname math#1\endcsname{\mathchoice
{\@fhcd\displaystyle{#2}{#3}}
{\@fhcd\textstyle{#2}{#3}}
{\@fhcd\scriptstyle{#2}{#3}}
{\@fhcd\scriptscriptstyle{#2}{#3}}}}
\newcommand\@fhcd[3]{
\settowidth\@tempdima{$\m@th#1{#2}$}
\settowidth\@tempdimb{$\m@th#1{#3}$}
\ifdim\@tempdimb>\@tempdima\@tempdima\@tempdimb\fi
\kern.5\@tempdima\mathclap{#2}\mathclap{#3}\kern.5\@tempdima}
\makeatother
\begin{document}
这样,第一个可以这样定义
\newcommand\cttdiv{\fhcd\bigtriangledown\cdot}
效果 $A\cttdiv B = A\bigtriangledown B\cdot C$
\[A\cttdiv B + \frac{\frac{A\cttdiv B}{A\cttdiv B}}{A\cttdiv B}\]
第二个直接这样定会有瑕疵
\newcommand\cttcurl{\fhcd\bigtriangledown\times}%
$A\cttcurl B$
突了点儿,只能调整下了,比如
\renewcommand\cttcurl{\fhcd\bigtriangledown
{\text{\raisebox{0.25ex}{\scalebox{0.75}{$\times$}}}}}%
$A\cttcurl B+\frac{A\cttcurl B}2$
还可以搞些其他东西
长的不等价
\let\iff\Longleftrightarrow
\newcommand\niff{\fhcd[rel]/\iff}
$A\niff B\iff C+\frac{A\niff B}{A\iff B}$
斜的不平行
\newcommand\px{\mathrel{/\mkern-5mu/}}%
\newcommand\npx{\fhcd[rel]\px\smallsetminus}%
$AB\px CD\npx EF$
无聊的
\newcommand\asdf{\fhcd[ord]\leftrightarrow\updownarrow}%
\newcommand\aaaa{\fhcd[ord]\nearrow\searrow}%
\newcommand\bbbb{\fhcd[ord]\nwarrow\swarrow}%
\newcommand\cccc{\fhcd[ord]\aaaa\bbbb}%
$\asdf \ \cccc$
\end{document}
\end{测试代码} |
|