I am trying to produce wide grave and acute accents. Following \widetilde and \widehat from The TexBook and https://texwelt.de/fragen/26664/breiter-gravis-fur-pdflatex/26908 , I went on with
\documentclass{article}
\pagestyle{empty}
\usepackage{graphicx}
\usepackage[T1]{fontenc}%%% we do wish this if we stick to pdflatex
\usepackage{newtxtext}%%% we do wish this if we stick to pdflatex
\usepackage[slantedGreek,subscriptcorrection]{newtxmath}%%% we do wish if we stick to pdflatex
\newcommand{\widegraveA}{\mathaccent"0012 }
\newcommand{\wideacuteA}{\mathaccent"0013 }
\makeatletter
\newcommand\wideacuteB[1]{%
\mathchoice
{\@wideaccent{\displaystyle}{#1}{\mathchar"7013}{-1.06ex}{1}{1}}
{\@wideaccent{\textstyle}{#1}{\mathchar"7013}{-1.05ex}{1}{1}}
{\@wideaccent{\scriptstyle}{#1}{\mathchar"7013}{-.75ex}{1}{1}}
{\@wideaccent{\scriptscriptstyle}{#1}{\mathchar"7013}{-.54ex}{1}{1}}
}
\newcommand\widegraveB[1]{%
\mathchoice
{\@wideaccent{\displaystyle}{#1}{\mathchar"7012}{-1.06ex}{1}{1}}
{\@wideaccent{\textstyle}{#1}{\mathchar"7012}{-1.05ex}{1}{1}}
{\@wideaccent{\scriptstyle}{#1}{\mathchar"7012}{-.75ex}{1}{1}}
{\@wideaccent{\scriptscriptstyle}{#1}{\mathchar"7012}{-.54ex}{1}{1}}
}
\newcommand{\@wideaccent}[6]{
\setbox\@tempboxa\hbox{$\m@th#1#2$}%
\@tempdima=\ht\@tempboxa
\@tempdimb=\wd\@tempboxa
\ooalign{%
\box\@tempboxa\cr
\hidewidth\raise\dimexpr\@tempdima#4\relax\hbox{\resizebox{#5\@tempdimb}{#6\height}{$\m@th#1#3$}}\hidewidth
}%
}
\makeatother
\begin{document}
\(\widegraveA{\mathit{loop}}, \widegraveA{\mathit{pool}}, \widegraveA{\mathit{buffer}}, \widegraveA{\sigma_k}, \wideacuteA{\mathit{loop}}, \wideacuteA{\mathit{pool}}, \wideacuteA{\mathit{buffer}}, \wideacuteA{\sigma_k}\)\\
\(\widegraveB{\mathit{loop}}, \widegraveB{\mathit{pool}}, \widegraveB{\mathit{buffer}}, \widegraveB{\sigma_k}, \wideacuteB{\mathit{loop}}, \wideacuteB{\mathit{pool}}, \wideacuteB{\mathit{buffer}}, \wideacuteB{\sigma_k}\)
\end{document}
As you see, \wideacuteA and \widegraveA don't stretch the grave and acute at all, and \wideacuteB and \widegraveB produce sometimes accents uncentered, too far left, too far right, too narrow, too near to the text, or too far from the text:
Why?
How to make
\mathaccentstretch the accents?How to make
\widegraveBand\wideacuteBproduce non-ugly (or at least less ugly) accents?
PS. In this particular question, we do wish T1 and NewTX fonts with the given options. Moreover, the order of preference of text under the wide acute and grave is this, ordered from most to least important:
\sigma_k,\mathit{buffer},\mathit{loop}and\mathit{pool},\mathit{sum},- all other multiletter maths.
We handle the unicode engines in Wide acute and wide grave for TeX Gyre Termes and TeX Gyre Termes Math .




e^{x}and\exp(x), then one can be used for short/narrow input, the other for more complex input. – daleif Aug 16 '21 at 13:20\acuteand\graveare ideal, so, the sloped lines better not differ from the accents too much . Second disadvantage: the drawn sloped lines do not produce anything in the PDF text layer, whereas the above\widegraveBand\wideacuteBdo produce the acutes and the graves in the text. – Aug 16 '21 at 21:13\widetildeand\widehatfrom TeX; the end user and the content author do not need to know how difficult the different kinds of extensible accents are typeset internally and why. – Aug 16 '21 at 21:30\wideacuteBand\widegraveBin general and strictly better only in some aspects (not necessarily in all). – Aug 16 '21 at 21:33\mathaccent; you could add to it or try to expand on the\widegraveBand\wideacuteBmacros. – Aug 18 '21 at 11:39