答案1
最后有一个很好的解决方案:
\usepackage{tikz}
\usepackage{amsmath}
\newsavebox{\deltabox}
\newcommand{\divdiff}{
\mathord{
\mathpalette\makedivdiff\relax
}
}
\newcommand{\makedivdiff}[2]{
\sbox{\deltabox}{$#1\Delta$}
\begin{tikzpicture}[baseline=(char.base), inner sep=0, outer sep=0]
\node[anchor=south west,inner sep=0,outer sep=0] (char) {\usebox{\deltabox}};
\fill[black] ([xshift=0.0\wd\deltabox,yshift=0.05\wd\deltabox]char.south) -- ([yshift=-0.05\wd\deltabox]char.north) -- ([xshift=-0.14\wd\deltabox,yshift=0.04\wd\deltabox]char.south east);
\end{tikzpicture}
}
您只需在需要时调用该符号即可\divdiff
,结果如下:
我必须补充一点,根据您使用的字体,您可能需要稍微更改命令定义中三角形锚点上使用的移位\makedivdiff
。
答案2
◮ 符号在 Unicode 中是 U+25EE。你可以使用如下代码启用它:
\documentclass{article}
\usepackage{unicode-math} % Or amsmath and fontspec.
\newfontfamily\symbolfont{New Computer Modern Math Regular}[Scale=MatchUppercase]
\newcommand\divdiff{\ifmmode%
\textup{\symbolfont\symbol{"25EE}}%
\else%
{\symbolfont\symbol{"25EE}}%
\fi}
\begin{document}
In text mode, {\divdiff}.
In math mode, \(\divdiff\increment\).
\end{document}
答案3
和pict2e
:
\documentclass{article}
\usepackage{pict2e,xcolor}
\makeatletter
\newcommand{\divdiff}{\Delta{\mathpalette\divdiff@\relax}}
\newcommand{\divdiff@}[2]{%
\begingroup
\sbox\z@{$\m@th#1\Delta$}%
\llap{% the black triangle
\begin{picture}(0.54\wd\z@,\ht\z@)
\moveto(0,0)
\lineto(0.45\wd\z@,0)
\lineto(0,0.95\ht\z@)
\closepath
\fillpath
\end{picture}}%
\endgroup
}
\makeatother
\begin{document}
$\divdiff\scriptstyle\divdiff\scriptscriptstyle\divdiff$
\end{document}
如果你将内侧三角形涂成红色,你就明白其中的奥秘了。