# TexStudio - polyglossia - xelatex : how to create symbols

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

• Just input Р (U+0420 CYRILLIC CAPITAL LETTER ER) – egreg Aug 1 '15 at 19:47
• – cfr Aug 1 '15 at 23:34
• @barbarabeeton No, the character will survive copy-pasting. – egreg Aug 2 '15 at 8:04
• @barbarabeeton The code point is preserved. Marking Russian text with \foreignlanguage or other means is for getting correct hyphenation. – egreg Aug 2 '15 at 8: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 2 '15 at 8:12

## 1 Answer

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.

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