# Non-math mode diacritic: macron does not replace dots on characters

I'm writing summaries of Buddhist texts for class. Sometimes you have words like this: Pīti. Intuitively I use \={i}. But when I use that, then the macron goes above the dot of the i. How can I rename the command that the macron replaces the dot of the i? Or is there another intuitive command that I can use?

I mean, sure I can just copy/paste the unicode character the whole time, but there's probably a better solution. Should the document class be fixed?

What I have done: I have looked into related questions. Try to think of good search words for Google, couldn't think of any. A short Google search with the query: remove the dot above i latex diacritic didn't work.

Minimal example:

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


It's possible to leave the encoding out as well.

Note: after a long search I did find a solution. I will post it as the answer, so that other people with the same problem find this more easier. I also didn't know what to tag it (the tag diacritic does not exist).

• Just FWI, googling "i with accent LaTeX" brings up this as its first result. The wikibook is far from perfect, but does contain this information, including the \i solution, which is just under the table in section 2. Not meaning to be snarky, of course! Just to give you a pointer, finding what you need with LaTeX can be an art, I'm sure it took me a few years :) – Au101 Sep 18 '16 at 15:27
• Thanks, I have no good strategies for fighting against search word scavenger hunts (that's how I call them) other than kind of searching and typing in new words in the search engine. It is one of the places that I eventually stumbled upon for my answer. – Melvin Roest Sep 18 '16 at 15:28
• It's a bit of a #@!~ sometimes because google strips punctuation, more or less, and that can really complicate matters! – Au101 Sep 18 '16 at 15:29

If you want \={i} to act as \={\i} then you just need

\documentclass{article}

\DeclareTextCompositeCommand{\=}{OT1}{i}{\=\i}
\begin{document}
\={i}
\end{document}


or better declare it for T1 encoding, and use

\usepackage[T1]{fontenc}


Other accents such as \"{i} are already defined to act as \"{\i} but only for cases where the pre-composed character is in the T1 encoding, which isn't the case for any characters using \=.

However as others have said, since you are using inputenc it's probably easier to just use ī as direct input.

As you're using inputenc with UTF-8, you could input it directly ī

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


In fact it's hard to see how inputenc benefits you at all in your MWE, if you're going to go right ahead and use the LaTeX commands!

I wouldn't advise copying and pasting the character, though, you should use an international keyboard layout with support for this. That's not really a LaTeX question, though.

If, like me, though, you prefer ASCII-input, using fontspec and rendering with XeLaTeX will do this automatically.

\documentclass{article}
\usepackage{fontspec}
\begin{document}
\={i}
\end{document}


Although, again, you can use the character directly

\documentclass{article}
\usepackage{fontspec}
\begin{document}
ī
\end{document}


Otherwise, as you say, \={\i} will do the trick for you.

\documentclass{article}

\begin{document}
\={\i}
\end{document}


Works with both pdfLaTeX and XeLaTeX.

• Well... I don't know why I use inputenc to be honest. It is in my standard boilerplate for every project. I am like you, preferring ascii. I'm currently shying away from XeLaTeX, because I don't know if anything will break or if the setup will be hard. Thanks for showing when to use XeLaTeX and when to use pdfLaTeX. – Melvin Roest Sep 18 '16 at 15:24
• @MelvinRoest took me a while to learn how to XeTeX but then I realised there was actually nothing much to it. It's not XeTeX itself, anyway, more the packages that go with it. But either XeTeX or LuaTeX will be borderline essential if you ever want to include any non-Roman characters, such as Devanagari, or Thai, or Sinhala or whatever. Certainly there is Devanagari support using ASCII-only input, but it's really not worth the effort – Au101 Sep 18 '16 at 15:32

I stumbled accross the fact that you can write a dotless i in LaTeX as \i. So the command becomes \={\i} and it will work.

I'm curious how I could set this command to \={i} that I wouldn't know.