I would like to know how to make a character like \hslash, but with a 'd' instead of an 'h'.
I know that \hbar is defined using \mathchar'26, might there be a similar character for the slash in \hslash?
Asked
Active
Viewed 3,297 times
5
nivk
- 335
1 Answers
9
The \hslash symbol is a unique glyph. Here's an emulation of it obtained by scaling, rotating and raising a minus sign:
\documentclass{article}
\usepackage{amssymb,graphicx}
\newcommand{\hslashslash}{%
\raisebox{.9ex}{%
\scalebox{.7}{%
\rotatebox[origin=c]{18}{$-$}%
}%
}%
}
\newcommand{\dslash}{%
{%
\vphantom{d}%
\ooalign{\kern.05em\smash{\hslashslash}\hidewidth\cr$d$\cr}%
\kern.05em
}%
}
\begin{document}
$\hslash\ne\dslash^2$
\end{document}

egreg
- 1,121,712
-
-
@HarishKumar Trial and error; the first attempt was 20 degrees, but typesetting it over the
\hslashrevealed it was too much; with 18 degrees it was perfect. There's no indication of the angle in the Metafont source for\hslash(bsymbols.mf, character octal 175). The bar is slightly thicker for\dslash, though. :( – egreg Apr 03 '14 at 08:58 -
-
If now I try to use this inside of a command like $\vec{\dslash}$, this gives interesting results... How would you solve this to avoid that the arrow is so high? – mwoua Apr 24 '20 at 16:48
-
-
@egreg Hmmm... Cause I get this: link Note that I tweeked it a bit to do it on p rather than d. Edit: without any changein your code (by keeping it on the letter d, not tweeking the numbers etc) I still get an arrow much higher than the normal \vec{d}... – mwoua Apr 24 '20 at 17:20
-
@mwoua Well, You seem to have defined incorrectly
\pslash. Please, open a new question with all details. – egreg Apr 24 '20 at 20:14 -
@egreg Well it ooks like it... But the thing is, when I copy-paste your code, I have the same thing: an arrow too high. I will open some new question. – mwoua Apr 24 '20 at 20:59
\dj? – Sigur Apr 03 '14 at 02:37\mathchar'26can't be used, just with some horizontal adjustments to make sure it crosses the stem in the correct place. sorry, i don't have access to a system where i can test it at the moment. – barbara beeton Apr 03 '14 at 02:49\mathchar'26is a short horizontal line used in the definition of\hbar. The character that I seek is a short diagonal line, similar to the one appearing in the character\hslashin theamssymbpackage. – nivk Apr 03 '14 at 02:57