1

My codes are follows:

\documentclass{book}
\usepackage[utf8x]{inputenc}
\usepackage[hebrew,russian,english]{babel}

\begin{document} \begin{itemize} \item \textbf{Form}: WG\ \textbf{Contributor}: Hila Gendler Shalev, Tel-Aviv University\ \textbf{Citation}: Gendler-Shalev, H. (2005). \selectlanguage{hebrew}התאמת שאלון הורים \selectlanguage{english} HCDI-WG \selectlanguage{hebrew}לעברית\selectlanguage{english} [The adaptation of HCDI-WG parent questionnaire to Hebrew] [Master's Thesis, Tel Aviv University, Tev Aviv, Israel]. \end{itemize}

\end{document}

Output

enter image description here

As per my code, the text "HCDI-WG" should come after the hebrew characters, but it comes before that. Please suggest what I did wrong...

Note that I'm using MikTeX 2.9 (LaTeX->dvips->ps2pdf) and Windows7...

MadyYuvi
  • 13,693
  • Don't use \selectlanguage in the middle of a paragraph. Use \foreignlanguage instead. In this case, try nesting a \foreignlanguage for English inside a \foreignlanguage for Hebrew, but I couldn't test it because it doesn't work in TeXLive (no fonts). – Javier Bezos Sep 03 '20 at 15:28

1 Answers1

1

Mixing L-R and R-L languages creates a lot of potentially ambiguous situations. Pierre MacKay's article on TeX-XeT from way back when addressed some of these. What's happening is that it's treating the HCDI-WG (and the later English text) as being part of the surrounding Hebrew (so L-R embedded in R-L) rather than the Hebrew being embedded in the surrounding English. I don't have everything installed to be able to test this (or even run your example—I'm getting a missing font error that I'm too lazy to resolve), but you should be able to enclose your Hebrew in \R{...} to get your desired result.

Edited to include following (untested) MWE:

\documentclass{book}
\usepackage[utf8x]{inputenc}
\usepackage[hebrew,russian,english]{babel}

\begin{document} \begin{itemize} \item \textbf{Form}: WG\ \textbf{Contributor}: Hila Gendler Shalev, Tel-Aviv University\ \textbf{Citation}: Gendler-Shalev, H. (2005). \R{התאמת שאלון הורים} HCDI-WG \R{לעברית} [The adaptation of HCDI-WG parent questionnaire to Hebrew] [Master's Thesis, Tel Aviv University, Tev Aviv, Israel]. \end{itemize}

\end{document}

Don Hosek
  • 14,078
  • \documentclass{book}\usepackage[utf8x]{inputenc}\usepackage[hebrew,russian,english]{babel} \begin{document} \begin{itemize} \item \begin{otherlanguage}{hebrew}התאמת שאלון הורים\end{otherlanguage} \selectlanguage{english} HCDI-WG \selectlanguage{hebrew}לעברית\selectlanguage{english} [The adaptation of HCDI-WG parent questionnaire to Hebrew] [Master's Thesis, Tel Aviv University, Tev Aviv, Israel]. \end{itemize} \end{document} not working... – MadyYuvi Sep 03 '20 at 05:21
  • I think you might be seeing an old version of the post. I was suggesting writing something like \R{התאמת שאלון הורים} anywhere you have Hebrew, which should make it clear to TeX that it's Hebrew embedded in English and not the other way around – Don Hosek Sep 03 '20 at 14:01
  • You shouldn't need to write \selectlanguage{hebrew} at all. – Don Hosek Sep 03 '20 at 14:01
  • Sorry sir, Can you provide a MWE for your suggestion? As I tried, but couldn't able to succeed... – MadyYuvi Sep 04 '20 at 04:16
  • I created a MWE above. Let me know if it works. – Don Hosek Sep 04 '20 at 14:16
  • Much thanks sir, will check and get back to you... – MadyYuvi Sep 04 '20 at 14:20
  • It's working like a champ...Thanks for your kind support... – MadyYuvi Sep 08 '20 at 05:06