LaTeX symbols like \diamond, \circ and \square when compiled are in the form of symbols that are transparent. How can I fill black color into these shapes? For example, \circ shaded black is \bullet. Is there any command similar for \diamond and \square?
Asked
Active
Viewed 7,413 times
3
Werner
- 603,163
Leo Lukose
- 41
- 1
- 4
3 Answers
4
amssymb has them, otherwise, for example, you could use 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}
Edit:
Since \nabla is affected by fdsymbol, you could use stix, instead:
\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}
CarLaTeX
- 62,716
-
There is a problem with the package fdymbol. In fdsymbol \nabla doesnot show the gradient operator instead it displays a big black circlw – Leo Lukose Dec 21 '17 at 03:52
-
1
An option for a simple staring point (the purpose of the symbols is not clear (e.g. math/text/graphics symbol?):
\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}
Heiko Oberdiek
- 271,626




\documentclassand the appropriate packages that sets up the problem. While solving problems can be fun, setting them up is not. Then, those trying to help can simply cut and paste your MWE and get started on solving the problem. Please also include a sketch how the output should look like. – samcarter_is_at_topanswers.xyz Dec 18 '17 at 16:47MnSymbolprovides the symbols\filleddiamondand\filledmedsquare. Many other packages have similar symbols. Consult the comprehensive LaTeX symbols list. – Sandy G Dec 19 '17 at 04:08