8

How can I insert a RTL citation (e.g Persian) in a LTR (e.g. English) article using BibTeX?

3 Answers 3

5

At first you should know the solution without bibtex. The solution is explained in the following example:

\documentclass[10pt,twocolumn,a4paper]{article}

\usepackage{fontspec}

\newfontfamily\Persianfont[Script=Arabic,Scale=1]{XB Niloofar}
\makeatletter
\TeXXeTstate=1
\def\Persiantext#1{\begingroup\beginR\Persianfont#1\endR\endgroup}
\def\Persianbibitem#1{\begin{RTLbibitems}\Persiantext{#1}\par\end{RTLbibitems}}
\makeatother

\usepackage{bidi}

\begin{document}

\section{Introduction}
You can use Persian and Arabic text between Latin text, with bidi package and the
    above Persiantext command.
For example you may have an Arabic paragraph such as follows:

\begin{RTL}
\Persiantext{آدمی در عالم خاکی نمی‌آید بدست}
\end{RTL}

Or a brief text such as:
\Persiantext{این متن}
between your Latin text.

Also you may have Persian or Arabic references such as this  Persian
    \cite{Amintoosi87afzayesh} and this Latin \cite{Baker02limits} references
    with the above Persianbibitem command.

\begin{thebibliography}{1}

\bibitem{Amintoosi87afzayesh}
\Persianbibitem{
امین‌طوسی، محمود، مزینی، ناصر، و فتحی، محمود. افزایش وضوح ناحیه‌ای. در  چهاردهمین کنفرانس ملی سالانه انجمن کامپیوتر ایران،  صفحات ۱۰۱-۱۰۸، تهران،  ایران، اسفند ۱۳۸۷. دانشگاه امیرکبیر.}

\bibitem{Baker02limits}
Baker, Simon and Kanade, Takeo. Limits on super-resolution and how to break them. IEEE Trans. Pattern Anal. Mach. Intell., 24(9):1167--1183,  2002.

\end{thebibliography}

\end{document}

After that I will explain the solution with bibtex.

3
  • He did. In his example.
    – MrD
    Jun 26, 2013 at 21:04
  • Can you please add an answer containing BibTeX as well? Mar 23, 2014 at 9:36
  • Please see my another answer. Apr 29, 2015 at 16:27
2

The [persian-bib] package provides adaptation of some widely used bibtex styles for a bilingual (persian/english) document. Therefore, you should use one of the bibtex styles provided in persian-bib:

  • unsrt-fa
  • plain-fa
  • acm-fa
  • ieeetr-fa
  • plainnat-fa (requires natbib)
  • chicago-fa (requires natbib)
  • asa-fa (requires natbib)

Therefore, a MWE of an article with both persian and english references is as follows

%!TEX TS-PROGRAM=xelatex
\begin{filecontents}{refs.bib}
@article{h1,
 author = {حسن ذاکری and سجاد ازگلی},
 year = {1392},
 title = {روش طراحی کنترلگر \lr{PI} برای دسته‌ای از سامانه‌های غیرخطی دارای عدم قطعیت به کمک تجزیه مجموع مربعات},
 pages = {47--59},
 volume = {11},
 number = {2},
 journal = {مجله کنترل},
 language={persian}
}

@inproceedings{h2,
  title={Robust PI Design for Chaos Control Using Sum of Squares Approach},
  author={Zakeri, Hasan and Ozgoli, Sadjaad},
  booktitle={The 2nd International Conference on Control, Instrumentation, and Automation (ICCIA2011)},
  language={latin}
}
\end{filecontents}
\documentclass{article}
\usepackage{xepersian}
\begin{document}
سلام. این یک تکه متن فارسی~\مرجع{h1} همراه با چند مرجع می‌باشد~\cite{h2}.
سلام. این یک تکه متن فارسی~\مرجع{h1} همراه با چند مرجع می‌باشد~\cite{h2}.
سلام. این یک تکه متن فارسی~\مرجع{h1} همراه با چند مرجع می‌باشد~\cite{h2}.
سلام. این یک تکه متن فارسی~\مرجع{h1} همراه با چند مرجع می‌باشد~\cite{h2}.
\begin{latin}
Some latin text~\cite{h1} with some citation~\cite{h1,h2}.
Some latin text~\cite{h1} with some citation~\cite{h1,h2}.
Some latin text~\cite{h1} with some citation~\cite{h1,h2}.
Some latin text~\cite{h1} with some citation~\cite{h1,h2}.
\end{latin}
\bibliographystyle{ieeetr-fa}
\bibliography{refs.bib}
\end{document}

Also,

  • take note the language tag of each bibtex entry;
  • \مرجع is equivalent of \cite
5
  • That is part of the example I provided. See the english block, it is enclosed in a latin environment. XePersian sets the default language of your document to persian. You can enclose your whole document in a latin environment and insert your persian citation the way I did. Jun 22, 2013 at 15:41
  • No it doesn't. It actually defines it as: \if@RTL مراجع \else Bibliography\fi. So, just enclose your whole document in a latin environment, and everything will be just fine. If necessary, comment, and I will post a complete example with output. Jun 28, 2013 at 16:20
  • Oh, you were right, there seems to be a bug in persian-bib. It doesn't perform correctly in latin mode. I will make contact with the author and let him know. Jun 28, 2013 at 16:24
  • Well, its hard to say that. Using latin mode in xepersian, you will hardly notice anything different (well except those concerning xdvipdfmx driver). The main engine behind xepersian is bidi and fontspec, and I don't think you can go much far with RTL insertion without any of them. eq, polyglossia uses bidi too. Jun 28, 2013 at 17:33
  • XePersian make all document RTL by default and have some other effects on English. Please consider removing this answer. Mar 28, 2014 at 7:06
0

In the new version of Persian-bib package (Version 0.8), I added a new style Persian-fa-inLTR.bst, which can be used for these situations. The following example shows how to use it:

% !TEX TS-program = XeLaTeX 
\begin{filecontents}{SomeReferences.bib}
@CONFERENCE{Amintoosi87afzayesh,
  AUTHOR =       {امین‌طوسی,محمود and مزینی,ناصر and  فتحی,محمود},
  TITLE =        {افزایش وضوح ناحیه‌ای},
  BOOKTITLE =    {چهاردهمین کنفرانس ملی سالانه انجمن کامپیوتر ایران},
  YEAR =         {۱۳۸۷},
  ORGANIZATION = {دانشگاه امیرکبیر},
  ADDRESS =      {تهران، ایران},
  month =        {اسفند},
  pages = {۱۰۱-۱۰۸},
  LANGUAGE =     {Persian},  
  url = {http://www.civilica.com/Paper-ACCSI14-ACCSI14_107.htm}
}

@article{Baker02limits,
 author = {Baker,, Simon and Kanade,, Takeo},
 title = {Limits on Super-Resolution and How to Break Them},
 journal = {IEEE Trans. Pattern Anal. Mach. Intell.},
 volume = {24},
 number = {9},
 year = {2002},
 issn = {0162-8828},
 pages = {1167--1183},
 publisher = {IEEE Computer Society},
 address = {Washington, DC, USA}
 }
\end{filecontents}

\documentclass[10pt,a4paper]{article}

\usepackage{listings}

\usepackage{fontspec}

\newfontfamily\Persianfont[Script=Arabic,Scale=1]{Yas}
\makeatletter
\TeXXeTstate=1
\def\Persiantext#1{\begingroup\beginR\Persianfont#1\endR\endgroup}
\makeatother

\usepackage{bidi}

\begin{document}
\title{Persian-Arabic References in Latin Documnets}
\author{ Mahmood Amintoosi \\
Hakim Sabzevari University\\
Sabzevar, Iran\\
{\small [email protected] }}
\date{}

\maketitle

\section{Introduction}
Suppose the you want to have Persian or Arabic references such as this  Persian
    \cite{Amintoosi87afzayesh} and this Latin \cite{Baker02limits} references. In this case - with the power of bidi package - Persian-faLTR.bst style in Persian-bib package is the right solution.
You should insert the following codes in the premable of your document and use a suitable style in your documnet:

\begin{lstlisting}[language=tex,breaklines=true, basicstyle=\ttfamily, numberstyle=\footnotesize, numbersep=10pt, captionpos=b, frame=single, breakatwhitespace=false]
\usepackage{fontspec}
\newfontfamily\Persianfont[Script=Arabic,Scale=1]{Yas}
\makeatletter
\TeXXeTstate=1
\def\Persiantext#1{\begingroup\beginR\Persianfont#1\endR\endgroup}
\makeatother
\end{lstlisting}

Note that the encoding of your .bib file should be UTF-8. 

Also you can use Persian and Arabic text between Latin text, with bidi package and the
    above Persiantext command.
For example you may have a Persian paragraph such as follows:

\begin{RTL}
\Persiantext{آدمی در عالم خاکی نمی‌آید بدست}
\end{RTL}

Or a brief text such as:
\Persiantext{این متن}
between your Latin text.


\bibliographystyle{plain-fa-inLTR}
\bibliography{SomeReferences}

\end{document}
2
  • 1
    You should really consider combining your two answers. The single answer will be more complete. Apr 29, 2015 at 16:31
  • At the time of the first answer, there was not a suitable BibTeX style, hence my first answer was the solution without BibTeX, but the second answer is the solution with BibTeX. In my opinion combining the two answer, may confuse the reader. Apr 30, 2015 at 19:05

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .