\diamond
像、\circ
和这样的 LaTeX 符号\square
在编译时是透明符号的形式。我如何将黑色填充到这些形状中?例如,\circ
阴影黑色是\bullet
。是否有类似的命令用于\diamond
和\square
?
答案1
amssymb
有它们,否则,例如,你可以使用fdsymbol
:
\documentclass{article}
\usepackage{amsmath,amssymb}
\usepackage{fdsymbol}
\begin{document}
\noindent With \texttt{amsmath}:
\[
\blacklozenge \quad \blacksquare
\]
With \texttt{fdsymbol}:
\[
\medblackdiamond \quad \medblacksquare \quad
\smallblackdiamond \quad \smallblacksquare \quad
\]
\end{document}
编辑:
由于\nabla
受到 的影响fdsymbol
,因此您可以改用stix
:
\documentclass{article}
\usepackage{amsmath}
\usepackage{stix}
\usepackage{array}
\setlength\extrarowheight{4pt}
\begin{document}
\begin{tabular}{>{\ttfamily\textbackslash}l>{$}l<{$}}
\multicolumn{2}{l}{With \texttt{stix} package:}\\
mdblkdiamond & \mdblkdiamond \\
mdblksquare & \mdblksquare \\
mdlgblkdiamond & \mdlgblkdiamond \\
mdlgblksquare \textnormal{or its alias} \textbackslash\texttt{blackquare} & \mdlgblksquare \quad \blacksquare\\
nabla \textnormal{is correct}& \nabla
\end{tabular}
\end{document}
答案2
简单起点的选项(符号的用途不明确(例如数学/文本/图形符号?):
\documentclass{article}
\usepackage{tikz}
\begin{document}
\tikz\shadedraw (0, 0) rectangle (1, 1);
\tikz[rotate=45]\shadedraw (0, 0) rectangle ({1/sqrt(2)}, {1/sqrt(2)});
\tikz[rotate=45]\shadedraw[shading angle=45]
(0, 0) rectangle ({1/sqrt(2)}, {1/sqrt(2)});
\end{document}