[Tex/LaTex] Theta hat dot: upright and bold

greek

I've had endless problems trying to get bold, upright theta symbol, with a bold hat on top, and an ordinary dot on top of that.

I got most of the way, minus the dot, using the following code: (I got the unslanted theta code from here)

\documentclass{article}

\usepackage{mathtools}
\usepackage{scalerel}

\newsavebox{\foobox}
\newcommand{\slantbox}[2][0]{\mbox{%
    \sbox{\foobox}{#2}%
    \hskip\wd\foobox
    \pdfsave
    \pdfsetmatrix{1 0 #1 1}%
    \llap{\usebox{\foobox}}%
    \pdfrestore
}}
\newcommand\unslant[2][-.25]{%
    \mkern1mu%
    \ThisStyle{\slantbox[#1]{$\SavedStyle#2$}}%
    \mkern-1mu%
}
\newcommand{\utheta}{\unslant\theta}

\begin{document}
    $\boldsymbol{\mathrm{\hat{\utheta}}}$
\end{document}

This gives me an output of everything I want, except an ordinary dot on top:

enter image description here

As soon as I wrap the existing code in \dot{}, things go haywire, with error messages including lots of @ symbols, which I assume means I really messed something up. If anyone has a solution to this, it'd be much appreciated!

Things I don't want:

  • A solution involving upgreek, since non-symmetrical versions of theta like that look ugly to me.
  • The code $\boldsymbol{\mathrm{\dot{\hat{\utheta}}}}$ isn't what I'm looking for, since the dot is bold.
  • Please no pmb.
  • Solutions involving a change of font. I'm sticking with Computer Modern for this project.

Best Answer

Stack a dot on top. The gap (currently .5pt) is adjustable with the optional argument to \stackon. EDITED to take Mico's advice (except with +/-1.3 mu instead of 1.5).

\documentclass{article}

\usepackage{mathtools}
\usepackage{scalerel,stackengine}
\stackMath

\newsavebox{\foobox}
\newcommand{\slantbox}[2][0]{\mbox{%
    \sbox{\foobox}{#2}%
    \hskip\wd\foobox
    \pdfsave
    \pdfsetmatrix{1 0 #1 1}%
    \llap{\usebox{\foobox}}%
    \pdfrestore
}}
\newcommand\unslant[2][-.25]{%
    \mkern1.3mu%
    \ThisStyle{\slantbox[#1]{$\SavedStyle#2$}}%
    \mkern-1.3mu%
}
\newcommand{\utheta}{\mathord{\unslant\theta}}

\begin{document}
    $\boldsymbol{\hat{\utheta}}$
and this
    $\stackon[.5pt]{\boldsymbol{\hat{\utheta}}}{.}$
\end{document}

enter image description here