3

Hey guardians of knowledge, I need to create special symbols by stacking letters and a reversed version of \u{}. The problem is that diacritics like \u{} come with a predefined character area (try \fbox{\u{}} to see what I mean). When I turn the diacritic around, this area overlaps at the bottom (or top) of the line and makes it overly tall, causing a gap in running text. I tried to cut this character area using \adjustbox, but that doesn't help in all cases (and can even cause the diacritic to leave the area). How can I delete the character area entirely, leaving just the plain diacritic?

MWE:

\documentclass[12pt]{scrartcl}
\usepackage{blindtext,fp,stackengine,adjustbox}
\renewcommand\stacktype{L}

\begin{document}
\blindtext
\stackon[-5pt]{u}{\adjustbox{trim=0 10 0 0,scale={1}{-1},fbox}{\u{}}}
\blindtext
\end{document}

PS: Yes, I checked The Comprehensive LATEX Symbol List and I can't use any of the proposed characters or other diacritics. Not that I didn't try…

1
  • What letters do you expect will receive the underaccent?
    – egreg
    Mar 7, 2016 at 13:23

2 Answers 2

2

If the letters you want to add the underaccent below don't have descenders, here's a simple way:

\documentclass[12pt]{scrartcl}
\usepackage{graphicx,blindtext}

\newcommand{\rub}[1]{%reversed under breve
  \leavevmode
  \vphantom{#1y}%
  \smash{\ooalign{#1\cr\hidewidth\scalebox{1}[-1]{\raisebox{-1ex}{\u{}}}\hidewidth\cr}}%
}

\begin{document}

{\fboxsep=0pt\fbox{\rub{u}\rub{a}\rub{e}}}

\blindtext
\rub{u}
\blindtext
\end{document}

enter image description here

enter image description here

A version that places the reversed breve above or below depending on whether the character has descenders or not.

For slanted shapes one would need some corrections, though.

\documentclass[12pt]{scrartcl}
\usepackage{graphicx}

\makeatletter
\DeclareRobustCommand{\rb}[1]{%reversed breve
  \leavevmode\sbox8{#1}%
  \ifdim\dp8>\p@
    \rb@above
  \else
    \rb@below
  \fi
}
\newcommand\rb@below{%
  \vphantom{g\copy8 }%
  \smash{\ooalign{\box8\cr\hidewidth\scalebox{1}[-1]{\raisebox{-1ex}{\u{}}}\hidewidth\cr}}%
}
\newcommand\rb@above{%
  \vphantom{\u{\copy8}}%
  \vbox{\offinterlineskip\ialign{##\cr
    \smash{\scalebox{1}[-1]{\raisebox{-1.85ex}{\u{}}}}\cr
    \copy8\cr
  }}%
}

\begin{document}

{\fboxsep=0pt\fbox{\rb{u}\rb{a}\rb{e}}}

{\fboxsep=0pt\fbox{\rb{g}}}\u{g}

\rb{a}\rb{b}\rb{c}\rb{d}\rb{e}\rb{f}\rb{g}\rb{h}\rb{i}

abcdefghi
\end{document}

enter image description here

4
  • Aligning on the baseline works well for diacritics under the character (I indeed don't need it for characters with descenders), but what about placing it above – can your code be easily modified to allow aligning the diacritic to the top end of the character?
    – dessert
    Mar 7, 2016 at 19:30
  • This is much too low-level for me and I have absolutely no idea what I'm doing here, but by totally misusing other people's work I was able to find a good solution for placing the diacritic above the character: \newcommand{\rob}[1]{\leavevmode\vbox{\offinterlineskip\ialign{\hfil##\hfil\cr\scalebox{1}[-1]{\u{}}\cr\noalign{\kern+.1ex}#1\cr}}}
    – dessert
    Mar 7, 2016 at 19:52
  • @dessert I added a version that places the reversed breve above or below automatically.
    – egreg
    Mar 7, 2016 at 22:58
  • In the above version, the diacritic isn't centered corrently with mathpazo. Replacing ## by \hfil##\hfil does the trick.
    – dessert
    Mar 8, 2016 at 11:12
0

This handles glyphs of various heights and depths. The [-1ex] can be adjusted to tweak the underset amount.

\documentclass[12pt]{scrartcl}
\usepackage{blindtext,stackengine,graphicx}
\newcommand\rb[1]{%
  \setbox0=\hbox{#1}%
  \stackunder[-1ex]{#1}{{\raisebox{\ht0}{\scalebox{-1}{\u{}}}}}%
}
\begin{document}
\blindtext
\rb{u}\rb{L}\rb{g}\rb{t}
\blindtext
\end{document}

enter image description here

You must log in to answer this question.

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