# problem generating Cyrillic text and Feynman diagrams together

I'm working on this file that has English and also passages in Cyrillic. I also have Feynman diagrams that I draw with tikz-feynman.

The issue is that if I compile with Latex I will get the text but the diagrams are not how they should be: The vertices are misplaced.

If I compile with Luatex I get the diagrams but not the Cyrillic writing.

These are the declarations used:

\documentclass{book}
\usepackage[english,russian]{babel}
\usepackage[utf8]{inputenc}
\usepackage{tikz-feynman}


I'm also using mactex with texshop as the editor. Perhaps if I define how to write Cyrillic that is understandable for Luatex everything will be ok but I don't know how to do that.

the code is:

\documentclass{book}
\usepackage[english,russian]{babel}
\usepackage[utf8]{inputenc}
\usepackage{tikz-feynman}

\title{Квантовая теория поле}

\begin{document}

\maketitle

\tableofcontents

\part{Часть II}

\chapter{Уравнение Дайсона}

Рассмотрим высшие имеются общие с

this line is just for debugging purposes

\begin{enumerate}
\item
\end{enumerate}

\begin{enumerate}
\item фотонные собств - диаграмм (ФСЭД)
\end{enumerate}

\begin{enumerate}
\item Вершинные диаграмм (ВД)
\end{enumerate}

\feynmandiagram [horizontal=a to b] {
i1 -- [fermion] a -- [fermion] i2,
a -- [photon] b,
f1 -- [fermion] b -- [fermion] f2,
};
\end{document}

• Welcome to TeX - LaTeX! Can you extend you code to include a sample diagram and text in both languages so we can see the problem. What, if any, font declarations do you make to get cyrillic? When you say compile with "Latex" do you mean latex or pdflatex? – Andrew Swann Jun 11 '17 at 13:21
• @AndrewSwann I added 2 photos for what happens if I compile with lulatex or latex. by compiling with latex I mean when I choose it from the drop down list in Texshop (top of the picture on the left) – Jeremy Jun 11 '17 at 13:25
• When providing sample code, please copy/paste it into the question so that we can then copy/paste it ourselves and reproduce the error; but thanks for providing a screenshot of the different PDF outputs. – JP-Ellis Jun 11 '17 at 13:26
• @JP-Ellis added the code as well, sorry. not used to stack exchange. – Jeremy Jun 11 '17 at 13:28

LuaLaTeX has a much improved font handling compared to LaTeX; however, it differs somewhat to that of LaTeX. In particular, LuaLaTeX can handle TrueType and OpenType fonts (.ttf and .otf) that you have most likely seen before.

The default font used by LuaLaTeX unfortunately does not have the appropriate glyphs to display Russian, but this can easily be changed using the fontspec package. For example, the Noto font can handle many many glyphs and works perfectly fine in LuaLaTeX. Obviously, you are free to adjust the font to your liking.

\documentclass{book}

%% Setup font and change it to one that handle Russian
\usepackage{fontspec}
\setmainfont{Noto Sans}

%% Language setup
\usepackage[english,russian]{babel}

%% Graphics
\usepackage{tikz-feynman}

\begin{document}
\chapter{Уравнение Дайсона}

Рассмотрим высшие имеются общие с

this line is just for debugging purposes

\begin{enumerate}
\item фотонные собств - диаграмм (ФСЭД)
\item Вершинные диаграмм (ВД)
\end{enumerate}

\feynmandiagram [horizontal=a to b] {
i1 -- [fermion] a -- [fermion] i2,
a -- [photon] b,
f1 -- [fermion] b -- [fermion] f2,
};
\end{document}


On the other hand, the reason why TikZ-Feynman (CTAN) is not working in LaTeX is because it doesn't have access to the Lua backend in order to automatically calculate where vertices should go. There's more information about this over at this question.

• The CMU Serif font (Computer Modern Unicode) can be a substitution for the default Latin Modern if Cyrillic or Greek text is to be typeset. It looks very similar. – Sergei Golovan Jun 11 '17 at 14:45