\documentclass{article}
\usepackage{amsmath}
\begin{document}
$\dfrac{2x+7}{x-4}-\dfrac{x+4}{x-2}$
\end{document}
\documentclass{article}
\usepackage{amsmath}
\usepackage{graphicx}
\makeatletter
\DeclareFontFamily{U}{tipa}{}
\DeclareFontShape{U}{tipa}{m}{n}{<->tipa10}{}
\newcommand{\arc@char}{{\usefont{U}{tipa}{m}{n}\symbol{62}}}%
\newcommand{\arc}[1]{\mathpalette\arc@arc{#1}}
\newcommand{\arc@arc}[2]{%
\sbox0{$\m@th#1#2$}%
\vbox{
\hbox{\resizebox{\wd0}{\height}{\arc@char}}
\nointerlineskip
\box0
}%
}
\makeatother
\newcommand{\stackAboveArc}[2]{\begin{array}[b]{@{}c@{}}#1\\ \arc{#2}\end{array}}
\begin{document}
% $\dfrac{2x+7}{x-4}-\dfrac{x+4}{x-2}$
$\dfrac{\stackAboveArc{x-2}{2x+7}}{x-4}-\dfrac{\stackAboveArc{x-4}{x+4}}{x-2}$
\end{document}
我不需要任何不同于默认值的颜色或字体。
编辑: 好吧,我修改了一些可以用分数缩放的东西,这很好,但我无法旋转弧线。如何旋转它?如上图。
答案1
以下是一个将您的命令与egreg 的这个答案。
\documentclass{article}
\usepackage{amsmath}
\makeatletter% based on https://tex.stackexchange.com/a/260580/121799
\newcommand\underparenonly[1]{%
\mathop{%
\vtop{
\m@th
\ialign{%
##\crcr
$\hfil\displaystyle{#1}\hfil$\crcr
\noalign{\kern3\p@\nointerlineskip}%
\upparenfill\crcr
}%
}%
}
}
\newcommand\upparenfill{%
$\m@th\setbox\z@\hbox{$\braceld$}%
\bracelu\leaders\vrule \@height\ht\z@ \@depth\z@\hfill\braceru$%
}
\makeatother
\newcommand{\stackAboveChar}[2]{\begin{array}[b]{@{}c@{}}\underparenonly{#1}\\[1ex]{#2}\end{array}}
\begin{document}
$\stackAboveChar{x-2}{\dfrac{2x+7}{x-4}}-\stackAboveChar{x-4}{\dfrac{x+4}{x-2}}$
\end{document}
至于您问题中的代码:由于您已经在使用graphicx
,因此您只需添加一个\rotatebox
来翻转括号即可。
\documentclass{article}
\usepackage{amsmath}
\usepackage{graphicx}
\makeatletter
\DeclareFontFamily{U}{tipa}{}
\DeclareFontShape{U}{tipa}{m}{n}{<->tipa10}{}
\newcommand{\arc@char}{{\usefont{U}{tipa}{m}{n}\symbol{62}}}%
\newcommand{\arc}[1]{\mathpalette\arc@arc{#1}}
\newcommand{\arc@arc}[2]{%
\sbox0{$\m@th#1#2$}%
\vbox{
\hbox{\resizebox{\wd0}{\height}{\rotatebox[origin=bottom]{180}{\arc@char}}}
\nointerlineskip
\box0
}%
}
\makeatother
\newcommand{\stackAboveArc}[2]{\begin{array}[b]{@{}c@{}}#1\\ \arc{#2}\end{array}}
\begin{document}
% $\dfrac{2x+7}{x-4}-\dfrac{x+4}{x-2}$
$\dfrac{\stackAboveArc{x-2}{2x+7}}{x-4}-\dfrac{\stackAboveArc{x-4}{x+4}}{x-2}$
\end{document}