3

I am trying to typeset song lyrics in Hindi, where I want a bar over an "a" and an "i". I found \={} and \macron{} which both produce a nice bar over an "a", but the bar over an "i" (without the dot) is too long for my taste, because the bars appear connected when an "i" follows an "a" as in S\={a}\={\i} S\macron{a}\macron{\i}:

enter image description here

Is there a way I can make the bar over an "i" shorter?

Mensch
  • 65,388
Qrt
  • 131
  • A somewhat kludgy but quick solution: Insert a typographic kern between \={a} and \={\i}, i.e., write something like S\={a}\kern1pt\={\i}. – Mico Apr 04 '16 at 19:38
  • Thanks for pointing me to the original question. I have used Tobi's smartmacron to achieve a nice result. – Qrt Apr 11 '16 at 15:58

2 Answers2

4

You can use \vbox{\halign{}} construction for this special case:

\def\macroni{\leavevmode\vbox{\offinterlineskip\ialign{\hfil##\hfil\cr 
   \vrule height.03em width.25em\cr\noalign{\kern.13em}\i\cr}}}
\let\macronori=\=
\def\=#1{\ifx\i#1\macroni\else\macronori{#1}\fi}

S\=a\={\i} 
wipet
  • 74,238
2

Rather than shorten the length of the macron bar, I'd consider inserting a very thin "kern" (non-discardable whitespace) ahead of the \={\i} part. In the example below, I've chosen a kern of 0.5pt; feel free to adjust the width of the kern to suit you needs. Note that the kern is needed only if \={\i} is preceded by another macron-endowed character.

enter image description here

\documentclass{article} 
\newcommand\imacron{\kern0.5pt\={\i}}
\begin{document}
S\={a}\imacron\ vs.\ S\={a}\={\i}
\end{document}
Mico
  • 506,678