Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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?

share|improve this question
2  

4 Answers 4

up vote 17 down vote accepted

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}

enter image description here

share|improve this answer
\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} 

enter image description here

share|improve this answer

You can use tikz to draw it. Here is a comparison of the filled in version along with the \Diamond

enter image description here

Notes:

  • This version requires additional work to be able to scale as well as egreg's version for different math sizes.

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{\MyDiamond}[1][fill=black]{\mathop{\raisebox{-0.275ex}{$\sqdiamond[#1]$}}}

\begin{document}

$a \Diamond b \MyDiamond c \MyDiamond[draw=red,fill=cyan] d$

\end{document}
share|improve this answer
1  
I would like to have the same shape as $\Diamond$. –  ocon Aug 17 at 21:14
1  
@HennerWild: Adjusted to be same shape as \Diamond. –  Peter Grill Aug 18 at 6:47

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}

enter image description here

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.