3

I'm using xelatex to write some grammatical remarks of biblical Hebrew. I need a different color for some vowels, for example, to illustrate some suffixes. I can't get a correct position of vowel when I change the color. In the MWE you get twice the expression "my horse". Note the different position of vowel.

enter image description here

I review some other similar questions (posted here 10 years ago or more, with no solutions at the time).

% !TEX program = xelatex
\documentclass{minimal}
\usepackage{xcolor}
\usepackage{polyglossia} 
\setdefaultlanguage{english}  
\setotherlanguages{hebrew}
\newfontfamily\hebrewfont[Scale=5]{SBL Hebrew} 
\def\r{\color{red}}
\begin{document}

\begin{hebrew}
      סוּסִי
  סוּס\r ִי
\end{hebrew}
\end{document}

I added here also an image of the expected result in xelatex, but made with Inkscape.

desired result (made with Inkscape)1

4
  • 2
    Try with lualatex + luacolor (and perhaps babel instead of polyglossia). Luacolor doesn't insert a special. And do not use the minimal class, it is too minimal, use article instead. Commented May 11 at 6:03
  • 1
    Color can be problematic in bidi texts with xelatex. I’ suggest switching to lualatex, which is now the recommended engine. See an example here: es.overleaf.com/learn/latex/… Commented May 11 at 6:08
  • 1
    see also tex.stackexchange.com/a/698800/1090 Commented May 11 at 7:38
  • And also: tex.stackexchange.com/questions/26765/…. Commented May 11 at 15:28

1 Answer 1

2

Following the advice given by Ulrike Fischer and Javier Bezos, here's an approach that uses LuaLaTeX, babel, and luacolor instead of XeLaTeX, polyglossia, and color.

enter image description here

% !TEX program = lualatex
\documentclass{article}

\usepackage{luacolor}
\def\r{\color{red}}

\usepackage[english, bidi=default]{babel}
\babelprovide[import]{hebrew}
\babelfont{rm}{SBL Hebrew}

\begin{document}

hello \foreignlanguage{hebrew}{סוּס\r ִי} world

\end{document}
0

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.