21

As linguistics student, I have to put more than one thing on a character every now and then.

For example, I need to type ā̆. I thought I could simply do that by typing \={\u{a}}, but then the macron is placed above an empty space in front of the character.

\documentclass{article}\begin{document}\={\u{a}}\end{document}

output: unwanted behaviour

How can I solve this?

I use MiKTeX 2.9, running on Windows 8.

3
  • 4
    Please add a minimal working example (MWE) that illustrates your problem. It will be much easier for us to reproduce your situation and find out what the issue is when we see compilable code, starting with \documentclass{...} and ending with \end{document}.
    – egreg
    Commented Feb 8, 2014 at 12:33
  • The covington package seems to do that.
    – Bernard
    Commented Feb 8, 2014 at 13:28
  • 1
    The problem looks well-defined to me; it is reproducible simply by wrapping documentclass{article}\begin{document} and \end{document} around the code posted. The character does not show well here in SO either, since web browsers are not good at using multiple diacritics. Commented Feb 8, 2014 at 14:44

5 Answers 5

15

I suggest you to use XeLaTeX with UTF-8 encoding and fontspec for direct character inputing. Charis SIL and Brill fonts are enhanced so as to handle diacritic stacking. SIL distributes an IPA keyboard which lets you enter diacritics or you can use the Characters Map in windows.

Here's a code sample with output.

\documentclass{article}
\usepackage{fontspec}
   \setmainfont{Charis SIL}

\begin{document}

ẵ̊́ b̥̩̬̪

\end{document}

Diacritic stacking

1
  • 6
    Gentium is a wonderful font for this purpose as well. It's beautiful (IMHO…) and has excellent support of diacritics. Commented Feb 10, 2014 at 21:33
11

Using the tipa package, \textipa{\u=a} yields

typeset example of an 'a' with double diacritics

2
  • Or \textbrevemacron{a}
    – Fran
    Commented Dec 15, 2017 at 2:20
  • Doesn't work with small caps!
    – Mattia
    Commented Oct 20, 2021 at 19:31
7

This is well suited for a stack. Here, I set a \={} atop a \u{a}, such that the baseline of the former is 0.4pt above the nominal baseline. You may tweak that value, as I have done in the second combination, if you want separation between the diacritics.

Other diacritic combinations pose no problem, using the same technique.

\documentclass{article}
\usepackage{stackengine}
\begin{document}
\renewcommand\stacktype{L}
\stackon[0.4pt]{\u{a}}{\={}}\ 
\stackon[2pt]{\u{a}}{\={}}
\end{document}  

enter image description here

If one wanted the macron on the bottom, the one would stack \u{} atop \={a}.

1
  • @mico, I thought I did, when the OP wrote "I need to type ā̆." The way it looks on my screen, the diacritics were overlapped. I will add an alternate solution, though. Commented Feb 8, 2014 at 22:27
4

Using @Bernard’s hint, I checked the covington package, and its documentation says: “LaTeX doesn’t give you a convenient way to put two accents on the same letter” and introduces some macros for the purpose. There are special macros for combining acute, grave, or circumflex with macron, and a more general macro twoacc for combining two accents, with a peculiar syntax: “its arguments are in square brackets, not curly brackets, and are separated by |. The first argument is the upper accent (only) and the second argument is the letter with the lower accent indicated.” So in your case you could use, after

\usepackage{covington}

the command

\twoacc[\=|\u{a}]

or have the accents differently nested with

\twoacc[\u|\={a}]

This works, but especially the first one does not give a very impressive result (the diacritics are too far from each other):

enter image description here

(In Latin grammars and dictionaries, the latter form seems to be more common, when indicating that a vowel may be either long or short. And the result for it looks actually better than in my old Latin books.)

3

Here is a better solution, though not perfect: il you compile with xelatex or lualatex and load the fontspecpackage, you can "nest" the accents command. The only restriction is that the corresponding character does exist in the font. If it doesn't exist a workaround is to use the analog commands for accents in mathmode (e.g. \u for text mode becomes \breve in mathmode. As math letter are set in italic by default, you also have to use the \mathrmcommand – unless you want to use italic.

Below is a code that demonstrates all this:

\documentclass[a4paper, 12pt] {article}%

\usepackage[no-math]{fontspec}%
\setmainfont{Heuristica}

\usepackage{fourier}
\usepackage{covington}

\begin{document}

\begin{tabular}{@{}cc}
Math mode: & Covington: \\[6pt]
  $ \breve{\bar{\mathrm a}} $ & \twoacc[\u|\={a}]
 \end{tabular}\\[6pt]

 With fontspec + Heuristica:\\[6pt]
\verb+\={\u a}+ work:\enspace \={\u a},\\
\verb+\~{\^a}+ and \verb+\~{\u a}+ work: \enspace\~{\^a},\ \~{\u a}\\
as well as \verb+ \^{\~ a}+ and \verb+\u{\~ a}+:\enspace \^{\~ a},\ \u{\~ a}.\\

 \fontspec{Minion Pro}
 With fontspec + Minion Pro:\\[6pt]
\verb+\={\u a}+ doesn’t work: \enspace \={\u a}\enspace,\\
 \verb+\~{\^a}+ and \verb+\~{\u a}+ work:\enspace \~{\^a},\ \~{\u a}\\
but \verb+ \^{\~ a}+ and \verb+\u{\~ a}+ don’t:\enspace\^{\~ a}\enspace, \u{\~ a}~\enspace (the order matters)

\end{document} 

enter image description here

5
  • A bit off topic. What quality are you referring to?
    – Manuel
    Commented Feb 8, 2014 at 22:57
  • It's because it is a little off topic that I added at the end of my answer. Concerning the quality, just look at the images in the other answers and compare with mine. I suppose I missed something.
    – Bernard
    Commented Feb 8, 2014 at 23:20
  • I just compiled mine with pdflatex, opened in Acrobat and took a snapshot of the zoomed in document.
    – CaringDev
    Commented Feb 8, 2014 at 23:30
  • OK. Didn't think of taking a snapshot after zooming. Thanks for the tip.
    – Bernard
    Commented Feb 8, 2014 at 23:47
  • I think the big images you see are (possibly) snapshots from large displays or (I think most of them) from MacBooks Retina.
    – Manuel
    Commented Feb 9, 2014 at 0:00

You must log in to answer this question.

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