4

I am attempting to typeset the character in LaTeX by stacking a raised period on top of the letter o. The spacing for the results I've achieved is inconsistent, as you can see in the below screenshot:

poorly kerned o͘

Note that the space after the character is larger than the space after a regular o character.

Although I can try to hand-tune the spacing, I would like a more general solution that also does not rely on a font containing the special character.

Here is a MWE:

\documentclass{article}

\newlength{\templen}
\newlength{\templentwo}

\newcommand{\oo}{%
  \settowidth{\templen}{o}%
  \settowidth{\templentwo}{.}%
  o\hspace{\dimexpr-\templen/2\relax}%
  \raisebox{1ex}{.}%
  \hspace{\dimexpr-\templentwo\relax}
}

\begin{document}

o\oo o \oo oo \oo\oo o ooo

\end{document}

Update

With the help of the provided answers, I've arrived on the following solution. For future reference, I include the entirety of my code, showing the typesetting of the character with other diacritics.

\documentclass{article}

\usepackage{stackengine}
\usepackage{upquote}

\renewcommand{\.}[1]{\stackinset{c}{}{t}{-0.75ex}{\textquotesingle}{#1}}

\newcommand{\OX}{o\DOTABOVERIGHT{o}{0.6}\leavevmode\phantom{o}}
\DeclareRobustCommand{\DOTABOVERIGHT}[2]{%
  \kern-\fontcharwd\font`#1% back up
  \makebox[0pt][l]{%
    \sbox0{\leavevmode\phantom{#1}}%
    \raisebox{\ht0}[0pt][0pt]{\kern#2\wd0 .}%
  }%
}

\newcommand{\OO}[1]{\stackinset{r}{}{t}{-1.5pt}{.}{#1}}



\begin{document}

So-i goan u siat pat-mih e hoat-to, eng peh-oe-ji lai in-chheh, ho lin cheng-lang khoa\textsuperscript{n} khah khoai bat.

S\OO{\'{o}}-\'{i} g\'{o}an \={u} siat p\.{a}t-mih \^{e} hoat-t\OO{\={o}}, \={e}ng p\.{e}h-\={o}e-j\={i} l\^{a}i \`{i}n-chheh, h\OO{\={o}} l\'{i}n ch\`{e}ng-l\^{a}ng kh\`{o}a\textsuperscript{n} khah kh\`{o}ai bat.

S\'{\OX}-\'{i} g\'{o}an \={u} siat p\.{a}t-mih \^{e} hoat-t\={\OX}, \={e}ng p\.{e}h-\={o}e-j\={i} l\^{a}i \`{i}n-chheh, h\={\OX} l\'{i}n ch\`{e}ng-l\^{a}ng kh\`{o}a\textsuperscript{n} khah kh\`{o}ai bat.

Thai-khong peng-iu, lin-ho. Lin chiah-pa--be? U-eng, toh lai gun chia che--o!

Th\`{a}i-khong p\^{e}ng-i\'{u}, l\'{i}n-h\'{o}. L\'{i}n chi\.{a}h-p\'{a}--b\={e}? \={U}-\^{e}ng, t\.{o}h l\^{a}i g\'{u}n chia ch\={e}--\OO{\^{o}}!

Th\`{a}i-khong p\^{e}ng-i\'{u}, l\'{i}n-h\'{o}. L\'{i}n chi\.{a}h-p\'{a}--b\={e}? \={U}-\^{e}ng, t\.{o}h l\^{a}i g\'{u}n chia ch\={e}--\^{\OX}!


\end{document}

Here is an image of the typeset text:

properly kerned o͘

My personal preference is for the \OX version, where the diacritics properly appear above the .

2 Answers 2

3

If you want to preserve the automatic kerning between letters, you need to print the ‘o’ twice, superimposing them but adding, in the middle, a raised dot.

\documentclass{article}

\newcommand{\oo}{o\DOTABOVERIGHT{o}{0.6}o}
\DeclareRobustCommand{\DOTABOVERIGHT}[2]{%
  \kern-\fontcharwd\font`#1% back up
  \makebox[0pt][l]{%
    \sbox0{#1}%
    \raisebox{\ht0}[0pt][0pt]{\kern#2\wd0 .}%
  }%
}

\begin{document}

o\oo o \oo oo \oo\oo o ooo

ooo  ooo ooo ooo

\end{document}

The \DOTABOVERIGHT command takes two arguments: the letter the dot should be applied to and the amount of offset (as fraction of the letter width).

enter image description here

1
  • This solution has helped me get the best result. Although the superimposed letters resulted in a bold-like effect on my PDF viewer, I added \leavevmode\phantom in a couple places to make the superimposed letters invisible.
    – J. King
    Sep 3, 2020 at 16:18
4

If I understand well what you want, here is a solution with the \stackinset command from stackengine:

\documentclass{article}

\usepackage{stackengine}

\newcommand{\Oo}{\stackinset{r}{}{t}{-1.5pt}{.}{o}}

\begin{document}

o\Oo o \Oo oo \Oo\Oo o ooo

\end{document}

enter image description here

3
  • Thanks so much for this answer. You've answered my question exactly, but it doesn't provide the best result for my uses because I also need to add other diacritics. That said, you did answer another one of my questions about how best to add a different diacritic. If you would like, I can create a new question with that diacritic question for you to answer with this response.
    – J. King
    Sep 3, 2020 at 16:20
  • That would be a challenge for me! :-)
    – Bernard
    Sep 3, 2020 at 16:22
  • Here's the new question: tex.stackexchange.com/questions/561263/…
    – J. King
    Sep 3, 2020 at 16:44

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .