\documentclass{ctexart}
|
||||||
\usepackage{amsmath,amssymb} | ||||||
\usepackage{mathtools} | ||||||
\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 | ||||||
%自定义 等号与问号重叠 | ||||||
\newcommand\dengwen{\fhcd[bin] ? =} | ||||||
\begin{document} | ||||||
例如 $f \dengwen g=h$? | ||||||
\begin{equation*} | ||||||
A \dengwen B | ||||||
\end{equation*} | ||||||
有网友提出问题,如何输入长等号,而且可以依据等号上下的文字宽度来自动伸缩长度,同样我们也会用到箭头的输入。 |
||||||
|
||||||
\end{document}
|