## LaTeX forum ⇒ Math & Science ⇒ How to produce wide grave and wide acute accents?

Information and discussion about LaTeX's math and science related features (e.g. formulas, graphs).
user49915
Posts: 52
Joined: Wed Apr 17, 2019 12:51 pm

### How to produce wide grave and wide acute accents?

Consider the input

\RequirePackage{ifthen}\RequirePackage{ifxetex,ifluatex}\newif\ifxetexorluatex\ifxetex  \xetexorluatextrue\else  \ifluatex    \xetexorluatextrue  \else    \xetexorluatexfalse  \fi\fi \documentclass{standalone}\ifxetexorluatex\tracinglostchars=2\usepackage{fontspec}\usepackage[ngerman]{babel}\usepackage{mathtools}\mathtoolsset{mathic=true}\usepackage{amssymb}\usepackage[math-style=ISO]{unicode-math}\setmainfont[Ligatures=TeX]{TeX Gyre Termes}\setsansfont{TeX Gyre Heros}[Scale=0.88]\setmonofont{TeX Gyre Cursor}\setmathfont[Ligatures=TeX]{TeX Gyre Termes Math}\else\usepackage[T2A,T1]{fontenc}\usepackage[utf8]{inputenc}\usepackage[ngerman]{babel}\usepackage{newtxtext}\usepackage[slantedGreek]{newtxmath}\usepackage{courier}\usepackage{mathtools}\mathtoolsset{mathic=true}\usepackage{amssymb}\usepackage{stmaryrd}\fi\usepackage[babel=true,verbose=errors]{microtype}\usepackage{csquotes}\begin{document}$$\grave{x}$$ $$\acute{x}$$ $$\grave{\mathsf{sum}}$$ $$\acute{\mathsf{sum}}$$\end{document}

When running xelatex or pdflatex, we get an output such as

1E5Ty.jpg (11.76 KiB) Viewed 332 times

Lualatex puts the accent on m rather than centered.

How to get the grave and acute accents such that

- they are slightly wider and extend with the width of the argument (similar to \widehat or \widetilde, e.g.) if the argument has at least two letters and

- they default to the standard \grave and \acute if the argument is a single letter

?

This question asks for macros \widegrave{...} and \wideacute{...}. A solution has to work with all three engines {pdf|xe|lua}latex, produce centered accents in any case, and work with the packages listed in the MWE. How much the accents should be extended is a matter of taste, but two rules definitely make sense:

- The accents should clearly not extend beyond the left and right bounds of the argument in case it has 2 letters or more.

- The accents should be at least as wide as the standard grave/acute accents in any case.

Crosspost: http://tex.stackexchange.com/questions/ ... te-accents