How can I add the character in the figure in a formula? I would like a yellow filled character, wider then \sqcup
Asked
Active
Viewed 888 times
1
-
I would like a character more larger than \sqcup and also I would like that inside it's yellow. – ryuk Nov 12 '17 at 21:53
-
1You may want to mention up front, rather than in a comment, that the yellow filler inside the square cup is essential. – Mico Nov 12 '17 at 21:56
2 Answers
3
You can customize the parameters, if you so wish.
\documentclass{article}
\usepackage{pict2e,xcolor}
\makeatletter
\newcommand{\ysqcup}{\mathbin{\,\mathpalette\ryuk@ysqcup{(0,1)(0,0)(1,0)(1,1)}}\,}
\newcommand{\ysqcap}{\mathbin{\,\mathpalette\ryuk@ysqcup{(0,0)(0,1)(1,1)(1,0)}}\,}
\newcommand{\ryuk@ysqcup}[2]{%
\vcenter{\hbox{%
\sbox\z@{$\m@th#1\mkern15mu$}%
\setlength{\unitlength}{\wd\z@}%
\begin{picture}(1,1)
\linethickness{0.05\unitlength}
\put(0,0){\color{yellow}\rule{\unitlength}{\unitlength}}
\polyline#2
\end{picture}%
}}%
}
\makeatother
\begin{document}
$x\sqcup a\ysqcup b\ysqcap c_{\ysqcup\ysqcap}$
\end{document}
egreg
- 1,121,712
1
I take it you're interested in a version of the \bigsqcup macro that "fills" the cup with yellow color. (The size of the symbol produced by \bigsqcup is larger in display-style math mode than it is in text-style math mode.)
The following solution sets up a macro called \yellowbigsqcup. It can be used both in display-style math expressions or in text-mode (inline) math material; for the latter appliation, specify the option \textstyle.
\documentclass{article}
\usepackage{xcolor} % for "\fcolorbox" macro
\newcommand\yellowbigsqcup[1][\displaystyle]{%
\fboxrule0pt
\ifx#1\textstyle\fboxsep-0.6pt\else\fboxsep-1.25pt\fi
\mathrel{\fcolorbox{white}{yellow}{$#1\bigsqcup$}}}
\begin{document}
\[
a \bigsqcup b \quad a \yellowbigsqcup b
\]
\[ \textstyle
a \bigsqcup b \quad a \yellowbigsqcup[\textstyle] b
\]
\end{document}
Mico
- 506,678


