How can I overlay a 0 with a | in latex to create a new symbol comprised of a 0 with a vertical line inside it?
I've looked at the following post Overlay symbol with another and tried to adapt the code provided in one of the answers, because I didn't understood the accepted answer, but this did not output the symbol that I wanted.
\newcommand\cz{\mathrel{\ooalign{$|$\cr\hidewidth$0$\hidewidth\cr}}}
The vertical dash would go out of the zero and when I wrote another letter next to this symbol the spacing would be incorrect. In order to try and understand the accepted answer I tried to look for the commands used there, like \rlap, \setbox, …, in the web and in the latex reference provided with texmaker under the help tab but the web pages I found explainde very poorly these commands and the latex refence didn't even had them. Where can I find the official documentation for these commands or any other good resource to learn them?
Best Answer
Made to work in all math styles. I overlay a stretched
\vert
inside a0
.If one did not like seeing, under high magnification, the rounded extrema of the
\vert
, one could tweak it asIf one wanted more control over the width of the bar, replacing the
\vert
with a\rule
of specified width would provide that flexibility. Here, I make the width.6\LMpt
, where\LMpt
is a measure of pt that is scaled in the smaller math styles.