3

This question already has an answer here:

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?

marked as duplicate by egreg, user13907, diabonas, Werner, LaRiFaRi Apr 4 '16 at 20:46

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • 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 4 '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
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} 
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}

Not the answer you're looking for? Browse other questions tagged or ask your own question.