I'd like to have a command \crown
that would draw a little crown above a symbol, e.g. $\crown x$
should show an $x$
with a little crown over it. I know I can use the accents
package to declare any symbol as an accent, but how do I create a compatible symbol?
[Tex/LaTex] how to draw a little crown above a math symbol
accents
Best Answer
Go out to the web and find a crown image that suits, such as http://images.clipartpanda.com/queen-crown-clipart-black-and-white-black-crown-clipart-nTE8GkyTA.gif. If it is not the proper format (this is a gif), use your graphics software (e.g., MSPaint) to save it as a jpeg.
MATH MODE version
Then, just patch its name into the
\crownset
macro definition below, adjusting the leading\kern
if the image had asymmetric horizontal space about it. Other parameters that can be tweaked include the overset gap, currently set to.7pt
, and image width, currently set to1.2\LMex
.The stack is set up to ignore the width of the crown during the typeset, so that
\crownset is
does not adversely affect the horizontal spacing.EDITED to account for slant of math font.
If I don't like that crown, just find another, such as https://openclipart.org/image/2400px/svg_to_png/242116/Royal-Crown-Silhouette.png and substitute the file name into the macro:
TEXT MODE version
The stack is set up to ignore the width of the crown during the typeset, so that
\crownset is
does not adversely affect the kerning of the letteri
.The text version is also
\smash
ed to avoid affecting the line spacing.