[Tex/LaTex] Adding a dot over greek letter in text mode

accentsgreektext-mode

I have searched but have not found a solution to the following problem. I am trying to shift the location of a dot accent over a greek letter using the textgreek package. However, the dot is shifted left of the letter. I've seen solutions to solve this problem in math mode, however I would like to use the greek letter in text mode. Any help would be greatly appreciated.

A minimal working example would look like this.

\documentclass[9pt,twocolumn,twoside,lineno]{article}

\usepackage{textgreek}

\begin{document}

     I would like this \.{\textgamma}, and not
     $\dot{\gamma}$ this.

\end{document}

Best Answer

The stackengine package defaults to text mode stacking and can be used here. Note 9pt is not a valid document class setting (valid settings are 10pt, 11pt, and 12pt). The optional argument to \stackon defines the gap between letter and dot.

\documentclass[twocolumn,twoside,lineno]{article}

\usepackage{textgreek,stackengine}

\begin{document}

     I would like this \stackon[1pt]{\textgamma}{.}, and not
     $\dot{\gamma}$ this.

\end{document}

enter image description here

One could create a general definition \textdot{} as

\documentclass[twocolumn,twoside,lineno]{article}
\usepackage{textgreek,stackengine}
\newcommand\textdot[1]{\stackon[1pt]{\csname text#1\endcsname}{.}}

\begin{document}

     I would like this \textdot{gamma}, and not
     $\dot{\gamma}$ this.

     \textdot{beta}\textdot{Gamma}\textdot{delta}\textdot{epsilon}

\end{document}

enter image description here