\documentclass[10pt]{article}
\usepackage{fontspec}
\usepackage{lmodern} % My main font package of the document
\usepackage[american, bidi=basic]{babel}
\babelprovide[onchar=ids fonts]{arabic} % Provides character based script identification
\babelprovide[onchar=ids fonts]{hebrew}
\babelprovide[onchar=ids fonts]{sanskrit-devanagari}
\babelfont[*arabic]{rm}[Language = Default]{Noto Naskh Arabic} % Define fonts
\babelfont[*hebrew]{rm}[Language = Default]{Noto Serif Hebrew}
\babelfont[*devanagari]{rm}[Renderer=Harfbuzz]{Noto Serif Devanagari}
% For scripts/languages outside the scope babel, I need to define a fontspec command:
\newfontfamily\tibetanfont{Noto Serif Tibetan}
\newfontfamily\javanesefont{Noto Sans Javanese}
% For CJK, you can use kotex
\usepackage{kotex}
\setmainhangulfont{Noto Serif CJK KR} % only on Overleaf
\begin{document}
\section{Various scripts and languages:}
Samples:
Simplified Chinese: 汉字:艹草,谢谢。 \textbf{汉字:艹草,谢谢。}
Traditional Chinese: 漢字:艸草,謝謝。 \textbf{漢字:艸草,謝謝。}
Japanese: ありがとうございました \textbf{ありがとうございました }
Korean: 감사합니다 \textbf{감사합니다}
Greek: ευχαριστώ \textbf{ευχαριστώ}
Russian: спасибо \textbf{спасибо}
Hungarian: köszönöm szépen \textbf{köszönöm szépen}
Hindi: \textnormal{धन्यवाद} \textbf{धन्यवाद}
Arabic: شكرا جزيلا \textbf{شكرا جزيلا}
\textnormal
Hebrew: תֹהוּ וָבֹהוּ \textbf{תֹהוּ וָבֹהוּ}
Tibetan: {\tibetanfont{ཐུགས་རྗེ་ཆེ་།}} {\textbf{\tibetanfont{ཐུགས་རྗེ་ཆེ་།}}}
Javanese: {\javanesefont{ꦩꦠꦸꦂꦤꦸꦮꦸꦤ꧀}} {\textbf{\javanesefont{ꦩꦠꦸꦂꦤꦸꦮꦸꦤ꧀}}}
\section{Bidirectional scritps}
\subsection{Arabic and Hebrew in English paragraphs, in mixed environments}
ما هو \foreignlanguage{english}{differentiation}?
What is ما هو in Arabic?
For inline usage, you can use a command \foreignlanguage{hebrew}{תַּבְלִין}, but also works without it
תַּבְלִין. Example:
\bigskip
\noindent Most Arabic speakers consider the two varieties to be two registers
of one language, although the two registers can be referred to in
Arabic as فصحى العصر \textit{fuṣḥā l-ʻaṣr} Modern Standard Arabic (MSA) and
فصحى التراث \textit{fuṣḥā t-turāth} Classical Arabic (CA). ʿArab={i}.
\bigskip
The first line of the Bible is בְּרֵאשִׁית בָּרָא אֱלֹהִים אֵת הַשָּׁמַיִם וְאֵת הָאָרֶץ (Genesis 1:1).
\subsection{Full right-to-left paragraph}
\bigskip
\selectlanguage{arabic}
مكانة عائلته الاجتماعية مكنته من الدراسة على يد أفضل المدرسين في المغرب العربي. تلقى علم التربية الإسلامية التقليدية، ودرس القرآن الكريم الذي كان يحفظه عن ظهر قلب، واللسانيات العربية، وأساس فهم القرآن، الحديث، الشريعة (القانون) والفقه علم التاريخ.
\selectlanguage{english}
\subsection{The rest}
Sanskrit and CJK are no problem, they are left-to-right, just input them directly.
\end{document}
xelatexinstead ofxetex. – LaTeXer Oct 15 '19 at 12:09\usepackage{fontspec}\setmainfont{noto sans whatever it is called}– David Carlisle Oct 15 '19 at 12:11