[Tex/LaTex] Perfect example document (template) for English, Greek and Hebrew (XeLaTeX)

englishgreekhebrewluatexxetex

EDIT 2 (23-2-2017): Changed the title and added that the example file in this post specifically works with XeLaTeX.

EDIT 1 (20-2-2017): Due to cfr's request, I have added a file. This is not the original, but a progress file, so to speak, based on cfr's example file. This one works with XeLaTeX:

\documentclass[12pt, a4paper, titlepage]{article}

\usepackage[hidelinks]{hyperref}
\usepackage{amssymb}
\usepackage{amsmath}
\usepackage{verbatim}
\usepackage{afterpage}
\usepackage[top=1.00in, bottom=1.00in, left=1.00in, right=1.00in]{geometry}
\usepackage{setspace}


%% for centering section titles
\usepackage[center]{titlesec}

\usepackage{polyglossia}

\setmainlanguage[variant=british]{english}
\setotherlanguage{hebrew}
\setotherlanguage{greek}
\newfontfamily\hebrewfont{SBL Hebrew}
\newfontfamily\greekfont{SBL Greek}


\title{Title}



%%   BEGIN DOCUMENT
\begin{document}
    \begin{titlepage}
        \maketitle
        \thispagestyle{empty}
    \end{titlepage}
    \pagenumbering{arabic}

\section{First}
\textgreek{αταραξία}. That was in Greek using SBL Greek.

\texthebrew{קֹהֶלֶת}. That was in Hebrew using SBL Hebrew.


\end{document}

OLD ORIGINAL POST:

Perhaps I am foolish in this regard, but I could not—after having tried to figure it out for a long time—manage to get a basic working file with English as the main language and Greek and Hebrew as the ones thrown in every now and then.

First I tried to add Hebrew to my existing working PdfLaTex document (that accepts English and Greek), but this is a very annoying and soul-killing process. Then, since many seem to recommend XeLaTex or LuaLatex, I tried these, but to no avail either (and also a soul-killing process; in fact, do I even have a soul left after all this? Is not the point of technology for the user that it serves him and not the other way around?).

I also followed the instructions in version 5.06 of The Not So Short Introduction to LaTeX 2ε. It is the part on XeLaTeX (starting on p. 34) in section 2.5.8 The Unicode option. Well, it didn't help me at all, even though I followed it.

So will someone please provide a basic working file for PdfLaTeX, XeLaTeX or LuaLaTeX (preferrably the best option) where English is the main language and Greek and Hebrew are the others?

I have installed, by the way, the Hebrew font called SBL Hebrew. For English and Greek I would simply use Computer Modern or something similar.

Best Answer

Something like this?

\documentclass{article}
\usepackage{polyglossia}
\setmainfont{Noto Serif}
\setsansfont{Noto Sans}
\setmainlanguage[variant=british]{english}
\setotherlanguage{hebrew}
\setotherlanguage{greek}
\newfontfamily\hebrewfont{Noto Sans Hebrew}[Script=Hebrew]
\newfontfamily\greekfont{Noto Serif}
\begin{document}

This is the main language.

\begin{hebrew}
  עברית
\end{hebrew}

\begin{greek}
  εὐδαιμονία
\end{greek}


\end{document}

Compile with XeLaTeX.

languages