6

Because the beginning of the letter is moved a bit to the left when in italics mode, the breve also needs to move to the left,otherwise it is no longer under the letter.

\documentclass{article}
\usepackage{semtrans}
\begin{document}
Right position: \U{h}

Wrong position: \textit{\U{h}}
\end{document}

Sample output

Any ideas how to correctly use a breve with italics?

arved
  • 296

2 Answers2

10

The package is old and the definition is missing a \ltx@sh@ft that helps correct such positioning. A more modern definition for the \U macro is

\newcommand*\U[1]{\oalign{#1\crcr\hidewidth\ltx@sh@ft{-3ex}%
   \vbox to .2ex{\hbox{\u{}}\vss}\hidewidth}}

In your own file you will need to enclose this in a \makeatletter...\makeatother pair. If you are loading the semtrans package you will need to use \renewcommand* instead.

Sample output

\documentclass{article}
\usepackage{semtrans}

\makeatletter
\renewcommand*\U[1]{\oalign{#1\crcr\hidewidth\ltx@sh@ft{-3ex}%
   \vbox to .2ex{\hbox{\u{}}\vss}\hidewidth}}
\makeatother

\begin{document}
Upright position: \U{h}

Italic position: \textit{\U{h}}
\end{document}

The above is modelled on the definition of the \b accent defined in the LaTeX kernel, namely:

\DeclareTextCommand{\b}{OT1}[1]
   {\hmode@bgroup\o@lign{\relax#1\crcr\hidewidth\ltx@sh@ft{-3ex}%
     \vbox to.2ex{\hbox{\char22}\vss}\hidewidth}\egroup}

You could thus mimic this completely and use

\makeatletter
\DeclareTextCommand{\U}{OT1}[1]
  {\hmode@bgroup\o@lign{\relax#1\crcr\hidewidth\ltx@sh@ft{-3ex}%
  \vbox to.2ex{\hbox{\u{}}\vss}\hidewidth}\egroup}
\makeatother
Andrew Swann
  • 95,762
5

The simplest way these days is probably to use xelatex (used for the image here) or lualatex.

enter image description here

\documentclass{article}

\usepackage{fontspec}

\begin{document}

zzz ḫ

\textit{zzz ḫ}

\end{document}
David Carlisle
  • 757,742