3

Is it somehow possible to enter the Russian word "Привет" (say) into a LaTeX document right from a standard English keyboard -- so that the document could then be correctly compiled? If not, what would be better ways to do this, without using a physical Russian keyboard? I need to have the TeX file in Russian. (I use MiKTeX 2.9 with Windows 7.)

This would not seem a difficult task, but I haven't been able to do this after spending hours on the Internet.

Iosif Pinelis
  • 387
  • 1
  • 12
  • there are some reliable transliterations of russian using the latin alphabet. one is described in the documentation for amsfonts, although i think most participants in this forum don't consider it mainstream. but if you're interested, i can provide more details tomorrow. – barbara beeton Oct 13 '17 at 00:36
  • If you have just to type some words in Russian you can use something like this : http://www.lexilogos.com/keyboard/russian.htm and write in LaTeX or XeLaTeX using the answers from here: https://tex.stackexchange.com/questions/816/cyrillic-in-latex. But If a whole book or a big article will be on Russian my answer doesn't really help. – koleygr Oct 13 '17 at 00:47
  • @barbarabeeton : I need the document to contain Russian words themselves, not their transliterations. – Iosif Pinelis Oct 15 '17 at 02:41
  • @koleygr : Thank you for your comment. I have ended up doing something like what you suggested. Would you like to make your comment a formal answer? – Iosif Pinelis Oct 15 '17 at 02:43
  • @IosifPinelis... Added (feel free to ask for any change) – koleygr Oct 15 '17 at 08:34

3 Answers3

3

Try this

\documentclass{article}
\usepackage[OT2,T1]{fontenc}
\begin{document}
Privet
{\fontencoding{OT2}\selectfont Privet}
\end{document}

The output:

enter image description here

  • Thank you for your answer. However, my question was not about how to get Russian words, such as "Привет", in the output (I knew that). It was about how to enter Russian words (not their transliterations) such as "Привет", into a LaTeX document right from a standard English keyboard -- so that the document could then be correctly compiled with LaTeX. – Iosif Pinelis Oct 15 '17 at 02:39
2

Answer just for some words in Russian:

There are some sites on the web that offers a keyboard in several languages.

Just type "Russian keyboard online" and you will find sites like below:

lexilogos.com/keyboard/russian.htm

http://russian.typeit.org/

http://www.apronus.com/internet/ruskey.htm

Then, you can use LaTeX to write Russian with babel help as described here:

https://tex.stackexchange.com/a/72690/120578:

MWE:

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

\begin{document}

Text in English

\begin{otherlanguage*}{russian}
Текст на русском языке
\end{otherlanguage*}

A word and another \foreignlanguage{russian}{слово}

\end{document}

Or XeLaTeX (to have the ability of using many fonts) like described here:

https://tex.stackexchange.com/a/835/120578:

MWE:

\documentclass{article}
\usepackage{fontspec} % loaded by polyglossia, but included here for transparency 
\usepackage{polyglossia}
\setmainlanguage{russian} 
\setotherlanguage{english}

% XeLaTeX can use any font installed in your system fonts folder
% Linux Libertine in the next line can be replaced with any 
% OpenType or TrueType font that supports the Cyrillic script.

\newfontfamily\russianfont[Script=Cyrillic]{Linux Libertine}

\begin{document}
Привет
\begin{english}
Hello! 
\end{english}
\end{document}

More here: tex.stackexchange.com/questions/816/cyrillic-in-latex.

koleygr
  • 20,105
  • Thank you again. I have now actually translated an entire paper (7 pages, math formulas about 50% of it) into Russian this way -- using actually http://russian.typeit.org/. It took me maybe 5 hours or so; I am a very poor typist. – Iosif Pinelis Oct 15 '17 at 13:57
  • lol.... Good luck and have a nice day! – koleygr Oct 15 '17 at 14:35
1

\foreignlanguage{russian}{\CYRP\cyrr\cyri\cyrv\cyre\cyrt} will work (provided you enabled Russian among the options to babel), but I don't think it's a very practical way.

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

\begin{document}

I can type \foreignlanguage{russian}{\CYRP\cyrr\cyri\cyrv\cyre\cyrt}
with an English keyboard.

Switching to a Russian keyboard allows \foreignlanguage{russian}{Привет}

\end{document}

enter image description here

egreg
  • 1,121,712
  • Thank you for your answer. However, my question was not about how to get Russian words, such as "Привет", in the output. It was about how to enter actual Russian words such as "Привет" (not their representations), into a LaTeX document right from a standard English keyboard -- so that the document could then be correctly compiled with LaTeX. – Iosif Pinelis Oct 15 '17 at 13:51
  • @IosifPinelis Then the question is off-topic, because it is specific of your operating system – egreg Oct 15 '17 at 15:20