3

When using a \colorbox (or derivates such as framed's shadedbox) with Hebrew and pdflatex, the color stack seems to get confused:

pdfTeX warning: pdflatex: pop empty color page stack 0

and the output is wrong (black background color).

Is there a workaround for this issue? (I am aware that XeTeX/bidi works, but I want to know whether there is also some way in [pdf]latex)

\documentclass{article}

\usepackage{color}
\definecolor{shadecolor}{rgb}{1, 0, 0}

\usepackage[hebrew]{babel}

\begin{document}
\colorbox{shadecolor}{test}
\end{document}
  • Can you please explain how you are using Latex or Lyx In hebrew? I tried to fix the problem after I moved from Lyx 2.2 to lyx 2.3, but I could not find a solution. what font packages are you using? – Jneven Aug 15 at 13:32
  • @Jneven I use DavidCLM, but please ask on lyx-users for more information. – JSpitzm Aug 15 at 14:16
1

Answering my own question: it seems that wrapping into \beginL...\endL seems to work:

\documentclass{article}

\usepackage{color}
\definecolor{shadecolor}{rgb}{1, 0, 0}

\usepackage[hebrew]{babel}

\begin{document}
\beginL\colorbox{shadecolor}{test}\endL
\end{document}

AFAICS Hebrew text in the box maintains the correct direction.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.