6

I'm working on a glossary with some transliterated Persian, Urdu and Arabic. Conforming with earlier publications, I sometimes need to use two diacritical dots under letters such as s, z and t. I've tried to solve this with \ooalign, inspired by the answer given here. I can now place two dots below these letters, but the problem is that as a result the spacing between letters is no longer pleasant. MWE:

\documentclass{article}
\usepackage[utf8]{inputenc}

\begin{document}

\newcommand{\dd}[1]{% \ooalign{#1\cr\hfil\raisebox{-.5ex}{..}\hfil}% }

\Huge{% \d{H}={a}fi\dd{z}, Shams-ud-D={\i}n Mu\d{h}ammad

Other examp\dd{l}e.% }

\end{document}

This yields:

example two diacritical points

How do I fix the letter spacing?

Parvana
  • 97

4 Answers4

6

Mimicking the plain definition for \d works well.

\makeatletter
\newcommand{\dd}[1]{{\o@lign{\relax#1\crcr \hidewidth\ltx@sh@ft{-1ex}.\kern-.1em.\hidewidth}}}
\makeatother

{\Huge \d{H}={a}fi\dd{z}, Shams-ud-D={\i}n Mu\d{h}ammad

Other examp\dd{l}e.%

}

output

Also, note that \Huge doesn't take an argument, but is a font switch command.

plante
  • 1,349
5

\ooalign is not the right tool.

\documentclass{article}

\DeclareRobustCcommand{\dd}[1]{% \vtop{% \offinterlineskip \ialign{% ##\cr % template #1\cr % top line \noalign{\vspace{0.25ex}}% space \hidewidth.\kern-0.1em.\hidewidth\cr % dots }% }% }

\begin{document}

\d{H}={a}fi\dd{z}, Shams-ud-D={\i}n Mu\d{h}ammad

Other examp\dd{l}e.

\end{document}

enter image description here

egreg
  • 1,121,712
5

With a very simple modification of your code:

    \documentclass{article}
    \usepackage[utf8]{inputenc}
\begin{document}

\newcommand{\dd}[1]{%
 \ooalign{#1\cr\hfil\raisebox{-.5ex}{\clap{..}}\hfil}%
    }

\Huge{%
\d{H}\={a}fi\dd{z}, Shams-ud-D\={\i}n Mu\d{h}ammad

Other examp\dd{l}e.%
}

\end{document} 

enter image description here

Bernard
  • 271,350
5

Totally different approach: Why not simply make use of Unicode's U+0323 COMBINING DOT BELOW and U+0324 COMBINING DIAERESIS BELOW?

Ḥāfiz̤, Shams-ud-Dīn Muḥammad

Other exampl̤e

Ingmar
  • 6,690
  • 5
  • 26
  • 47
  • 1
    (note that this only works in Unicode engines -- unless/until the LaTeX team decide to add support for it, but it doesn't look like the case now. The OP presumably is using pdflatex (or copy pasting some wrong code that use inputenc)) – user202729 Jun 29 '22 at 06:08
  • 2
    Yes, obviously this would require using either LuaLaTeX or XeTeX. That said, there is generally very little reason not to in the first place, particularly when support vor “exotic” languages or writing systems might be required. – Ingmar Jun 29 '22 at 06:12
  • @user202729 I believe the LaTeX team has said that Unicode combining characters are not going to work in 8-bit TeX, due to inherent architectural limitations. – Davislor Jun 29 '22 at 07:47
  • Ah right, only Unicode characters that already have the diacritic precomposed works. – user202729 Jun 29 '22 at 09:03