4

I'm using TexStudio to write my thesis and I just changed to polyglossia and xelatex because I'm need to write down words in a lot of different languages. Since I do this however, a lot of commands from TexStudio don't work anymore, e.g. \textless, all the cyrillic caracters like \CYRR, etc.. Can you tell me what's the problem and how I can change it ?

My introduction lines :

\documentclass[10pt,a4paper,final]{book}

\usepackage{amsmath}    
\usepackage{amsfonts}    
\usepackage{amssymb}    
\usepackage{makeidx}    
\usepackage{graphicx}    
\usepackage{fontspec}    
\setmainfont{Times New Roman}    
\usepackage{polyglossia}    
\setmainlanguage{french}   
\setotherlanguages{english,german,latin,italian,spanish,russian,greek}    
\newcommand{\og}{\guillemotleft~}    
\newcommand{\fg}{~\guillemotright}    
\usepackage{multicol}    
\setlength{\columnsep}{1.5cm}    
\setlength{\columnseprule}{0.2pt}     
\usepackage[left=2.00cm, right=2.00cm, top=2.20cm, bottom=2.20cm]{geometry}    
\newcommand{\myparagraph}[1]{\paragraph{#1}\mbox{}\\}  

\begin{document}    
\CYRR    
\end{document}  

File log : ! Undefined control sequence. \CYRR

Bianca
  • 63
  • 2
    Just input Р (U+0420 CYRILLIC CAPITAL LETTER ER) – egreg Aug 01 '15 at 19:47
  • Related: http://tex.stackexchange.com/questions/30829/how-to-insert-greek-with-ascii-keyboard-and-xetex-polyglossia?rq=1. – cfr Aug 01 '15 at 23:34
  • @barbarabeeton No, the character will survive copy-pasting. – egreg Aug 02 '15 at 08:04
  • @barbarabeeton The code point is preserved. Marking Russian text with \foreignlanguage or other means is for getting correct hyphenation. – egreg Aug 02 '15 at 08:09
  • @egreg -- okay, got it. i was reading the suggestion in two separate parts; the fact that the unicode value is the necessary bit slipped right over my head. – barbara beeton Aug 02 '15 at 08:12

1 Answers1

1

You don't need \CYRR or \textless, nor defining \og and \fg:

\documentclass[10pt,a4paper,final]{book}

\usepackage{fontspec}
\usepackage{polyglossia}

\setmainfont{Times New Roman}
\setmainlanguage{french}
\setotherlanguages{english,german,latin,italian,spanish,russian,greek}

\newrobustcmd{\RU}[1]{\foreignlanguage{russian}{#1}}

\begin{document}

Texte en « français ».

Texte en «français».

Une «Р» en l'alphabet cyrillique! L'espace entre
le mot e le point d'exclamation est correct.

Un mot en russe \RU{Русский}: et voilà.

\begin{english}
There is no need to use \verb|\textless|, because
typing \texttt{<} gives <.
\end{english}

\end{document}

Single Cyrillic characters are not a problem, but for words or phrases that you may want the hyphenation to be correct, there are the usual methods: \foreignlanguage or the environments otherlanguage and otherlanguage*. Polyglossia adds also environments based on the language name. However, you might want the \RU markup also for single letters, in order to see what they are.

enter image description here

You see that I took the picture with the Cyrillic ER selected; indeed, I copied it an pasted in the main window of UnicodeChecker (great free software for Mac OS X), resulting in

enter image description here

egreg
  • 1,121,712