答案1
这里的方法有点复杂。为什么?
需要让符号位于两个字形的中心,即使两个字形的宽度不同
需要跨数学风格开展工作。
需要使重音字形与底层字形的间距保持不变。
需要根据底层字形的高度自动调整垂直位置。
妇女权利委员会:
\documentclass{article}
\usepackage{amssymb,stackengine,scalerel}
\begin{document}
\newcommand\ext[2]{%
\ThisStyle{
\setbox0=\hbox{\ooalign{$\SavedStyle#1$\cr$\SavedStyle#2$}}
\setbox2=\hbox{$\SavedStyle#1$}
\setbox4=\hbox{$\SavedStyle#2$}
\kern-\wd0\kern\wd2
\ensurestackMath{
\stackengine{-1.6\LMpt}{\makebox[\wd0][r]{$\SavedStyle#1$}
\makebox[\wd0][l]{$\SavedStyle#2$}}
{\kern1\LMpt\SavedStyle\scaleobj{.6}{\smallfrown}}{O}{c}{F}{F}{S}
\kern-\wd0\kern\wd4}
}
}
$ximaeijx$
$x\ext{i}{m}\ext{a}{e}\ext{i}{j}x$
$\scriptstyle x\ext{i}{m}\ext{a}{e}\ext{i}{j}x$
$\scriptscriptstyle x\ext{i}{m}\ext{a}{e}\ext{i}{j}x$
\end{document}
附录:
\smallfrown
得到本质上相似的结果可能有一个更好、更短的办法,只需垂直重叠两个参数之间的比例即可:
\documentclass{article}
\usepackage{amssymb,stackengine,scalerel}
\newcommand\ext[2]{%
\ThisStyle{\setbox0=\hbox{$\SavedStyle#1#2$}#1
\tclap[\dimexpr\ht0-.5\LMpt]
{$\kern1\LMpt\SavedStyle\scaleobj{.6}{\smallfrown}$}#2}
}
\begin{document}
$ximaeijx$
$x\ext{i}{m}\ext{a}{e}\ext{i}{j}x$
$\scriptstyle x\ext{i}{m}\ext{a}{e}\ext{i}{j}x$
$\scriptscriptstyle x\ext{i}{m}\ext{a}{e}\ext{i}{j}x$
\end{document}
答案2
只需在包装中添加一个开关即可simpler-wick
。(这些开关看起来像 Wick 缩写,只是它们是圆形的。)
\documentclass[fleqn]{article}
\usepackage[sep=3pt,offset=0.5ex]{simpler-wick}
\newif\ifWickRound
\WickRoundfalse
\pgfkeys{
/simplerwick/round/.code={\WickRoundtrue},
}
\makeatletter
\def\swick@end#1#2{
\swick@setfalse@#1
\tikzexternaldisable
\begin{tikzpicture}[remember picture, baseline=(swick-close#1.base)]
\node[use as bounding box, inner sep=0pt, outer sep=0pt] (swick-close#1) {$\displaystyle #2$};
\end{tikzpicture}
\tikz[remember picture, overlay]
{
\ifWickRound
\draw[white,line width=2pt,postaction={draw,black,thin}]
let \p1=(swick-open#1.north),\p2=(swick-close#1.north),
\n1={max(\y1,\y2)+1pt}
in (\x1,\n1) to[out=60,in=120] (\x2,\n1);
\else
\draw ($(swick-open#1.north) + (0, 3pt)$)
-- ($(swick-open#1.base) + (0, \swick@offset) + #1*(0, \swick@sep)$)
-- ($(swick-close#1.base) + (0, \swick@offset) + #1*(0, \swick@sep)$)
-- ($(swick-close#1.north) + (0, 3pt)$);
\fi}
\tikzexternalenable}
\makeatother
\begin{document}
\[\wick[round]{\c1x\c1y+3\c2x\c3y+2\c2 x+\c3z}\]
\end{document}
请注意,外观很容易修改。如果您提供反馈,我很乐意根据您的需求进行调整。
附录:这会根据您的评论修改外观。(不过,我不确定我是否理解正确。当然可以更改线宽。)
\documentclass[fleqn]{article}
\usepackage[sep=3pt,offset=0.5ex]{simpler-wick}
\newif\ifWickRound
\WickRoundfalse
\pgfkeys{
/simplerwick/round/.code={\WickRoundtrue},
}
\makeatletter
\def\swick@end#1#2{
\swick@setfalse@#1
\tikzexternaldisable
\begin{tikzpicture}[remember picture, baseline=(swick-close#1.base)]
\node[use as bounding box, inner sep=0pt, outer sep=0pt] (swick-close#1) {$\displaystyle #2$};
\end{tikzpicture}
\tikz[remember picture, overlay]
{
\ifWickRound
\draw[white,line width=2pt,postaction={draw,black,thin,line cap=butt}]
let \p1=(swick-open#1.north west),\p2=(swick-close#1.north west),
\p3=(swick-open#1.north east),\p4=(swick-close#1.north east),
\n1={max(\y1,\y2)+1pt},\n2={0.2*\x1+0.8*\x3},\n3={0.8*\x2+0.2*\x4}
in (\n2,\n1) to[out=60,in=120] (\n3,\n1);
\else
\draw ($(swick-open#1.north) + (0, 3pt)$)
-- ($(swick-open#1.base) + (0, \swick@offset) + #1*(0, \swick@sep)$)
-- ($(swick-close#1.base) + (0, \swick@offset) + #1*(0, \swick@sep)$)
-- ($(swick-close#1.north) + (0, 3pt)$);
\fi}
\tikzexternalenable}
\makeatother
\begin{document}
\[\wick[round]{\c1x\c1y+3\c2x\c3y+2\c2 x+\c3z}\]
\end{document}
答案3
答案4
mathabx
我使用它提供的包添加了我的简单解决方案以获取\wideparen
字母上弧的命令。
\documentclass[a4paper,12pt]{article}
\usepackage{mathtools}
\usepackage{mathabx}
\begin{document}
\begin{align}
oa\wideparen{ab}def &\quad yh\wideparen{imn}ryri\\
ppf\wideparen{la}abc\wideparen{gg}&\quad \wideparen{im}r
\end{align}
\begin{align}
\scriptstyle{oa\wideparen{ab}def} &\quad yh\wideparen{imn}ryri\\
ppf\wideparen{la}abc\wideparen{gg}&\quad \scriptstyle{\wideparen{im}r}
\end{align}
\end{document}