I want to type Hebrew text in tikz.
EDIT: I am expanding the discussion about inserting the text into a rectangle of specific text width.
I tried the following code, after reading this answer and this one, yet I guess I am not using the text effect correctly.
\documentclass{article}
\usepackage[showframe]{geometry}
\usepackage{tikz}
\usetikzlibrary{decorations.text}
\usepackage{polyglossia}
\setmainlanguage{hebrew}
\setotherlanguage{english}
\newfontfamily\englishfont{Times New Roman}[Script=Latin,Language=English]
\newfontfamily\hebrewfont{Arial}[Script=Hebrew]
\begin{document}
לורם איפסום
\begin{center}
\begin{tikzpicture}
\node (hebrew-with-textwidth)[%
color=red,%
text width=3cm,%
align=right,%
decorate,%
% {decoration={text effects={reverse text}}} % What is the correct syntax?
]
{אחת שתיים שלוש ארבע חמש שש};
\end{tikzpicture}
\end{center}
\end{document}
I want the words in the node to be reversed, as here:


decoratebut don't really specify thedecorationor the text that should be reversed. A decoration does decorate a path (the rectangular one from the node in this case), not the text of a node. If you want to use the decoration on text you need to use a horizontal line that is decorated like the linked answer showed. But this is a different thing that right-to-left text. If that should show up correctly, it needs another technic, one that would be independent from TikZ. – Qrrbrbirlbel Oct 18 '22 at 18:10\node[...] {\texthebrew{אחת שתיים שלוש ארבע חמש שש}}. You should also be able to use the optionfont=\selectlanguage{hebrew}(for example, for the node). – Jasper Habicht Oct 25 '22 at 17:53