3

I am trying to use a cyrillic glyph as a symbol for a proportionality factor. It's the ӄ and its unicode number is 04C4 (see unicode page). So i crawled the english web for information on this, and after about 3 hours i managed to include the glyph in my text with

\usepackage[T2B, T1]{fontenc}   <- so it selects T1 as standard, but has T2B available
\usepackage{lmodern}            <- don't know if this is needed, but i guessed it might me useful for having a font with cyrillic support.

within the document:
`{\fontencoding{T2B}\selectfont \CYRKHK}`

This prints the glyph in ordinary text. In math mode it's possible to get it with a nifty workaround: enclose the above in \text{} (see here. This solution works somehow, but it is really crappy. For instance it doesn't work for lots of other good looking cyrillic letters, like ҟ U+049F (-> "Undefined control sequence." error). And i don't even want to think about, how agonising it would be, to include Japanese glyphs as well.

So the real question is: is there a simple and robust way to include any kind of glyph, i can find in unicode? Say a Katakana like ャ U+30E3, next to a cyrillic glyph, next to a Bengali ন U+09A8. Typing this into stackexchange without any problem raises an obvious second question: is Firefox actually better at typesetting unicode symbols, than latex? O.o

What i've tried, that didn't work somehow:

  • using \DeclareUnicodeCharacter{<number>}{\<command to place the thing>} with \usepackage[utf8]{inputenc} -> \DeclareUnicodeCharacter isn't defined for some reason (beyond my latex horizon). There was another method with \newunicodecharacter or something like that (can't remember). That did nothing at all.

  • using XeTeX -> no change, exept that other stuff broke. I returned to pdflatex. So this would not work.

  • using the package mathtext -> nothing happend

  • using the package cyrillic -> fails to load, even though it is installed with TeXlive.

My current configuration:

\RequirePackage{fix-cm}
\documentclass[12pt,index=totoc,bibliography=totoc,ngerman, BCOR=12mm]{scrreprt}

%header
\usepackage[T2B, T1]{fontenc}
\usepackage{lmodern}
\usepackage[utf8]{inputenc}
\usepackage[ngerman]{babel}

\usepackage[reqno]{amsmath}
\usepackage{amssymb}

\usepackage[svgnames,table,hyperref]{xcolor}
\definecolor{dblue}{rgb}{0 0.447 0.741}
\usepackage{lipsum}
\usepackage{graphicx}

\usepackage{listing}
\usepackage{matlab-prettifier}
\usepackage{rotating}
\usepackage{flafter}
\usepackage{subfig}
\usepackage{makeidx}
\usepackage[german,noprefix]{nomencl}
\usepackage[format=hang,labelformat=simple,font={small,sf},labelfont={small,sf},textfont={small,sf}]{caption}
\usepackage{booktabs}
\usepackage{setspace}
\usepackage{subfloat}
\usepackage[colorlinks,linkcolor=dblue,pagebackref]{hyperref}
4

If you're not short of math symbol fonts, you can define a new one:

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

\DeclareSymbolFont{cyrillic}{X2}{cmr}{m}{n}
\SetSymbolFont{cyrillic}{bold}{X2}{cmr}{bx}{n}

\DeclareMathSymbol{\khk}{\mathord}{cyrillic}{139}

\begin{document}

$a+\khk(b)_{\khk(b)}$

\end{document}

The advantage of the X2 encoding is that it covers all (well, almost all) glyphs in the various Cyrillic encodings.

enter image description here

If you're short of symbol fonts, a less efficient solution is to use \text.

\documentclass{article}
\usepackage[X2,T1]{fontenc}
\usepackage{amsmath}

\DeclareRobustCommand{\khk}{%
  \mathord{\text{\usefont{X2}{cmr}{m}{n}\symbol{139}}}%
}

\begin{document}

$a+\khk(b)_{\khk(b)}$

\end{document}

You can change the type of the math atom, if it is not \mathord, into something else (\mathrel, if it should be a relation symbol).

You can also use directly the letter in the formulas, with UTF-8. This is for the second solution, the first one will work the same.

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

\DeclareUnicodeCharacter{04C3}{\khk}

\DeclareRobustCommand{\khk}{%
  \mathord{\text{\usefont{X2}{cmr}{m}{n}\symbol{139}}}%
}

\begin{document}

$a+Ӄ(b)_{Ӄ(b)}$

\end{document}

Sorry, no Japanese or Bengali, this way. Think to your readers who would have a hard time in deciphering those symbols.

  • Yup, thanks. That works for the cyrillics. Though i'd really like to use a few symbols of other languages as well. The sad truth is that most of the Latin, and Greek glyphs are overloaded with meaning. In my oppinion using strange symbols isn't a problem for the reader, as long as a nomenclature is provided. I will probably include a phonetic remark in there. – Malibu Feb 14 '17 at 0:12
  • 1
    @Malibu I think the opposite. – egreg Feb 14 '17 at 0:20
  • +1, How do I find the list of {\mathord}{cyrillic}? How do you know what is {139} and which one is Zhe Ж ж ? – wonderich May 20 at 1:43
  • @wonderich See the fonttable package. – egreg May 20 at 6:16
  • thank you -- but I do not find a link, do you have a link to? Zhe Ж ж ? – wonderich May 20 at 20:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.