I use the multiple \Diamond-product sign (\bDiamond) as described in sign for multiple $\Diamond$-product. Now, in addition, I would like to have a filled \Diamond-product sign, i.e. filled with black. Any suggestions?
-
2Lots of options here: http://www.tex.ac.uk/tex-archive/info/symbols/comprehensive/symbols-a4.pdf – Thruston Aug 17 '14 at 21:06
-
@Thruston link died. – Jim May 14 '18 at 21:31
-
1@Jim see -> http://tug.ctan.org/info/symbols/comprehensive/symbols-a4.pdf – Thruston May 15 '18 at 08:23
4 Answers
With amssymb you have \blacklozenge:
\documentclass{article}
\usepackage{amssymb,graphicx}
\newcommand{\bDiamond}{\mathbin{\Diamond}}
\newcommand{\bLozenge}{\mathbin{\blacklozenge}}
\makeatletter
\newcommand\bigDiamond{\mathop{\mathpalette\bigDi@mond\relax}}
\newcommand\bigDi@mond[2]{%
\vcenter{\hbox{\m@th
\scalebox{\ifx#1\displaystyle 2\else1.2\fi}{$#1\Diamond$}%
}}%
}
\newcommand\bigLozenge{\mathop{\mathpalette\bigL@zenge\relax}}
\newcommand\bigL@zenge[2]{%
\vcenter{\hbox{\m@th
\scalebox{\ifx#1\displaystyle 2\else1.2\fi}{$#1\blacklozenge$}%
}}%
}
\makeatother
\begin{document}
\[
\bigoplus_{i=1}^n % just for comparison
\bigDiamond_{i=1}^n (a_i\bDiamond b_i)\quad
\textstyle\bigDiamond_{i=1}^n a_i\quad
\scriptstyle\bigDiamond_{i=1}^n a_i\quad
\scriptscriptstyle\bigDiamond_{i=1}^n a_i
\]
\[
\bigoplus_{i=1}^n % just for comparison
\bigLozenge_{i=1}^n (a_i\bLozenge b_i)\quad
\textstyle\bigLozenge_{i=1}^n a_i\quad
\scriptstyle\bigLozenge_{i=1}^n a_i\quad
\scriptscriptstyle\bigLozenge_{i=1}^n a_i
\]
\end{document}

- 1,121,712
And here the obligatory unicode-answer:
% arara: lualatex
\documentclass{article}
\usepackage{unicode-math}
\setmathfont{XITS-Math}
\usepackage{booktabs}
\begin{document}
\begin{table}
\centering
\begin{tabular}{lc}
\toprule
Unicode & Symbol\\
\midrule
\verb|U+2B26| & $\mdwhtdiamond$\\
\verb|U+2B25| & $\mdblkdiamond$\\
\verb|U+2B28| & $\mdwhtlozenge$\\
\verb|U+2B27| & $\mdblklozenge$\\
\verb|U+22C4| & $\smwhtdiamond$\\
\verb|U+2B29| & $\smblkdiamond$\\
\verb|U+2B2B| & $\smwhtlozenge$\\
\verb|U+2B2A| & $\smblklozenge$\\
\verb|U+25C7| & $\mdlgwhtdiamond$\\
\verb|U+25C6| & $\mdlgblkdiamond$\\
\verb|U+2662| & $\diamondsuit$\\
\verb|U+2666| & $\vardiamondsuit$\\
\bottomrule
\end{tabular}
\end{table}
If you can't decide, take $\blackinwhitediamond$ or a half version like these: $\diamondleftblack\diamondrightblack\diamondtopblack\diamondbotblack$
\end{document}

- 43,807
You can use tikz to draw it. Here is a comparison of the filled in version along with the \Diamond
Notes:
- This version requires additional work to be able to scale as well as egreg's version for different math sizes.
- I defined a separate macro if a dash over it is desired. However, if you did not have other options that were required, I would define a starred variant of the macro
\MyDiamond*to include the dash.
Code:
\documentclass{article}
\usepackage{amssymb,amsmath, graphicx}
\usepackage{tikz}
\newcommand{\sqdiamond}[1][fill=black]{\tikz [x=1.2ex,y=1.85ex,line width=.1ex,line join=round, yshift=-0.285ex] \draw [#1] (0,.5) -- (.5,1) -- (1,.5) -- (.5,0) -- (0,.5) -- cycle;}%
\newcommand{\sqdiamondDash}[1][fill=black]{%
\tikz [x=1.2ex,y=1.85ex,line width=.1ex,line join=round, yshift=-0.285ex]
\draw [#1]
(0,.5) -- (.5,1) -- (1,.5) -- (.5,0) -- (0,.5) -- cycle
(0,1.1) -- (1,1.1);
}%
\newcommand{\MyDiamond}[1][fill=black]{\mathop{\raisebox{-0.275ex}{$\sqdiamond[#1]$}}}
\newcommand{\MyDiamondDash}[1][fill=black]{\mathop{\raisebox{-0.275ex}{$\sqdiamondDash[#1]$}}}
\begin{document}
$a \Diamond b \MyDiamond c \MyDiamond[draw=red,fill=cyan] d \MyDiamondDash[draw=red,fill=cyan] e$
\end{document}
- 223,288
-
1
-
1
-
@Peter Grill Using your solution, is it possible to add an horizontal line above the diamond ? – Manuel Selva Nov 05 '15 at 14:42
-
1
\documentclass[12pt]{article}
\usepackage[utf8]{inputenc}
\usepackage[x11names]{xcolor}
\usepackage{amsmath,amssymb}
\usepackage{array}
\DeclareFontFamily{U}{mathb}{\hyphenchar\font45}
\DeclareFontShape{U}{mathb}{m}{n}{
<5><6><7><8><9><10>gen*mathbm
<10.95>mathbm10<12><14.4><17.28><20.74><24.88>mathbm12
}{}
\DeclareSymbolFont{mathb}{U}{mathb}{m}{n}
\DeclareFontSubstitution{U}{mathb}{m}{n}
\DeclareMathSymbol{\blackdiamond}{\mathbin}{mathb}{"0C}
\def\bluediamond{\mathbin{\color{SteelBlue3}\blackdiamond}}
\def\bluelozenge{\mathbin{\color{SteelBlue3}\blacklozenge}}
\begin{document}
\renewcommand\arraystretch{1.5}
\begin{tabular}{l l}
With \texttt{mathabx}: & $ a \bluediamond b $ \\
With \texttt{amssymb}: & $ a \bluelozenge b $
\end{tabular}
\end{document}

- 271,350
