1

I know that for inserting a cutout I can use the syntax as shown in this thread:

\cutout{r}(-4em,5\baselineskip)\shapepar{\squareshape}
cut cut cut cut cut cut cut cut cut cut cut cut cut cut cut cut
cut cut cut cut cut cut cut cut cut cut cut cut\par
text text text text text text text text text text text text text
< more text more text, ommited for saving space >
text text text text text text text text text text text text text

But when I tried to use this in a hebrew paragraph I get the following unfortunate result in LyX:

enter image description here

where I used this tex code inserted to LyX (same as the syntax before, but with hebrew text and some math, all in a RTL paragraph):

\cutout{r}(-4em,0\baselineskip)\shapepar{\squareshape}חיתוך חיתוך חיתוך חיתוך חיתוך חיתוךחיתוך חיתוך חיתוךחיתוך חיתוך חיתוךחיתוך חיתוך חיתוך\par אני חושב שזה רעיון נחמד, כי אם נוכל לחשב אינטגרל כדוגמת  $\iint\limits _{A}\frac{\sin\sin x^{2}}{x}\,\mathrm{dx}$ אז נוכל להוכיח בקלות השערת רימן, כי ברור! אני חושב שזה רעיון נחמד, כי אם נוכל לחשב אינטגרל כדוגמת  $\iint\limits _{A}\frac{\sin\sin x^{2}}{x}\,\mathrm{dx}$ אז נוכל להוכיח בקלות השערת רימן, כי ברור! אני חושב שזה רעיון נחמד, כי אם נוכל לחשב אינטגרל כדוגמת  $\iint\limits _{A}\frac{\sin\sin x^{2}}{x}\,\mathrm{dx}$ אז נוכל להוכיח בקלות השערת רימן, כי ברור!

and as you can see the cutout text sits in the wrong place! How can this be solved? If I use a LTR paragraph then the hebrew will be messed up.

Here is a minimal example of a LyX file I'm using (lyx generates a lot of lines for it's own use, so I can't make it shorter than this).

Update: Seems like the following works, though it looks a bit strange

\cutout{r}(-10em,0\baselineskip)\shapepar{\squareshape}{\text{\selectlanguage{hebrew}{צדיק צדיק צדיק צדיק צדיק צדיק צדיק צדיק צדיק צדיק צדיק צדיק צדיק צדיק צדיק צדיק צדיק צדיק צדיק צדיק צדיק צדיק צדיק}}}

\text{\selectlanguage{hebrew}{ימין אתרוג אתרוג אתרוג אתרוג אתרוג אתרוג אתרוג אתרוג אתרוג אתרוג אתרוג אתרוג אתרוג אתרוג אתרוג אתרוג אתרוג אתרוג אתרוג אתרוג אתרוג אתרוג אתרוג אתרוג אתרוג אתרוג אתרוג אתרוג אתרוג אתרוג אתרוג אתרוג אתרוג אתרוג אתרוג אתרוג אתרוג אתרוג אתרוג אתרוג אתרוג אתרוג אתרוג אתרוג אתרוג אתרוג אתרוג אתרוג אתרוג אתרוג אתרוג אתרוג אתרוג אתרוג אתרוג אתרוג אתרוג אתרוג אתרוג אתרוג אתרוג אתרוג אתרוג אתרוג אתרוג אתרוג אתרוג אתרוג אתרוג אתרוג אתרוג אתרוג אתרוג אתרוג אתרוג אתרוג אתרוג אתרוג אתרוג אתרוג אתרוג אתרוג אתרוג אתרוג אתרוג אתרוג אתרוג אתרוג אתרוג אתרוג אתרוג אתרוג אתרוג אתרוג אתרוג אתרוג אתרוג אתרוג אתרוג אתרוג אתרוג אתרוג אתרוג אתרוג אתרוג אתרוג אתרוג אתרוג}}

enter image description here

  • 1
    Are you able to post some small compilable code that demonstrates the issue, plus what packages you are using and what system. That way no one has to guess. and can be used to test solutions against and find one faster. I don't have lyx installed yet, but - for example - with lualatex, polyglossia and Miriam Libre font, if I set the cutout paragraph's width to 12em and push it down 4 and a bit em, \parbox{12em}{\selectlanguage{hebrew}\vspace{4.2em}...}, it comes out OK. The r parameter puts it on the right side in lualatex, so could be a lyx-specific matter, making code even more useful. – Cicada Sep 18 '22 at 12:27
  • 1
    What does adjusting the cutout's h- and v-offset parameters do (if anything)? – Cicada Sep 18 '22 at 12:30
  • @Cicada since I'm using lyx, I can try to share a minimal example of a lyx file, would that be ok? (It uses the culmus package for hebew) – snatchysquid Sep 18 '22 at 12:31
  • 1
    yes. (as long as it compiles) – Cicada Sep 18 '22 at 12:33
  • @Cicada WIll send in a few hours once I get home to the pc with the files and lyx installation :) – snatchysquid Sep 18 '22 at 12:37
  • 1
    Just add the code to the question, via edit. Meanwhile, I will install LyX. – Cicada Sep 18 '22 at 13:00
  • @Cicada Added. If I may suggest, this link can be helpful when installing LyX with hebrew support :) – snatchysquid Sep 18 '22 at 18:22
  • @Cicada As for your first comment, could you show me an example of a working file? I'm not sure I used the example code you've provided correctly. As for the 2nd comment, changing the offset didn't solve it, it does move the text around as you'd expect, but the text that should be cutout (on the right side) still appears on the left side – snatchysquid Sep 18 '22 at 18:27

1 Answers1

1

As per comment request.

Some illustrative manual tweaking of offsets and positioning.

Using lualatex and polyglossia - fonts are ruled out as the issue since the cutout can be moved in LyX.

asample

bsample

csample

MWE

\documentclass{article}
\usepackage{xcolor}
\usepackage{shapepar}
\usepackage{polyglossia}
\setmainfont{notoserif}
\setmainlanguage{english}
\setotherlanguage{hebrew}
\newfontfamily\hebrewfont{miriamlibre}

\begin{document}

\cutout{r}(-0.4\textwidth,1\baselineskip)\shapepar[1em]{\squareshape}% {\color{blue}\parbox{2in}{\selectlanguage{hebrew}\vspace{2.2em}% חיתוך חיתוך חיתוך חיתוך חיתוך חיתוךחיתוך חיתוך חיתוךחיתוך חיתוך חיתוךחיתוך חיתוך חיתוך }}\par\selectlanguage{hebrew}\noindent אני חושב שזה רעיון נחמד, כי אם נוכל לחשב אינטגרל כדוגמת
$\int\limits _{A}\frac{\sin\sin x^{2}}{x},\mathrm{dx}$ אז נוכל להוכיח בקלות השערת רימן, כי ברור! אני חושב שזה רעיון נחמד, כי אם נוכל לחשב אינטגרל כדוגמת
$\int\limits _{A}\frac{\sin\sin x^{2}}{x},\mathrm{dx}$ אז נוכל להוכיח בקלות השערת רימן, כי ברור! אני חושב שזה רעיון נחמד, כי אם נוכל לחשב אינטגרל כדוגמת
אז נוכל להוכיח בקלות השערת רימן, כי ברור! אני חושב שזה רעיון נחמד, כי אם נוכל לחשב אינטגרל כדוגמת
אז נוכל להוכיח בקלות השערת רימן, כי ברור! אני חושב שזה רעיון נחמד, כי אם נוכל לחשב אינטגרל כדוגמת
אז נוכל להוכיח בקלות השערת רימן, כי ברור! אני חושב שזה רעיון נחמד, כי אם נוכל לחשב אינטגרל כדוגמת
אז נוכל להוכיח בקלות השערת רימן, כי ברור! אני חושב שזה רעיון נחמד, כי אם נוכל לחשב אינטגרל כדוגמת
אז נוכל להוכיח בקלות השערת רימן, כי ברור! אני חושב שזה רעיון נחמד, כי אם נוכל לחשב אינטגרל כדוגמת
אז נוכל להוכיח בקלות השערת רימן, כי ברור! אני חושב שזה רעיון נחמד, כי אם נוכל לחשב אינטגרל כדוגמת
$\int\limits _{A}\frac{\sin\sin x^{2}}{x},\mathrm{dx}$ אז נוכל להוכיח בקלות השערת רימן, כי ברור! אני חושב שזה רעיון נחמד, כי אם נוכל לחשב אינטגרל כדוגמת
$\int\limits _{A}\frac{\sin\sin x^{2}}{x},\mathrm{dx}$ אז נוכל להוכיח בקלות השערת רימן, כי ברור! \ %\selectlanguage{hebrew} \hrule \vspace{2em}\selectlanguage{english} xxx -- \textit{switching languages has significance to layout}

\cutout{r}(-0.3\textwidth,7\baselineskip)\shapepar[1.3em]{\squareshape}% {\color{blue}\raisebox{-3.5ex}{\fcolorbox{red}{blue!14}{\parbox{10em}{\selectlanguage{hebrew}{\bfseries\small% חיתוך חיתוך חיתוך חיתוך חיתוך חיתוךחיתוך חיתוך חיתוךחיתוך חיתוך חיתוךחיתוך חיתוך חיתוך }}}}}\par\selectlanguage{hebrew} אני חושב שזה רעיון נחמד, כי אם נוכל לחשב אינטגרל כדוגמת
$\int\limits _{A}\frac{\sin\sin x^{2}}{x},\mathrm{dx}$ אז נוכל להוכיח בקלות השערת רימן, כי ברור! אני חושב שזה רעיון נחמד, כי אם נוכל לחשב אינטגרל כדוגמת
$\int\limits _{A}\frac{\sin\sin x^{2}}{x},\mathrm{dx}$ אז נוכל להוכיח בקלות השערת רימן, כי ברור! אני חושב שזה רעיון נחמד, כי אם נוכל לחשב אינטגרל כדוגמת
אז נוכל להוכיח בקלות השערת רימן, כי ברור! אני חושב שזה רעיון נחמד, כי אם נוכל לחשב אינטגרל כדוגמת
אז נוכל להוכיח בקלות השערת רימן, כי ברור! אני חושב שזה רעיון נחמד, כי אם נוכל לחשב אינטגרל כדוגמת
אז נוכל להוכיח בקלות השערת רימן, כי ברור! אני חושב שזה רעיון נחמד, כי אם נוכל לחשב אינטגרל כדוגמת
אז נוכל להוכיח בקלות השערת רימן, כי ברור! אני חושב שזה רעיון נחמד, כי אם נוכל לחשב אינטגרל כדוגמת
אז נוכל להוכיח בקלות השערת רימן, כי ברור! אני חושב שזה רעיון נחמד, כי אם נוכל לחשב אינטגרל כדוגמת
אז נוכל להוכיח בקלות השערת רימן, כי ברור! אני חושב שזה רעיון נחמד, כי אם נוכל לחשב אינטגרל כדוגמת
$\int\limits _{A}\frac{\sin\sin x^{2}}{x},\mathrm{dx}$ אז נוכל להוכיח בקלות השערת רימן, כי ברור! אני חושב שזה רעיון נחמד, כי אם נוכל לחשב אינטגרל כדוגמת
$\int\limits _{A}\frac{\sin\sin x^{2}}{x},\mathrm{dx}$ אז נוכל להוכיח בקלות השערת רימן, כי ברור! \ \hrule \par\ \vspace{2em}\selectlanguage{english}

\cutout{l}(0.2\textwidth,7\baselineskip)\shapepar[1.3em]{\squareshape}% {\color{blue}\hspace{-8em}\raisebox{-3.5ex}{\fcolorbox{red}{blue!14}{\parbox{10em}{\selectlanguage{hebrew}{\bfseries\small% חיתוך חיתוך חיתוך חיתוך חיתוך חיתוךחיתוך חיתוך חיתוךחיתוך חיתוך חיתוךחיתוך חיתוך חיתוך }}}}}\par\selectlanguage{hebrew} אני חושב שזה רעיון נחמד, כי אם נוכל לחשב אינטגרל כדוגמת
$\int\limits _{A}\frac{\sin\sin x^{2}}{x},\mathrm{dx}$ אז נוכל להוכיח בקלות השערת רימן, כי ברור! אני חושב שזה רעיון נחמד, כי אם נוכל לחשב אינטגרל כדוגמת
$\int\limits _{A}\frac{\sin\sin x^{2}}{x},\mathrm{dx}$ אז נוכל להוכיח בקלות השערת רימן, כי ברור! אני חושב שזה רעיון נחמד, כי אם נוכל לחשב אינטגרל כדוגמת
אז נוכל להוכיח בקלות השערת רימן, כי ברור! אני חושב שזה רעיון נחמד, כי אם נוכל לחשב אינטגרל כדוגמת
אז נוכל להוכיח בקלות השערת רימן, כי ברור! אני חושב שזה רעיון נחמד, כי אם נוכל לחשב אינטגרל כדוגמת
אז נוכל להוכיח בקלות השערת רימן, כי ברור! אני חושב שזה רעיון נחמד, כי אם נוכל לחשב אינטגרל כדוגמת
אז נוכל להוכיח בקלות השערת רימן, כי ברור! אני חושב שזה רעיון נחמד, כי אם נוכל לחשב אינטגרל כדוגמת
אז נוכל להוכיח בקלות השערת רימן, כי ברור! אני חושב שזה רעיון נחמד, כי אם נוכל לחשב אינטגרל כדוגמת
אז נוכל להוכיח בקלות השערת רימן, כי ברור! אני חושב שזה רעיון נחמד, כי אם נוכל לחשב אינטגרל כדוגמת
$\int\limits _{A}\frac{\sin\sin x^{2}}{x},\mathrm{dx}$ אז נוכל להוכיח בקלות השערת רימן, כי ברור! אני חושב שזה רעיון נחמד, כי אם נוכל לחשב אינטגרל כדוגמת
$\int\limits _{A}\frac{\sin\sin x^{2}}{x},\mathrm{dx}$ אז נוכל להוכיח בקלות השערת רימן, כי ברור! \ \hrule \par\ \vspace{2em}\selectlanguage{english}

\end{document}

Cicada
  • 10,129