11

I want to typeset the double acute accent (also known as Hungarian umlaut, usually typeset with \H{}) in a font that does not have it. Is there an easy way to "fake" it with two single accents?

Minimial example:

\documentclass[12pt]{article}
\pagestyle{empty}
\usepackage[T1]{fontenc}
\newcommand*{\augie}[1]{\fontfamily{augie}\selectfont #1}
\begin{document}
\augie{Erdos Erd\'os Erd\H{o}s}
\end{document}

Result:

MWE

egreg
  • 1,121,712
Boris Bukh
  • 1,374

3 Answers3

9

Here's a macro that tries a precise calculation based on the height of the character

\newcommand\fH[1]{\sbox0{#1}\dimen0=\ht0 \advance\dimen0 -1ex
  \sbox2{\'{}}\sbox2{\raise\dimen0\box2}%
  {\ooalign{\hidewidth\kern.1em\copy2\kern-.5\wd2\box2\hidewidth\cr\box0\crcr}}}

and the result of

Erd\fH{o}s

Erd\H{o}s

\fontfamily{augie}\selectfont

Erd\fH{o}s

Erd\'{o}s

enter image description here

Perhaps it's better to use \kern-.5\wd2 for the augie font

enter image description here

egreg
  • 1,121,712
7

You can switch font just for the accent then back to the text font so get a real \H accent from another font, but as this font is quite stylized it might look better to do as you say and use two acute accents from this font, you could adjust the spacing a bit more, but this shows the two approaches;

enter image description here

\documentclass[12pt]{article}
\pagestyle{empty}
\usepackage[T1]{fontenc}
\def\fakeH{\rlap{\'{}\'{}}}
\newcommand*{\augie}[1]{\fontfamily{augie}\selectfont #1}
\begin{document}


\augie{Erdos Erd\'os  Erd\fakeH{o}s  Erd{\rmfamily\H{\augie o}}s}
\end{document}
David Carlisle
  • 757,742
3

Defining new accents is difficult to get right. There is a package (not on ctan) described in http://www.eutypon.gr/eutypon/pdf/e2000-05/e05-a04.pdf which you can try. The package can be found at https://github.com/zellyn/accentbx.

    \makeaccent[options]<shifts>{accent-character}{main-character}
yannisl
  • 117,160