3

\documentclass{article} \usepackage{amsmath,amsthm} \usepackage{unicode-math}

\DeclareMathAlphabet{\CMcal}{OMS}{cmsy}{m}{n} \SetMathAlphabet{\CMcal}{bold}{OMS}{cmsy}{b}{n} \DeclareMathAlphabet{\CMbfcal}{OMS}{cmsy}{b}{n}

\setmainfont{TeX Gyre Pagella} \setmathfont{XITS Math}

\setmathfont[range=\symscr]{Euler-Math.otf} \setmathfont{NewCMMath-Book.otf}[range={cal, bfcal}] \setmathfont{texgyrepagella-math.otf}[range=]

\newcommand{\pot}{\ensuremath \raisebox{1.07pt}{$\male$}} \newcommand{\pow}{\CMcal{P}}

\usepackage{fontawesome} %\usepackage{fontspec} \usepackage{hyperref} \begin{document}

I can write special fonts as $\male$ and $\pow$, combined with arguments, and special mathematical fonts under Unicode, Fontspec and so Lualatex as here. But how may one write letters from, e.g., the Cyrillic alphabet, and, presumably by extension, other Unicode Blocks, while using such a preamble as above?

\end{document}

9
  • 2
    A quick hint: To pretty-print LaTeX code, open the edit window, highlight the code block in question, and click on the {} "button" in the ribbon above the edit window.
    – Mico
    Commented Aug 11 at 4:03
  • 1
    Off-topic: I would replace \newcommand{\pot}{\ensuremath \raisebox{1.07pt}{$\male$}} with \newcommand{\pot}{\vcenter{\hbox{$\male$}}}. By the way, the unicode-math package loads the fontspec package automatically
    – Mico
    Commented Aug 11 at 4:13
  • 2
    the \ensuremath in \newcommand{\pot}{\ensuremath \raisebox{1.07pt}{$\male$}} will stop it working outside math mode as you witll get $\raisebox${1.07pt}{$\male$}} Commented Aug 11 at 8:06
  • 1
    No, absolutely not. By performing this step now, you actually fully undid the pretty-printing edit I applied some hours ago.
    – Mico
    Commented Aug 11 at 16:18
  • 1
    How about if you apply the suggested editing step one more time, so that you can really get the hang of it? (By the way, you left out the line \end{document} from your edit...)
    – Mico
    Commented Aug 11 at 16:18

2 Answers 2

2

If you want just a few words in Cyrillic script, choose a font that supports it.


\documentclass{article}
\usepackage{amsmath,amsthm}
\usepackage{unicode-math}
\usepackage{fontawesome}
\usepackage{hyperref}

\DeclareMathAlphabet{\CMcal}{OMS}{cmsy}{m}{n}
\SetMathAlphabet{\CMcal}{bold}{OMS}{cmsy}{b}{n}
\DeclareMathAlphabet{\CMbfcal}{OMS}{cmsy}{b}{n}

\setmainfont{TeX Gyre Pagella}
\newfontfamily{\cyrfont}{Tempora}[Scale=MatchUppercase]

\setmathfont{XITS Math}
\setmathfont[range=\symscr]{Euler-Math.otf} 
\setmathfont{NewCMMath-Book.otf}[range={cal, bfcal}] 
\setmathfont{XITS Math}[range=]

\makeatletter
\newcommand{\pot}{\mathord{\raisebox{\depth}{$\m@th\male$}}}
\makeatother
\newcommand{\pow}{\CMcal{P}}

\DeclareTextFontCommand{\cyrtext}{\cyrfont}

\begin{document}

I can write special fonts as $\pot$ and $\pow$, combined with 
arguments, and special mathematical fonts under Unicode, Fontspec 
and so Lualatex as here. But how may one write letters from, 
e.g., the Cyrillic alphabet, and, presumably by extension, other 
Unicode Blocks, while using such a preamble as above?

\cyrtext{Фёдор Михайлович Достоевский} (after 1918)

\cyrtext{Ѳедоръ Михайловичъ Достоевскій} (before 1918)

\end{document}

A few notes.

  1. Packages should be loaded first
  2. A fixed amount of raising is wrong
  3. \ensuremath\raisebox only works by accident and \ensuremath is completely useless
  4. The purpose of the last math font declaration with range= is to restore the math font parameters to the main math font, which is XITS Math (I'd use STIX Two Math, though).

output

If you need whole paragraphs in, say, Ukrainian, load babel with the needed languages and look at the package documentation for how to set fonts for the specific languages.

1
3

But how may one write letters from, e.g., the Cyrillic alphabet?

Easy: Start using a text font package that provides Cyrillic letters.

For the example at hand, I take it that you wish to employ a Times Roman font. I suggest you replace

\setmainfont{TeX Gyre Pagella}

with

\setmainfont{XITS}

You must log in to answer this question.

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