Tikz 用希伯來文掃描節點內文字的位置

Tikz 用希伯來文掃描節點內文字的位置

由於某種原因,第二個節點的文字沒有印在節點的框中,而是印在 tikzpicture 的完全相反的一側。

關於如何修復它有什麼想法嗎?

\documentclass{beamer}
\usepackage{tikz}
\usetikzlibrary{positioning,backgrounds}

\usepackage[english,hebrew,bidi=basic,provide=*]{babel}
\babelfont[hebrew]{sf}[Script=Hebrew]{Arial}

\begin{document}
\begin{frame}
\begin{tikzpicture}[background rectangle/.style={fill=gray!33}, show background rectangle]

\node [draw,text width=0.75\textwidth, align=left, outer sep=0pt,inner sep=0pt](n1) {%
לורם איפסום דולור סיט אמט.
};

\node [draw,below = 0pt of n1.south east,anchor=north east,outer sep=0pt,inner sep=0pt](n2) {%
שלום עולם};
\filldraw (n2) circle (1pt);
\end{tikzpicture}
\end{frame}
\end{document}

螢幕截圖

(MWE 與投影機一起使用,但也與文章和書籍一起發生)

答案1

新增package選項layout=graphics,即:

\usepackage[english,hebrew,bidi=basic,layout=graphics,provide=*]{babel}

在此輸入影像描述

答案2

\noindent請注意,無論選項為何,在環境之前插入 atikzpicture都會導致問題保留layout=graphics

與在環境之前插入文字相同:

\documentclass{article}
%% same preamble as in Javier Bezos' answer
\begin{document}
אבג% so there is no \par command before the tikzpicture
\begin{tikzpicture}
〈same code〉
\end{tikzpicture}
\end{document}

在此輸入影像描述

相關內容