[Tex/LaTex] How to get three diacritics on the same Greek letter

accentsgreek

I'm working on a document where I need to (or at least would like to) write Ancient Greek text that has long alphas (indicated with a macron above) that also have breathing marks and accent marks. I can get any two of those at the same time pretty easily, but not all of them. So, is there any way to get a macron, accent mark, and breathing mark on the same Greek letter (in pdflatex)?. I'm mainly using \greektext for the Greek, but if you have an answer that uses math mode, that'll work too.

Edit

In response to David's comment, here's a MWE for the closest I can get to it. I can get all the diacritics in close proximity, but can only ever get two of them to combine.

\documentclass{article}

\usepackage[T1]{fontenc}
\usepackage[polutonikogreek,english]{babel}
\usepackage{tipa}

\begin{document}

{\greektext >{\textipa{\'{\={\greektext a}}}}}

{\greektext {>{'\=a}}}

\end{document}

Best Answer

The teubner package defines a more comprehensive set of macros for combined accents, compared with @egreg's answer. Here's Table 4 from the documentation (teubner-doc.pdf):

enter image description here

Related Question