how to draw a little crown above a math symbol
A very primitive way, with \symking
from skak
package by Ulrike Fischer (symbolizing a 'crown') and \overset
(Thanks to Ulrike Fischer following information: the fonts for \symking
are provided by the chessfss
package actually, which is loaded by skak
)
\documentclass{article}
\usepackage{amsmath}
\usepackage{skak}
\usepackage{accents}
\newcommand{\crown}[1]{\overset{\symking}{#1}}
\newcommand{\xcrown}[1]{\accentset{\symking}{#1}}
\begin{document}
$\crown{x}$
$\xcrown{x}$
\end{document}
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 to 1.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.
\documentclass{article}
\usepackage{stackengine,graphicx,scalerel}
\usepackage[nopar]{lipsum}
\newcommand\crownset[1]{\ensurestackMath{\ThisStyle{%
\setbox0=\hbox{$\ThisStyle#1$}%
\stackengine{.7pt}{\SavedStyle#1}{\kern\dimexpr-.1\LMex+.25\ht0\relax%
\includegraphics[width=1.2\LMex]%
{queen-crown-clipart-black-and-white-black-crown-clipart-nTE8GkyTA}}%
{O}{c}{F}{T}{S}}}}
\begin{document}
\[
y = m \crownset x + \frac{\crownset{f}}{\crownset y^2}
\]
\[
\scriptstyle y = m \crownset x + \frac{\crownset{f}}{\crownset y^2}
\]
\[
\scriptscriptstyle y = m \crownset x + \frac{\crownset{f}}{\crownset y^2}
\]
\end{document}
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 letter i
.
The text version is also \smash
ed to avoid affecting the line spacing.
\documentclass{article}
\usepackage{stackengine,graphicx}
\usepackage[nopar]{lipsum}
\newcommand\crownset[1]{\stackengine{.3pt}{#1}{\kern-.07em%
\smash{\includegraphics[width=0.5em]%
{queen-crown-clipart-black-and-white-black-crown-clipart-nTE8GkyTA}}}%
{O}{c}{F}{T}{S}}
\begin{document}
\lipsum[1]
\crownset A new d\crownset ay \crownset is dawning.
\lipsum[2]
\end{document}