![如何在 RTL Beamer 文档中正确显示 Tikz 流程图](https://linux22.com/image/477678/%E5%A6%82%E4%BD%95%E5%9C%A8%20RTL%20Beamer%20%E6%96%87%E6%A1%A3%E4%B8%AD%E6%AD%A3%E7%A1%AE%E6%98%BE%E7%A4%BA%20Tikz%20%E6%B5%81%E7%A8%8B%E5%9B%BE.png)
\documentclass[hyperref=unicode]{beamer}
\usepackage{hologo}
\mode<presentation>{\usetheme{Warsaw}}
\usepackage[nil,bidi=basic-r]{babel}
\babelprovide[import=ar-DZ, main]{arabic}
\babelprovide[import,language=Default]{english}
\babelfont{rm}{Amiri}
\babelfont{sf}{Amiri}
\usepackage{beamer-rl}
\usepackage{tikz}%
\usetikzlibrary{shapes.geometric, arrows}
\begin{document}
\begin{frame}
\tikzstyle{block} = [rectangle, draw, fill=blue!20, text width=4em, text centered, rounded corners, minimum height=3em]
\tikzstyle{line} = [draw, -latex']
\begin{tikzpicture}[node distance = 2.6cm, auto]
\node [block] (init) {start};
\node [block, left of=init] (Start2) {test};
\node [block, left of=Start2] (Start3) {test2};
\node [block, below of=init] (init3) {process};
\node [block, below of=init3] (End) {end};
\node [block, left of=init3] (End1) {end1};
\node [block, left of=End] (End2) {end2};
\path [line] (init) -- (Start2);
\path [line] (init3) -- (End1);
\path [line] (End) -- (End2);
\end{tikzpicture}
\end{frame}
\end{document}
答案1
作为一个简单的解决方法,您可以切换english
回tikzpicture
:
% !TeX TS-program = lualatex
\documentclass[hyperref=unicode]{beamer}
\usepackage{hologo}
\mode<presentation>{\usetheme{Warsaw}}
\usepackage[nil,bidi=basic-r]{babel}
\babelprovide[import=ar-DZ, main]{arabic}
\babelprovide[import,language=Default]{english}
\babelfont{rm}{Amiri}
\babelfont{sf}{Amiri}
\usepackage{beamer-rl}
\usepackage{tikz}%
\usetikzlibrary{shapes.geometric, arrows}
\begin{document}
\begin{frame}
\tikzset{block/.style={rectangle, draw, fill=blue!20, text width=4em,text centered, rounded corners, minimum height=3em},
line/.style={draw, -latex'}}
\begin{otherlanguage}{english}
\begin{tikzpicture}[node distance = 2.6cm, auto]
\node [block] (init) {start};
\node [block, left of=init] (Start2) {test};
\node [block, left of=Start2] (Start3) {test2};
\node [block, below of=init] (init3) {process};
\node [block, below of=init3] (End) {end};
\node [block, left of=init3] (End1) {end1};
\node [block, left of=End] (End2) {end2};
\path [line] (init) -- (Start2);
\path [line] (init3) -- (End1);
\path [line] (End) -- (End2);
\end{tikzpicture}
\end{otherlanguage}
\end{frame}
\end{document}