I'm typesetting a bunch of source code, and I really like the way the double-nested logical-and and logical-or symbols look for denoting bitwise logical and/or.
Unfortunately, LaTeX doesn't seem to have these symbols, so I resorted to rolling my own using a combination of \land
and \lor
with carefully rotated and aligned rules. The results are acceptable to my eye at 10pt, but the placement of the rules is fragile for a couple of reasons. Here's how they look magnified:
The first reason they're fragile is because (against my better judgment, but not knowing a better way), I'm making assumptions about spacing:
\newcommand{\bland}{% bitwise logical and
\hbox{%
$\land$%
\hspace{-.47em}%
\raisebox{-.04em}{%
\rotatebox{66}{%
\vrule width .3em height .45pt depth 0pt%
}%
\hspace{.065em}%
\rotatebox{-66}{%
\hspace{-.3em}%
\vrule width .3em height .45pt depth 0pt%
}%
}%
\hspace{.20em}%
}%
}
Thus, when shown in a smaller size—for example when stacked atop =
or \Leftarrow
—the internal lines are off by a small but noticeable amount.
The second reason is more insidious and seems to have to do with rounding error in PDF conversion or display: the inner wedge "wobbles" half a pixel or so (as compared to the outer wedge) at various sizes.
I'm wondering what the best solution is here. I'm not opposed (in theory) to diving into XeLaTeX to see how U+2A53
and U+2A54
look, but if possible I'd prefer to avoid dependencies on XeTeX/XeLaTeX for this. Also, the first thing I tried was nesting a \tiny\land
inside a \land
but the slopes of the strokes were different. Basically I need something with the same slopes and thicknesses, and it would also be nice if they had rounded edges, but I haven't the TeXpertise to make that happen.
Here's how the symbols look at a more regular size (top line is regular boolean logical operators; second two lines are bitwise boolean operators):
By the way, I did come across a double-nested less-than and greater-than in a standard LaTeX package, which I think I could maybe use—if I rotated them 90 degrees—but the problem I have with those is that they override/redefine \ll
and \gg
rather than adding new control sequences, and I have places elsewhere where I want to use the real \ll
and \gg
.