# Horn accent in LaTeX

Sorry if the question is so trivial. I've just started using LaTeX couple of weeks ago and till now it's so new to me. I was trying to finish my name in a report where it's required to type a diacritic mark Horn in the document (something such as ư Ư or ơ Ơ). However, it seems not to be supported in LaTeX as I can find nearly all other accents such as grave, acute, circumflex here in Wiki but not this horn ư or Ơ, isn't it?

I've also refer to some methods that support Unicode characters but it seems a way too far. I just need a horn on a character u and o and that's all.

I'm using MiKTex 2.9 and Texmaker.

• Also take a look at Typesetting any language, Vietnamese for example. – Jake Jul 18 '12 at 12:07
• Welcome to TeX.SX! I believe that closing this question as duplicate is wrong and I voted for reopening it, as there are at least two very simple methods for getting the glyphs which aren't really covered in the "Comprehensive list of symbols". – egreg Jul 18 '12 at 13:15
• Thanks everybody for very useful contribution from which I actually found the way around. Because my need is pretty simple, so I think my simple solution is adequate. I use \usepackage[utf8]{inputenc} \usepackage[vietnam,english]{babel} and for everytime I want to type vietnamese, simply use \foreignlanguage{vietnam}{vietnamese text with full accents} I think with this way around, the topic should be closed :) Thank you – AugustineLee Jul 24 '12 at 6:36

The horn accent is not available as a standalone glyph. However, as explained in the Comprehensive List of LaTeX Symbols, the four glyphs you need are available in the T5 encoding for Vietnamese.

You can access them with very easy definitions:

\documentclass{article}
\usepackage[T5,T1]{fontenc}
\usepackage[utf8]{inputenc}

\DeclareTextSymbolDefault{\OHORN}{T5}
\DeclareTextSymbolDefault{\UHORN}{T5}
\DeclareTextSymbolDefault{\ohorn}{T5}
\DeclareTextSymbolDefault{\uhorn}{T5}

\begin{document}
\OHORN \ohorn \UHORN \uhorn

ƠơƯư

\end{document}


The direct input shown in the example is possible only if the .tex document is UTF-8 encoded. The input "by name" doesn't need it.

If you need to typeset Vietnamese words, the simplest method is to add the Babel support for it to the document and segregate the words as arguments to \textviet:

\documentclass{article}
\usepackage[T5,T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[vietnam,english]{babel}

\begin{document}
\textviet{\OHORN \ohorn \UHORN \uhorn}

\textviet{ƠơƯư}

\end{document}


However you need a main font that supports the encoding. Other than Computer Modern, support is available with Latin Modern, all TeX Gyre fonts, and also the "Standard 35 Postscript" fonts.

Some words about \DeclareTextSymbolDefault. The definition of \OHORN we find in t5enc.def is

\DeclareTextSymbol{\OHORN}{T5}{204} % Ohorn


which is complemented in t5enc.dfu (which is read by inputenc) by

\DeclareUnicodeCharacter{01A0}{\OHORN} % LATIN CAPITAL LETTER O WITH HORN


There are similar definitions for the other three glyphs.

However, LaTeX can't do anything with \OHORN if the current encoding is not T5. A solution would be to say

{\fontencoding{T5}\selectfont\OHORN}


but it's too complicated, so \DeclareTextSymbolDefault{\OHORN}{T5} comes to the rescue. It acts by just doing \OHORN if the current encoding is T5, {\fontencoding{T5}\selectfont\OHORN} otherwise.

One always needs to load the output font encoding with fontenc.

This loading is automatically performed if the vietnam is passed to babel. The command \textviet will typeset its argument with the T5 encoding active. So what strategy is to be preferred depends on what's really needed in the document. If only the four glyphs are needed in some cases, probably the first one is more economic; if Vietnamese words are to be typeset, then the second method is preferable.

The glyphs are in the T5-encoding (for vietnamese). You can access them e.g. like this:

\documentclass{article}
\usepackage[T5,T1]{fontenc}

\begin{document}
normal text {\fontencoding{T5}\selectfont \char"CC, \char"D7, \char"EC, \char "F7}
\end{document}


If your normal text font doesn't support T5 then another fontfamily will be substituated which can lead to glyphs which don't match well.

If you don't wish to live under the restricted (T5 supported) font sets mentioned in the other answers, you can always roll your own glyphs. Of course, the numerical shifts may have to be tailored for the font.

\documentclass{article}
\usepackage{stackengine}
\usepackage{scalerel}
\def\stackalignment{r}
\def\shortcomma{\vstretch{.7}{,}}
\newcommand\OHORN{\topinset{\shortcomma}{O}{.1ex}{.1ex}}
\newcommand\ohorn{\topinset{\shortcomma}{o}{.1ex}{-.1ex}}
\newcommand\UHORN{\topinset{\shortcomma}{U}{.05ex}{-.05ex}}
\newcommand\uhorn{\topinset{\shortcomma}{u}{.05ex}{-.1ex}}
\begin{document}
\OHORN\ohorn\UHORN\uhorn
\end{document}