artisticat1 / obsidian-tikzjax

Render LaTeX and TikZ diagrams in your notes

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How to typeset Cyrillic characters in tikzpicture nodes?

Blezz-tech opened this issue · comments

This code not working:

\usepackage{tikz}
\usetikzlibrary{positioning}
\tikzstyle{center} = [align=center]

\begin{document}
	\begin{tikzpicture}[domain=0:4]
	    %Nodes
	    \node[center] (InfiniteFractions) {Бесконечные дроби};
	    \node[center] (PeriodicFractions) [below left  = of InfiniteFractions] {
	        Переодические: \\
	        0,(6); 7,7(8) \\
	        $\frac{22}{7}$; 6,(1)
	    };
	    \node[center] (NonPeriodicFractions) [below right = of InfiniteFractions] {
	        Непериодические: \\
	        $\pi \approx 3,1415926535$ \\
	        $e \approx 2,71828182846$
	    };
	    %Lines
	    \draw[->] (InfiniteFractions.south) -- (PeriodicFractions.north);
	    \draw[->] (InfiniteFractions.south) -- (NonPeriodicFractions.north);
	\end{tikzpicture}
\end{document}

But if you remove the words with Cyrillic characters, then it works:

\usepackage{tikz}
\usetikzlibrary{positioning}
\tikzstyle{center} = [align=center]

\begin{document}
	\begin{tikzpicture}[domain=0:4]
	    %Nodes
	    \node[center] (InfiniteFractions) {InfiniteFractions};
	    \node[center] (PeriodicFractions) [below left  = of InfiniteFractions] {
	        PeriodicFractions: \\
	        0,(6); 7,7(8) \\
	        $\frac{22}{7}$; 6,(1)
	    };
	    \node[center] (NonPeriodicFractions) [below right = of InfiniteFractions] {
	        NonPeriodicFractions: \\
	        $\pi \approx 3,1415926535$ \\
	        $e \approx 2,71828182846$
	    };
	    %Lines
	    \draw[->] (InfiniteFractions.south) -- (PeriodicFractions.north);
	    \draw[->] (InfiniteFractions.south) -- (NonPeriodicFractions.north);
	\end{tikzpicture}
\end{document}

I am not sure what could be the problem?