Why Does \usepackage[T2A]{fontenc} Override Other Settings?

cyrillicfont-encodingsfontslinguisticssans-serif

I want to produce a document with non-serif type. I also want to include Cyrillic characters. These two aims seem to be mutually exclusive. When I comment out \usepackage[T2A]{fontenc}, the document is beautiful, except that the Cyrillic characters won't print. When I include \usepackage[T2A]{fontenc}, the document is beautiful, but it is entirely a serif font.

Below is a MWE. Some of the preamble might seem a little bit goofy, but it's all included in my university's template (see link below). It will actually compile, but only with some encouragement
(see http://helpdesk.ufl.edu/wp-content/uploads/2012/12/latex_spring_2011.zip).

From what I've read, I think I need to load a different font family. But I'm not sure if that's right, or even how to do it.

How do I have a document that both includes Cyrillic characters and retains its sans serif font?

\documentclass{article}
\renewcommand{\rmdefault}{ma1}
\renewcommand{\sfdefault}{phv}
\renewcommand{\familydefault}{\sfdefault}
\usepackage{datetime}
\usepackage{qtree}
\usepackage[T1,T2A]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{tipa}
\usepackage{pgfplots}
\usepackage[authoryear]{natbib}
\usepackage{hypernat}
\usepackage[dvipdfm,hyperfootnotes=false]{hyperref}
\hypersetup{colorlinks=true,linkcolor=blue,anchorcolor=blue,citecolor=blue,filecolor=blue,urlcolor=blue,bookmarksnumbered=true,pdfview=FitB} \usepackage{gb4e}
\noautomath
\let\eachwordone=\sffamily
\let\eachwordtwo=\sffamily
\let\eachwordthree=\sffamily

\begin{document}

Todd is a cat. у меня есть машина. я очень харашо.

\end{document}

Best Answer

TeX fonts have only 256 slots. And you can't mix encodings without telling LaTeX to do it; \textcyrillic defined by babel with the russian option does this. The last specified encoding becomes the default one.


This should be a complete list of sans serif fonts available also in T2A encoding (for cyrillic):

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

\usepackage[russian,english]{babel}

\renewcommand{\familydefault}{\sfdefault}


\begin{document}

\renewcommand{\sfdefault}{PTSans-TLF}\normalfont
\section{PTSans}

Todd is a cat. \textcyrillic{у меня есть машина. я очень харашо.}


\renewcommand{\sfdefault}{fds}\normalfont
\section{Droid}

Todd is a cat. \textcyrillic{у меня есть машина. я очень харашо.}


\renewcommand{\sfdefault}{fco}\normalfont
\section{Comforta}

Todd is a cat. \textcyrillic{у меня есть машина. я очень харашо.}


\renewcommand{\sfdefault}{fca}\normalfont
\section{Cantarell}

Todd is a cat. \textcyrillic{у меня есть машина. я очень харашо.}


\renewcommand{\sfdefault}{iwona}\normalfont
\section{Iwona}

Todd is a cat. \textcyrillic{у меня есть машина. я очень харашо.}


\renewcommand{\sfdefault}{fos}\normalfont
\section{OpenSans}

Todd is a cat. \textcyrillic{у меня есть машина. я очень харашо.}

\end{document}

Of course the declarations should be given in the preamble, this is just to show the specimens.

enter image description here

With the following example, I show the result of having Helvetica (Arial is similar) for Latin text and one of the previous fonts for Russian text in cyrillic. Take your pick and define \sfcyrillic to the chosen family.

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

\usepackage[russian,english]{babel}

\renewcommand{\sfdefault}{phv}
\renewcommand{\familydefault}{\sfdefault}

\newcommand{\sfcyrillic}{} %%% Add here your preference
\usepackage{xpatch}
\xpatchcmd{\Russian}
  {\selectfont}
  {\fontfamily{\sfcyrillic}\selectfont}
  {}{}
\xshowcmd\Russian


\begin{document}

\renewcommand{\sfcyrillic}{PTSans-TLF}\normalfont
\section{PTSans}

Todd is a cat. \textcyrillic{у меня есть машина. я очень харашо.}


\renewcommand{\sfcyrillic}{fds}\normalfont
\section{Droid}

Todd is a cat. \textcyrillic{у меня есть машина. я очень харашо.}


\renewcommand{\sfcyrillic}{fco}\normalfont
\section{Comforta}

Todd is a cat. \textcyrillic{у меня есть машина. я очень харашо.}


\renewcommand{\sfcyrillic}{fca}\normalfont
\section{Cantarell}

Todd is a cat. \textcyrillic{у меня есть машина. я очень харашо.}


\renewcommand{\sfcyrillic}{iwona}\normalfont
\section{Iwona}

Todd is a cat. \textcyrillic{у меня есть машина. я очень харашо.}


\renewcommand{\sfcyrillic}{fos}\normalfont
\section{OpenSans}

Todd is a cat. \textcyrillic{у меня есть машина. я очень харашо.}

\end{document}

enter image description here