The following creates a perfect english document with some greek letters:
\documentclass[]{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[polutonikogreek,english]{babel}
\begin{document}
English or \textgreek{ανηρ} text.
\end{document}
However, when I add this, It gets all upset about the hebrew characters being invalid characters.:
\documentclass[]{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[polutonikogreek,hebrew,english]{babel}
\begin{document}
English or \textgreek{ανηρ} text.
And this גהר.
\end{document}
I have tried changing And this גהר.
, guessing there might be something like And this \texthebrew{גהר}.
but I guess there is not?
I wonder if anyone can point me in the right direction. (In case it matters, I am trying to stuff this in a beamer document. The above is jut my MWE)
This related question does not answer the question for Hebrew: How to use both English and Greek (Tex Live & pdflatex) and even Hebrew easily in one document
This related question uses polyglossa instead of babel for xelatex users Perfect example document (template) for English, Greek and Hebrew (XeLaTeX)
Best Answer
I think the main problem is that the Hebrew fonts are missing. After installing the Hebrew fonts from CTAN, the following code compiles with pdfLaTeX (using texlive) without any errors:
Please note that I also changed the input encryption to
utf8x
. Unfortunately, the above puts "גהר" at the right end of the line (since Hebrew is written from right to left).A really dirty hack to solve this problem using this answer could be to use the
calc
package and define the command\inlinehebrew
in the following way:Then
generates the following output
but, since it includes a
parbox
, it breaks many things and can only be used for very short texts.Let me add two remarks in passing:
polyglossia
for writing Hebrew in LaTeX.