TransWikia.com

How can I input Uyghur language in LaTeX?

TeX - LaTeX Asked by user11225 on August 16, 2021

I have been learning LaTeX for several weeks and now I am confident enough to write some academic papers in English. However, when I tried to input my mother language – Uyghur (Uighur), I had some difficulties and I could not do it even I watched some Youtube tutorials. Anyone can help me to solve this? My question may sound a bit silly, but anyway, please help ! I have many things to write in my own language using LaTeX.
شۇنىسى ئېنىقكى ئەر-ئاياللار مەلۇم نەرسىلەرگە نىسبەتەن بىرلىككە كېلەلمەيدۇ
For reference [script=Uyghur] {UKIJ}

3 Answers

Disclaimer: I can't read Uyghur, so I don't actually know if this is correct.

Neither polyglossia nor babel appear to support Uyghur out of the box. ArabTeX claims to, but I think you have to use Latin characters for input.

However, perhaps using Arabic settings with polyglossia and a Uyghur font gives the right output. Compile this with xelatex.

documentclass{article}
usepackage{polyglossia}
setmainlanguage{arabic}
setmainfont[Script=Arabic]{UKIJ Tuz}
pagestyle{empty}
begin{document}
شۇنىسى ئېنىقكى ئەر-ئاياللار مەلۇم نەرسىلەرگە نىسبەتەن بىرلىككە كېلەلمەيدۇ
end{document}

enter image description here

Answered by David Purton on August 16, 2021

I have solved this problem by using Arabic sicrpt .sty in Latex.~ talk is cheap show me the code. My Files:

code.tex
uytex.sty
./uyFonts/
------ UKIJ Ekran.ttf
------ UKIJ Qolyazma.ttf
------ UKIJ Teng.ttf

note, uyFonts directory needed. code.tex:

documentclass[openany]{article}
usepackage{geometry}
usepackage{amsmath}
usepackage{color} 
usepackage{framed}
usepackage{uytex}
geometry{left=0.5cm,right=0.5cm,top=0.5cm,bottom=0.5cm}
definecolor{apricot}{rgb}{0.98, 0.81, 0.69}

title{textu{ سالام Latex}}
author{textu{LaTex سىناق بېتى}}
date{udate}

begin{document}
maketitle
noindent{color{red} rule{linewidth}{1mm}}

utext{
شۇنىسى ئېنىقكى ئەر-ئاياللار مەلۇم نەرسىلەرگە نىسبەتەن بىرلىككە كېلەلمەيدۇ.
شۇنىسى ئېنىقكى ئەر-ئاياللار مەلۇم نەرسىلەرگە نىسبەتەن بىرلىككە كېلەلمەيدۇ 
}

Hello World! Here you can write Left-to-Right text. 
There is a formula $E = mc^2$  here you are. 

Write framed text with custom font like this: 
begin{framed}
utext{{uqolyaz
شۇنىسى ئېنىقكى ئەر-ئاياللار مەلۇم نەرسىلەرگە نىسبەتەن بىرلىككە كېلەلمەيدۇ.
$$ boxed{F(w) = int_{-infty}^{+infty}f(x)e^{-iwx}dx}$$
شۇنىسى ئېنىقكى ئەر-ئاياللار مەلۇم نەرسىلەرگە نىسبەتەن بىرلىككە كېلەلمەيدۇ
 }}
 end{framed}
par
Write Formula  with custom font like this: 

utext{{uteng
شۇنىسى ئېنىقكى ئەر-ئاياللار مەلۇم نەرسىلەرگە نىسبەتەن بىرلىككە كېلەلمەيدۇ.
شۇنىسى ئېنىقكى ئەر-ئاياللار مەلۇم نەرسىلەرگە نىسبەتەن بىرلىككە كېلەلمەيدۇ.
}}

utext{
colorbox{apricot}{textu{شۇنىسى ئېنىقكى ئەر-ئاياللار مەلۇم نەرسىلەرگە نىسبەتەن بىرلىككە كېلەلمەيدۇ}} 
شۇنىسى ئېنىقكى ئەر-ئاياللار مەلۇم نەرسىلەرگە نىسبەتەن بىرلىككە كېلەلمەيدۇ.
}
end{document}

uytex.sty:

ProvidesPackage{uytex}
usepackage{titlesec}
usepackage{setspace}
usepackage{fontspec}
usepackage{ifthen}
usepackage{polyglossia}
setmainlanguage{english}
setotherlanguage{arabic}
%---------------------------------------------------------------

% SET Main & Mono Font % Declare Ssome Fonts with short name
newfontfamily{uekran}[Path = uyFonts/]{UKIJ Ekran.ttf}
newfontfamily{uqolyaz}[Path = uyFonts/]{UKIJQolyazma.ttf}
newfontfamily{uteng}[Path = uyFonts/]{UKIJTeng.ttf}

setmainfont [Path = uyFonts/] {UKIJ Ekran.ttf}
setsansfont [Path = uyFonts/] {UKIJQolyazma.ttf}
setmonofont [Path = uyFonts/] {UKIJTeng.ttf}
%---------------------------------------------------------------

%Rewrite Date Format
%---------------------------------------------------------------
newcounter{num}
setcounter{num}{numbermonth}
newcommandnnz{textarabic{يانىۋار}}
ifnum value{num}=2 {renewcommandnnz{textarabic{فېۋرال}}fi
ifnum value{num}=3 {renewcommandnnz{textarabic{مارت}}fi
ifnum value{num}=4 {renewcommandnnz{textarabic{ئاپرېل}}fi
ifnum value{num}=5 {renewcommandnnz{textarabic{ماي}}fi
ifnum value{num}=6 {renewcommandnnz{textarabic{ئىيۇن}}fi
ifnum value{num}=7 {renewcommandnnz{textarabic{ئىيۇل}}fi
ifnum value{num}=8 {renewcommandnnz{textarabic{ئاۋغۇسېت}}fi
ifnum value{num}=9 {renewcommandnnz{textarabic{سېنتەبىر}}fi
ifnum value{num}=10 {renewcommandnnz{textarabic{ئۆكتەبىر}}fi
ifnum value{num}=11 {renewcommandnnz{textarabic{نويابىر}}fi
ifnum value{num}=12 {renewcommandnnz{textarabic{دېكابىر}}fi

newcommand{utoday}{textarabic{numberyear -يىلى numbermonth -ئاي numberday -كۈنى}}
newcommand{udate}{textarabic{numberyear -يىل numberday - nnz}}
newcommand{udates}{textarabic{numberday/numbermonth/numberyear}}
%---------------------------------------------------------------


% Renew begin{Arabic} Area with bu and utext{}
%---------------------------------------------------------------
newcommand{bu}{begin{Arabic}}
newcommand{eu}{end{Arabic}}
newcommandtextu{textarabic}

makeatletter
newcommandutext{begingroup@utext}
newcommand@utext[1]{endgroupnewlinechar`^^M
scantokens{begin{Arabic}%
#1}
end{Arabic}%
newlinechar`^^J }% back to LaTeX's default
makeatother
%---------------------------------------------------------------

%Set Border Indented size
setlength{parindent}{0pt}

Everything has done! enter image description here


enter image description here

Answered by Abdusalam on August 16, 2021

As of 2021, this works in LuaLaTeX:

documentclass[openany]{article}
usepackage{geometry}
usepackage[svgnames]{xcolor} 
usepackage[bidi=basic, layout=sectioning.tabular, english]{babel}
usepackage{unicode-math}
usepackage{microtype}
usepackage{framed}

geometry{left=0.5cm,right=0.5cm,top=0.5cm,bottom=0.5cm}
definecolor{apricot}{rgb}{0.98, 0.81, 0.69}

babelprovide[import, onchar=fonts ids]{uyghur}

defaultfontfeatures{ Scale=MatchUppercase, Ligatures=TeX }

babelfont{rm}
          [Ligatures=Common, Scale=1.0, Language=Default]{Libertinus Serif}
babelfont[uyghur]{rm}
          [Language=Default]{Amiri}
babelfont{sf}
          [Ligatures=Common, Language=Default]{Libertinus Sans}
babelfont{tt}
          [Language=Default]{Libertinus Mono}
babelfont[uyghur]{tt}
          [Language=Default]{ALM Fixed}
setmathfont{Libertinus Math}


title{ سالام Latex}
author{LaTex سىناق بېتى}
date{foreignlanguage{uyghur}{localedate{2021}{6}{30}}}

begin{document}
maketitle

begin{otherlanguage}{uyghur}
noindent{color{red} rule{linewidth}{1mm}}
شۇنىسى ئېنىقكى ئەر-ئاياللار مەلۇم نەرسىلەرگە نىسبەتەن بىرلىككە كېلەلمەيدۇ.
شۇنىسى ئېنىقكى ئەر-ئاياللار مەلۇم نەرسىلەرگە نىسبەتەن بىرلىككە كېلەلمەيدۇ 
end{otherlanguage}

Hello World! Here you can write Left-to-Right text, and also {ئۇيغۇر تىلى. 
There is a formula $E = mc^2$  here you are. 

Write framed text with custom font like this: 
begin{framed}
begin{otherlanguage}{uyghur}
شۇنىسى ئېنىقكى ئەر-ئاياللار مەلۇم نەرسىلەرگە نىسبەتەن بىرلىككە كېلەلمەيدۇ.
$$ boxed{F(w) = int_{-infty}^{+infty}f(x)e^{-iwx}dx}$$
شۇنىسى ئېنىقكى ئەر-ئاياللار مەلۇم نەرسىلەرگە نىسبەتەن بىرلىككە كېلەلمەيدۇ
end{otherlanguage}
end{framed}
par
Write Formula  with custom font like this: 
begin{otherlanguage}{uyghur}% And set the font family here.
شۇنىسى ئېنىقكى ئەر-ئاياللار مەلۇم نەرسىلەرگە نىسبەتەن بىرلىككە كېلەلمەيدۇ.
شۇنىسى ئېنىقكى ئەر-ئاياللار مەلۇم نەرسىلەرگە نىسبەتەن بىرلىككە كېلەلمەيدۇ.

noindentcolorbox{apricot}{شۇنىسى ئېنىقكى ئەر-ئاياللار مەلۇم نەرسىلەرگە نىسبەتەن بىرلىككە كېلەلمەيدۇ} 
شۇنىسى ئېنىقكى ئەر-ئاياللار مەلۇم نەرسىلەرگە نىسبەتەن بىرلىككە كېلەلمەيدۇ.
end{otherlanguage}
end{document}

Libertinus/Amiri sample

I picked the Libertinus and Amiri font families by Khaled Hosny, which go well together, but you can use any fonts that work in your word processor.

Answered by Davislor on August 16, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP