I'm trying to write a sentence like
The word must be either کا, کے or کی.
into a LaTeX document. I've tried several ways of getting Arabic characters to LaTeX, and this: Arabic in latex was the only one I managed to get to work. However, when I try to embed a version of it into a document with words in many different languages, it doesn't compile. I'm using Windows 10, TeXworks editor, PdfLaTeX. (I'm quite new to LaTeX, this is my first major document I'm writing in it). Below is the error I get (and yes, I do have \begin{document} in my document as if I remove the package imports and the section containing Arabic characters, the document compiles just fine.
Here's a "minimal" working example. This code does not compile, but if I comment out all the five lines that contain a comment like this: %%%% If I comment out this and the rest of lines with this comment, it will compile.
LaTeX code:
% -*- coding: utf-8 -*-
\documentclass{article}% use option titlepage to get the title on a page of its own.
\usepackage{blindtext}
\usepackage{graphicx}
\usepackage{devanagari}%Hindi word: {\dn kA}
\usepackage{url}
\usepackage{enumitem}
\usepackage{CJKutf8} % Japanese
\usepackage[T2A,T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[russian,english]{babel} % Cyrillic: Bulgarian
\usepackage[LGR,T1]{fontenc} % this and the next two lines for Ancient Greek, as well as the comment on the first line
\usepackage[utf8]{inputenc} % utf8 is required
\usepackage{textcomp}
\usepackage{arabtex} % Arabic: Urdu (doesn't work) %%%% If I comment out this and the rest of lines with this comment, it will compile
\usepackage{utf8} % Urdu (doesn't work) %%%% If I comment out this and the rest of lines with this comment, it will compile
\newcommand{\textgreek}[1]{\begingroup\fontencoding{LGR}\selectfont#1\endgroup}
\showboxdepth=\maxdimen
\showboxbreadth=\maxdimen
\hyphenation{tun-nis-ta-mis-oh-jei-den}
% numbering tutorials: https://latex.org/forum/viewtopic.php?t=12143 ; https://www.latex-tutorial.com/tutorials/lists/
% https://tex.stackexchange.com/questions/512584/arabic-alphabet-urdu-language-to-latex
\def\code#1{\texttt{#1}}
\title{Some random title}
\date{Some random date}
\author{Anonymous authors}
\begin{document}
\maketitle
\noindent Text:
\begin{enumerate}
\item This is an enumerated item
\item boom boom boom.
\item englanti.
\end{enumerate}
\section{Section}
\textbf{word} has four letters
\section{Devanagari transliteration workaround}
This works fine {\dn kA} yeah.
\section{Urdu (here's the problem)}
The word must be either
\<کا>%%%% If I comment out this and the rest of lines with this comment, it will compile
,
\<کے>%%%% If I comment out this and the rest of lines with this comment, it will compile
or
\<کی>%%%% If I comment out this and the rest of lines with this comment, it will compile
\section{Meaningless section}
\textbf{Some bold text here.}\newline\newline
\code{this is a code block}, boom.
\section{A Japanese character}
This is the only Japanese wod that I need: \begin{CJK}{UTF8}{min}の\end{CJK} and it works fine.
\section{Bulgarian}
This is a Bulgarian word: \foreignlanguage{russian}{на} and I need that as well.
\end{document}
Error message:
This is pdfTeX, Version 3.14159265-2.6-1.40.20 (MiKTeX 2.9.7050 64-bit)
entering extended mode
(mwe.tex
LaTeX2e <2018-12-01>
("C:\Program Files\MiKTeX 2.9\tex/latex/base\article.cls"
Document Class: article 2018/09/03 v1.4i Standard LaTeX document class
("C:\Program Files\MiKTeX 2.9\tex/latex/base\size10.clo"))
("C:\Program Files\MiKTeX 2.9\tex/latex/blindtext\blindtext.sty"
("C:\Program Files\MiKTeX 2.9\tex/latex/tools\xspace.sty"))
("C:\Program Files\MiKTeX 2.9\tex/latex/graphics\graphicx.sty"
("C:\Program Files\MiKTeX 2.9\tex/latex/graphics\keyval.sty")
("C:\Program Files\MiKTeX 2.9\tex/latex/graphics\graphics.sty"
("C:\Program Files\MiKTeX 2.9\tex/latex/graphics\trig.sty")
("C:\Program Files\MiKTeX 2.9\tex/latex/graphics-cfg\graphics.cfg")
("C:\Program Files\MiKTeX 2.9\tex/latex/graphics-def\pdftex.def")))
("C:\Program Files\MiKTeX 2.9\tex/latex/devanagari\devanagari.sty")
("C:\Program Files\MiKTeX 2.9\tex/latex/url\url.sty")
("C:\Program Files\MiKTeX 2.9\tex/latex/enumitem\enumitem.sty")
("C:\Program Files\MiKTeX 2.9\tex/latex/cjk\CJKutf8.sty"
("C:\Program Files\MiKTeX 2.9\tex/generic/oberdiek\ifpdf.sty")
("C:\Program Files\MiKTeX 2.9\tex/latex/base\inputenc.sty")
("C:\Program Files\MiKTeX 2.9\tex/latex/cjk\CJK.sty"
("C:\Program Files\MiKTeX 2.9\tex/latex/cjk/mule\MULEenc.sty")
("C:\Program Files\MiKTeX 2.9\tex/latex/cjk\CJK.enc"))
("C:\Program Files\MiKTeX 2.9\tex/latex/base\fontenc.sty"))
("C:\Program Files\MiKTeX 2.9\tex/latex/base\fontenc.sty"
("C:\Program Files\MiKTeX 2.9\tex/latex/cyrillic\t2aenc.def"
("C:\Program Files\MiKTeX 2.9\tex/latex/base\t2aenc.dfu"))
("C:\Program Files\MiKTeX 2.9\tex/latex/base\t1enc.def"))
("C:\Program Files\MiKTeX 2.9\tex/generic/babel\babel.sty"
("C:\Program Files\MiKTeX 2.9\tex/generic/babel\switch.def")
*************************************
* Local config file bblopts.cfg used
*
("C:\Program Files\MiKTeX 2.9\tex/latex/arabi\bblopts.cfg")
("C:\Program Files\MiKTeX 2.9\tex/latex/babel-russian\russianb.ldf"
("C:\Program Files\MiKTeX 2.9\tex/generic/babel\babel.def"
("C:\Program Files\MiKTeX 2.9\tex/generic/babel\txtbabel.def")))
("C:\Program Files\MiKTeX 2.9\tex/latex/babel-english\english.ldf"))
("C:\Program Files\MiKTeX 2.9\tex/latex/base\fontenc.sty"
("C:\Program Files\MiKTeX 2.9\tex/latex/greek-fontenc\lgrenc.def"
("C:\Program Files\MiKTeX 2.9\tex/latex/greek-inputenc\lgrenc.dfu")
("C:\Program Files\MiKTeX 2.9\tex/latex/greek-fontenc\greek-fontenc.def"))
("C:\Program Files\MiKTeX 2.9\tex/latex/base\t1enc.def"))
("C:\Program Files\MiKTeX 2.9\tex/latex/base\textcomp.sty"
("C:\Program Files\MiKTeX 2.9\tex/latex/base\ts1enc.def"
("C:\Program Files\MiKTeX 2.9\tex/latex/base\ts1enc.dfu")))
("C:\Program Files\MiKTeX 2.9\tex/latex/arabtex\arabtex.sty"
! LaTeX Error: Missing \begin{document}.
See the LaTeX manual or LaTeX Companion for explanation.
Type H <return> for immediate help.
...
l.40 \let \xpa \expandafter
\def \xxpa {\xpa \xpa \xpa }
?

\documentclass{...}and ending with\end{document}. – dexteritas Oct 17 '19 at 11:08arabtexanddevanagari. Btw. you importinputenctwo times. – dexteritas Oct 17 '19 at 15:50