How to write Urdu language in LaTEX? - latex

I am writing a research paper in LaTeX. The paper is about Urdu Language Processing and i have to write Urdu words within English paragraphs. I have tried this:
\usepackage{fontspec}
\usepackage{polyglossia}
\setmainfont{Times New Roman}
\newfontface{\urdu}[Script=Arabic]{Jameel Noori Nastaleeq}
#in the text, write Urdu like this:
In your document {\urdu اردو ایسے لکھیں} write Urdu like this.
But it doesnot work for me. I need help for this.

While writing in multiple languages under polyglossia you have to specify them (see this for a detailed answer on how to write Urdu - English mixed documents in Latex).
Here is a MWE.
documentclass[12pt]{article}
\usepackage{polyglossia}
\usepackage{fontspec}
\setmainlanguage{english}
\setotherlanguage{urdu}
\setmainfont[Path=/Users/ghalib/Library/Fonts/]{ufonts.com_jameel-noori-nastaleeq.ttf}
\begin{document}
In your document \texturdu{ اردو ایسے لکھیں} write Urdu like this.
\vspace{0.5in}
\noindent
\begin{center}
\texturdu{
اردو ہے جس کا نام ، ہمیں جانتے ہیں داغ \\
سارے جہاں میں دھوم ہماری زباں کی ہے\\
\hspace{6cm} (داغ دھلوی)
}
\end{center}
\end{document}

Related

Use Biblatex to get an overview of the keywords from my sources

Hi I'm using LaTeX to write a literature review and BibLaTeX to print my sources and bibliography.
I would like to get an overview of all the keywords used in the articles I have gathered so far.
Since I have them all in a .bib file I figured that there probably is some easy way to get all the keywords from there that utilises BibLaTeX and the BibTeX-format of the file with the info.
From what I can gather BibLaTeX has the support for using keywords to sort the bibliography, or include/exclude certain sources based on keywords, but I can't find if or how I can print other information from the .bib than the full source. I've found \printfield in the documentation but it's not recognised when I use it in my document, even though the \textcite and the \printbibliography works fine so I'm guessing I'm using it wrong. Here's how I've tried to use it:
\documentclass[a4paper]{article}
\usepackage[english]{babel}
\usepackage[utf8]{inputenc}
\usepackage{csquotes}
\usepackage[style=authoryear,backend=biber]{biblatex}
\addbibresource{sample.bib}
\title{Test}
\author{Me}
\begin{document}
\maketitle
\section*{Citation examples}
\parencite{Smith:2012qr}.
\printfield{keywords}
\printbibliography
\end{document}
I hope my question is clear enough.
Thank you.
Based on this question https://tex.stackexchange.com/questions/332292/listing-indexing-and-linking-keywords-in-biblatex you could use one of the packages for index creation, e.g. imakeidx:
\documentclass{article}
\begin{filecontents*}[overwrite]{\jobname.bib}
#article{Padial2010,
title={The Integrative Future Of Taxonomy},
author={Padial, J.M. and Miralles, A. and la Riva, I.D. and Vences, M.},
journal={Frontiers in Zoology},
year={2010},
volume={7},
number={16},
pages={1--14},
note={Cited by 4},
abstract={Text},
publisher={Some Publishing},
doi={10.1186/1742-9994-7-16},
issn={1742-9994},
file={./2004_Jensen_Homecoming.pdf},
keywords={biology, taxonomy},
}
#article{Padissal2010,
title={The Integrative Future Of Taxonomy},
author={Padial, J.M. and Miralles, A. and la Riva, I.D. and Vences, M.},
journal={Frontiers in Zoology},
year={2010},
volume={7},
number={16},
pages={1--14},
note={Cited by 4},
abstract={Text},
publisher={Some Publishing},
doi={10.1186/1742-9994-7-16},
issn={1742-9994},
file={./2004_Jensen_Homecoming.pdf},
keywords={math, taxonomy},
}
\end{filecontents*}
\usepackage{biblatex}
\addbibresource{\jobname.bib}
\usepackage{imakeidx}
\makeindex[name=keywords, title=List of Keywords]
\DeclareIndexFieldFormat{keywords}{\forcsvfield{\index[keywords]}{keywords}}
\AtEveryBibitem{\indexfield{keywords}}
\begin{document}
\nocite{*}
\printbibliography
\printindex[keywords]
\end{document}

How to replace the command zhnumber with the equivalent command which add numbers in English in latex

I have a template of thesis which has two table of contents, the first one is written in Chinese and the second one in English. After I reversed them, it means I made the Chinese table of content be English and the second one Chinese, the numbers are still same, I couldn't change them.
After checking the code of the templated, I found this line:
\renewcommand\chaptermark[1]
{\markboth{}{Chapter \zhnumber{\thechapter} \hspace{2ex} #1}}
\renewcommand\sectionmark[1]
{\markright{\thesection\quad #1}}
where the zhnumber provide the numbers in Chinese, so I was wondering, how can I replace that command to make it providing the numbers in English?
Just remove the zhnumber command: this provides the English (actually, Arabic) numbers:
\documentclass{book}
\renewcommand\chaptermark[1]
{\markboth{}{Chapter {\thechapter} \hspace{2ex} #1}}
\renewcommand\sectionmark[1]
{\markright{\thesection\quad #1}}
\usepackage{lipsum}
\begin{document}
\chapter{First Chapter}
\lipsum
\section{First section}
\lipsum[1-20]
\section{Second Section}
\lipsum
\end{document}

How to reset chapter and section counter with \part*

Sorry for bad english
I have a problem with my Latex code (I'm not very good in coding). I want an output like this:
Part I
Chapter I
Chapter II
Part II
Chapter I
Chapter II
I also wanted to create a box around my title of the parts , this doesn't work like I wanted, so I used \part* and \addcontentsline{toc}{part}{PART I} (to write the line in the table of content).So the code is:
\fbox{\begin{minipage}{\linewidth}
\part*{\begin{center}
PART I
\end{center}}
\end{minipage}}
\addcontentsline{toc}{part}{PART I}
\vspace{0.7cm}
I saw this methode to reset the counter of the chapters:
\makeatletter
\#addtoreset{chapter}{part}
\makeatother
but this doesn't work, I think it's due to use of \part*.
Has anyone an idea? THNANKS!
Hope the example bellow can help:)
\documentclass[a4paper,11pt,]{report}
\usepackage{hyperref}
\begin{document}
\tableofcontents
\newpage
\fbox{\begin{minipage}{\linewidth}
\part*{\begin{center}
INTRODUCTION
\end{center}}
\end{minipage}}
\addcontentsline{toc}{part}{INTRODUCTION}
\vspace{0.7cm}
\chapter{Hello}
\section{my}
\newpage
\fbox{\begin{minipage}{\linewidth}
\part*{\begin{center}
CONCLUSION
\end{center}}
\end{minipage}}
\addcontentsline{toc}{part}{CONCLUSION}
\vspace{0.7cm}
\chapter{name}
\section{is}
\end{document}
As you already know the solution for \part, how about simply using this and make it look like \part*? This has the advantage that you could add the boxes around the part titles automatically.
\documentclass[a4paper,11pt,]{report}
\usepackage[newparttoc]{titlesec}
\titleformat{\part}[frame]
{\normalfont}
{}
{8pt}
{\Large\bfseries\filcenter}
\usepackage{titletoc}
\titlecontents{part}[0em]
{\vspace{2em}\large\bfseries\sffamily\relax}
{\contentslabel[\relax]{0em}}{}{\hfill\contentspage}
\usepackage{hyperref}
\makeatletter
\#addtoreset{chapter}{part}
\makeatother
\begin{document}
\tableofcontents
\part{INTRODUCTION}
\chapter{Hello}
\section{my}
\part{CONCLUSION}
\chapter{name}
\section{is}
\end{document}

Latex: \printglossaries not working on Mac?

I want to implement
a simple glossary. I have the following example:
\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{glossaries}
\makeglossaries
\newglossaryentry{latex}
{
name=latex,
description={Is a mark up language specially suited
for scientific documents}
}
\newglossaryentry{maths}
{
name=mathematics,
description={Mathematics is what mathematicians do}
}
\title{How to create a glossary}
\author{ }
\date{ }
\begin{document}
\maketitle
The \Gls{latex} typesetting markup language is specially suitable
for documents that include \gls{maths}.
\clearpage
\printglossaries
\end{document}
I use TexPad on Mac.
The \printglossaries command doesn't work. I don't get errors and it does not print the glossaries. Does someone has an idea why?
This is the .pdf I get: GlossariesTest.pdf
This minimal example works for me:
\documentclass{article}
\usepackage{glossaries}
\makenoidxglossaries
\newglossaryentry{latex}{
name=latex,
description={is a mark up language specially}
}
\begin{document}
The \Gls{latex} typesetting markup language.
\printnoidxglossaries
\end{document}
Note that I used \makenoidxglossaries and \printnoidxglossaries instead of \makeglossaries and \printglossaries. If I read table 1 on page 17 of the Glossaries Beginner's Guide correctly, you need to run makeglossaries, xindy or such for the commands you used.
With this input
\documentclass{article}
\usepackage{glossaries}
\makeglossaries
\newglossaryentry{latex}{
name=latex,
description={is a mark up language specially}
}
\begin{document}
The \Gls{latex} typesetting markup language.
\printglossaries
\end{document}
I need to run pdflatex test.tex, then makeglossaries test, and another pdflatex test.tex to get the glossary printed.

How can I make hindi pdf document in Latex without transliteration?

I want to write a letter in Hindi. I want to use latex to create the pdf document in Hindi. I don't want to have transliteration from english to hindi.
Use xelatex (which uses UTF-8 input) with an appropriate font (e.g. Lohit).
\documentclass{article}
\usepackage{fontspec}
\setmainfont[Script=Devanagari]{Lohit Hindi}
\begin{document}
यह एक परीक्षण है
\end{document}

Resources