cyrillic letters in mathmode using pdfx

I want to convert a latex document into a pdf/a document. The latex document contains cyrillic letters as in the following example and compiles well without using the package {pdfx}.

\documentclass {amsbook}
\usepackage{amsmath}
\usepackage{mathtext}
\usepackage[T1,T2A]{fontenc}
\DeclareSymbolFont{T2Aletters}{T2A}{cmr}{m}{it}
\usepackage[utf8]{inputenc}
\begin{document}
$\CYRI^2$
\end{document}


This gives the following result

However, if want to use pdfx as in the following example

\documentclass {amsbook}
\usepackage{amsmath}
\usepackage{mathtext}
\usepackage[T1,T2A]{fontenc}
\DeclareSymbolFont{T2Aletters}{T2A}{cmr}{m}{it}
\usepackage[utf8]{inputenc}
\usepackage[a-1b]{pdfx}
\begin{document}
$\CYRI^2$
\end{document}


I get the warnings

pdfTeX warning: /usr/bin/pdflatex: fontmap entry for dummy-space' already exists, duplicates ignored


and

LaTeX Warning: Command \CYRI invalid in math mode on input line 11.


I know that it is problematic to use cyrillic letters as unicode in pdflatex. However changing to xelatex is not a solution for me since it changes a lot of formatting which I don't want.

pdfx version is 1.5.3

• In this 2015 TUG report, it states that "Work is ongoing to extend this input encoding to include macro denitions for more special characters (e.g., extended Latin, Cyrillic)," which suggests that it might not yet be possible. Dec 16 '15 at 17:58

I get no warning with TeX Live 2015, after removing the call to mathtext and defining a proper \MCI (Math Cyrillic I) symbol:

\documentclass{amsbook}
\usepackage{amsmath}
\usepackage[T1,T2A]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[a-1b]{pdfx}

\DeclareSymbolFont{T2Aletters}{T2A}{cmr}{m}{it}
\DeclareMathSymbol{\MCI}{\mathalpha}{T2Aletters}{"C8}

\begin{document}
$\MCI^2$
\end{document}


With pdfx (v.1.5.8) your example works if you change the package-loading order to become:

\documentclass {amsbook}
\usepackage[a-1b]{pdfx}%  ---- recommended to load it early
\usepackage{amsmath}
\usepackage{mathtext}
\usepackage[T1,T2A]{fontenc}
\DeclareSymbolFont{T2Aletters}{T2A}{cmr}{m}{it}
\usepackage[utf8]{inputenc}
\begin{document}
$\CYRI^2$
\end{document}


but it still fails, with a different set of errors, when the pdfx package is loaded late in the preamble, mostly related to the use of mathtext.sty.

This kind of package-order induced incompatibility is exactly what I'm working on for the next update of pdfx.sty. So thank you very much for this useful example.

I did some more exploring. This use of the mathtext package can produce problems, nothing to do with pdfx directly, but with \usepackage[unicode]{hyperref}. For example

\documentclass {amsbook}
\usepackage{amsmath}
\usepackage{mathtext}
\usepackage[T1,T2A]{fontenc}
\DeclareSymbolFont{T2Aletters}{T2A}{cmr}{m}{it}
\usepackage[utf8]{inputenc}
\usepackage[unicode]{hyperref}
\begin{document}
$\CYRI^2$
\end{document}


loses the \CYRI character. The .log file has revealing messages:

LaTeX Warning: Command \CYRI invalid in math mode on input line 9.

and

Missing character: There is no È in font cmr10!

Solution: load hyperref (or pdfx) before mathtext`.