Arabic alphabet (Urdu language) to LaTeX
As noted in the comments of the question, the packages arabtex
and devanagari
seem to have compatibility issues. As a solution, I recommend using XeLaTeX with packages polyglossia
and fontspec
instead. Below is a small example. Note that polyglossia
loads fontspec
automatically.
Additionally, you need fonts containing the characters of the languages used in your document. This example uses Microsoft Windows 10 fonts Times New Roman, Nirmala UI and MS Gothic. If the latter two are not installed, you can install them from Control Panel > Fonts > Download fonts for all languages.
Further information can be found from the documentation of the polyglossia
and fontspec
packages.
% !TEX encoding = UTF-8 Unicode
% !TEX TS-program = xelatex
\documentclass{article}
\usepackage{polyglossia}
\setdefaultlanguage{english}
\setotherlanguages{bulgarian,urdu,hindi}
% Document's main font (for English, Bulgarian and Urdu):
\setmainfont{Times New Roman}
% Font for Hindi text:
\newfontfamily\hindifont{Nirmala UI}
% Font and command for Japanese text:
\newfontfamily\japanesefont{MS Gothic}
\newcommand*{\textjapanese}[1]{{\japanesefont #1}}
\begin{document}
\noindent
Bulgarian: \textbulgarian{пример} \\
Urdu: \texturdu{مثال} \\
Hindi: \texthindi{उदाहरण} \\
Japanese: \textjapanese{例}
\end{document}
Here is how to do it with a recent Babel, and either XeLaTeX or LuaLaTeX. There are some comments in the code.
\documentclass{article}
% For a mostly monolingual document, only declare explicitly the main
% language (minor languages are loaded on the fly). We need activate
% bidi writing; for a few words, the default is enough.
\usepackage[english, bidi=default]{babel}
% The default font doesn't include the required scripts,
% so we need some extra setup (fonts from TeXLive):
\babelfont[urdu]{rm}{Amiri}
\babelfont[japanese]{rm}{IPAexMincho}
\babelfont[bulgarian]{rm}{CMU Serif}
% With LuaLaTeX Harfbuzz is required in Hindi. XeLaTeX just
% ignores this setting.
\babelfont[hindi]{rm}[Renderer=Harfbuzz]{FreeSerif}
\title{Some random title}
\date{Some random date}
\author{Anonymous authors}
\begin{document}
\maketitle
Text.
\section{Section}
\textbf{word} has four letters
\section{Urdu (here's the problem)}
The word must be either \foreignlanguage{urdu}{کا}, or
\foreignlanguage{urdu}{کے}, or \foreignlanguage{urdu}{کی}
\section{A Japanese character}
This is the only Japanese word that I need:
\foreignlanguage{japanese}{の}.
\section{Bulgarian}
This is a Bulgarian word: \foreignlanguage{bulgarian}{на} and I need
that as well.
And hindi: \foreignlanguage{hindi}{हिन्दी}
\end{document}