user-is-inactive-forever / xepersian Goto Github PK
View Code? Open in Web Editor NEWPersian for LaTeX, using XeTeX
Home Page: https://ctan.org/pkg/xepersian
Persian for LaTeX, using XeTeX
Home Page: https://ctan.org/pkg/xepersian
When LaTeX cannot fit all words neatly on one line of text, it pushes some words beyond the margins. Using XePersian, it is always the right-hand margin that is violated, regardless of text direction. With right-to-left text, I would expect text to extend beyond the left-hand margin instead.
bidi
packagebidi
package issue tracker has been searched for similar issues?% !TEX TS-program = XeLaTeX
% !TEX encoding = UTF-8 Unicode
\documentclass{article}
\usepackage{xepersian}
\settextfont[ExternalLocation, Scale=1.25]{XB Niloofar.ttf}
\begin{document}
\leftskip6em\rightskip\leftskip
نیما در سال ۱۲۷۶[۷] هجری شمسی در روستای یوش، از توابع بخش بلده شهرستان نور، بهدنیا آمد. پدرش، ابراهیمخان اِعظامالسلطنه، متعلق به خانوادهای قدیمی در مازندران بود و به کشاورزی و گلهداری مشغول بود.[۸] بنابر بسیاری از منابع و از جمله کتاب تاریخ خانواده اسفندیاری تألیف اسدالله اسفندیاری چاپ ۱۳۲۹،[۹] نیما یوشیج (علی اسفندیاری) و خاندان اسفندیاری از خاندانهای معروف ایران و نور استان مازندران در دوره قاجار و پهلوی است که نسب ایشان به شاخهای از اسپهبدان طبرستان موسوم به پادوسبانیان میرسد. پادوسبانیان سلسلهای ساسانیتبار بودند که از حدود سال ۴۰هجری تا دوران شاه عباس کبیر صفوی بر بخشهایی از طبرستان (بعداً مازندران) حکمرانی میکردند. علی اسفندیاری (نیما یوشیج) و محتشمالسلطنه از مشهورترین اعضای این خاندان هستند. در عصر قاجار و پهلوی، وزرا و نمایندگان مجلس و چهرههای سیاسی و علمی و هنرمندان متعددی از میان افراد این خانواده برخاستند.حتی پس از درگذشت حسن اسفندیاری (محتشم السلطنه) در سال ۱۳۲۳ شمسی که از صاحب منصبان مشهور و وزیر چند وزارتخانه بود، کتابی به عنوان زندگی حسن اسفندیاری به چاپ رسید. نیما یوشیج در آغاز کتاب نسب و تبار خاندانش را شرح می دهد[۱۰].نیما یوشیج در کتاب زندگی حسن اسفندیاری نسب و تبار خاندانش را به پادوسبانیان طبرستان میرساند[۱۱][۱۲]
% Text CC BY-SA 3.0 https://fa.wikipedia.org/wiki/نیما_یوشیج
\end{document}
Lines that do not fit within textwidth
are extended beyond the margins on the left side.
It seems siunitx
package is not compatible xepersian
package. The decimal point does not change to the Persian decimal separator i.e. momayyez in \SI
or \num
sequences. Also \SIlist
and \SIrange
sequences have incorrect direction and should change words "and" and "to" into proper equivalents. Finally, xepersian
package eliminates the degree symbol ° even in the latin
environment.
bidi
packagebidi
package issue tracker has been searched for similar issues?% !TEX TS-program = XeLaTeX
% !TEX encoding = UTF-8 Unicode
\documentclass{article}
\usepackage{siunitx}
%\sisetup{detect-mode} %detect-all
\usepackage{xepersian}
\settextfont{Yas}
\setmathdigitfont{Yas}
%\usepackage{fontspec}
%\setmainfont[Script=Arabic]{Yas}
%\usepackage{bidi}
\DeclareSIUnit{\calorie}{cal}
\begin{document}
یک کالری کوچک تقریباً برابر است با $4.2$ ژول (بهطور دقیق $4.1868$ ژول)
\[\SI{1}{\calorie} = \SI{4.1868}{\joule}\]
\SIlist{0.13;0.67;0.80}{\milli\metre}
\SIrange{0.13}{0.67}{\milli\metre}
\num{3.45d-4}
\ang{4,5}
\ang{1;2;3} $\ang{1;2;3}$
\begin{latin}
\[\SI{1}{\calorie} = \SI{4.1868}{\joule}\]
\SIlist{0.13;0.67;0.80}{\milli\metre}
\SIrange{0.13}{0.67}{\milli\metre}
\num{3.45d-4}
\ang{4,5} Where is the $^{\circ}$ (degree) symbol?!
\ang{1;2;3} $\ang{1;2;3}$
\end{latin}
\end{document}
Latex users in Afghanistan may want to use Xepersian for typesetting their Persian documents. I would be very grateful If you add an option to Xepersian to handle it. In the attached pdf you can find the differences between the Persian language in Iran and Afghanistan.
Dear Dr. Khalighi
I worked with Xepersin in TeXlive 2018. After updating it to TeXlive 2019, I found an error with the following content in the line \settextfont:
! LaTeX3 Error: Command '\fontname' already defined!
I will be glad to solve this problem.
Yours sincerely
Mohammad Golestani
Using columns inside a XePersian Latin environment, the columns are in the wrong order (i.e., the first column is on the right-hand side of the page). In some cases, adding \LTRdblcol
fixes this, but not always.
Specifically, when using makeidx
's \printindex
command, which prints a two-column index, in a Latin environment, the columns are in the wrong order. The same problem occurs when using a multicols
environment. In the case of makeidx
, this can be resolved by using bidi
's \LTRdblcol
--- but this should not be necessary. Furthermore, \LTRdblcol
does not fix the same issue in the multicols
environment.
bidi
packagebidi
package issue tracker has been searched for similar issues?% !TEX TS-program = XeLaTeX
% !TEX encoding = UTF-8 Unicode
\documentclass{article}
\usepackage{makeidx}
\usepackage{multicol}
\usepackage{xepersian}
\settextfont{IRXLotus}
\makeindex
\begin{document}
\begin{latin}
\index{a}
\index{b}
% \LTRdblcol
\printindex
\begin{multicols}{2}
First column
\vfill\columnbreak
Second column
\end{multicols}
\end{latin}
\end{document}
The first page should have an automatically generated two-column index, where the columns are populated left-to-right. The second page should have a two-column multicols
environment, where the columns are populated left-to-right.
Instead, both are populated right-to-left. The \LTRdblcol
command only solves the index, not the multicols
environment.
bidi
packagebidi
package issue tracker has been searched for similar issues?% !TEX TS-program = XeLaTeX
% !TEX encoding = UTF-8 Unicode
\documentclass[a4paper,11pt]{book}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{lmodern}
\usepackage{amsbsy,amssymb,amsmath,amsfonts}
\usepackage{perpage} %the perpage package
\MakePerPage{footnote} %the perpage package command
\usepackage{import}%\import command
\usepackage[toc,page]{appendix}
\usepackage{ouralgorithmic,ouralgorithm}%Algorithm
\usepackage{glossaries}
\usepackage[xindy]{imakeidx}
\usepackage{graphicx}
\usepackage[numbers]{natbib}
\usepackage[colorlinks=true,linkcolor=blue,citecolor=blue]{hyperref}
\hypersetup{backref,
colorlinks=True}
[SAMPLE.pdf](https://github.com/vafakhalighi/xepersian/files/3563135/SAMPLE.pdf)
[SAMPLE.pdf](https://github.com/vafakhalighi/xepersian/files/3563137/SAMPLE.pdf)
[SAMPLE.pdf](https://github.com/vafakhalighi/xepersian/files/3563155/SAMPLE.pdf)
[SAMPLE.pdf](https://github.com/vafakhalighi/xepersian/files/3563159/SAMPLE.pdf)
\usepackage[perpage]{footmisc}%Footnote numbering reset each page
\usepackage{xepersian}
\defpersianfont\nastaligh[Scale=1.6]{IranNastaliq}%فونت تقدیر
\defpersianfont\stitr[Scale=1]{XB Titre Shadow}%فونت کتاب
\defpersianfont\khayam[Scale=1]{XB Kayhan Bold}
\defpersianfont\kamran[Scale=1.5]{B Kamran}
\defpersianfont\roya[Scale=1]{XB Roya}
%\defpersianfont\yagut[Scale=1]{XB Yagut}
%\defpersianfont\grana[Scale=1.2]{Mj_Granada}
%\defpersianfont\titr[Scale=1.5]{XB Titre}
%\defpersianfont\zar[Scale=1]{XB Zar}
%\setromantextfont[Scale=1]{Tahoma}
%\setdigitfont[Scale=1]{XB Zar}
%\setdigitfont[Scale=1]{XP Ziba}
%\defpersianfont\fontname[Scale=2]{IranNastaliq}
%\settextfont{Persian Modern}
\settextfont{XB Zar}%فونت متن
\setdigitfont[Scale=0.9]{Persian Modern}%فونت اعداد
% Theorem *****************************************************
% Template \newtheorem{envname}[counter]{name}[section]
% Use ÷ \begin{abb. name}[label that is shown between ()] \label{abb. name:label} \end{name}
\newenvironment{myquotem}[1]%
{\list{}{\leftmargin=#1\rightmargin=#1}\item[]}%
{\endlist}
\newenvironment{myquote}%
{\list{}{\leftmargin=10mm\rightmargin=10mm}\item[]}%
{\endlist}
\newcounter{example}[chapter]
\numberwithin{example}{chapter}
\newenvironment{example}[1][]
{
\refstepcounter{example}\par\medskip
\vspace{.5cm}\noindent\textbf{$\blacksquare$\quad مثال~\theexample #1}\\[-.1cm]%\begin{center}\begin{minipage}{.9\textwidth\raggedleft}\rmfamily
\vspace{-1.5em}\begin{sloppypar}\begin{myquote}
}
{
%\end{minipage}\end{center}
\end{myquote}\end{sloppypar}\medskip%\\[.3cm]
}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Commands %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%\counterwithout{footnote}{section}%Footnote numbering reset each section
\newcommand{\MIN}{\textnormal{\lr{minimize}}}
\newcommand{\MAX}{\textnormal{\lr{maximize}}}
\newcommand{\dom}{\textnormal{\lr{dom}}}
\newcommand{\SUB}{\textnormal{\lr{subject to}}}
\newcommand{\er}{\textnormal{\lr{erf}}}
\newcommand{\BS}[1]{\boldsymbol{#1}}
\newcommand{\Real}{\Re}%{\mathcal{R}}
\newcommand{\x}{\BS{x}}
\newcommand{\y}{\BS{y}}
\newcommand{\A}{\BS{A}}
\newcommand{\h}{\BS{H}}
\newcommand{\vr}{\BS{r}}
\newcommand{\vt}{\BS{t}}
\newcommand{\vF}{\BS{F}}
\newcommand{\vP}{\BS{P}}
\newcommand{\bsu}{\BS{u}}
\newcommand{\bsv}{\BS{v}}
\newcommand{\To}{\rightarrow}
\newcommand{\s}{\BS{s}}
\DeclareMathAlphabet{\pazocal}{OMS}{zplm}{m}{n}
\newcommand{\pl}{\pazocal{L}}
\newcommand{\pk}{\pazocal{K}}
\newcommand{\pn}{\pazocal{N}}
\newcommand{\pp}{\pazocal{P}}
\newcommand{\kr}[1]{\textnormal{\kamran{#1}}}
\newcommand{\roy}[1]{\textnormal{\roya{#1}}}
\newcommand{\vect}[3]{#1_#2,\ldots,#1_#3}
\newcommand{\sd}[3]{#1_#2+\ldots+#1_#3}
\makeindex%{intoc}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% 'dedication' environment: To add a dedication paragraph at the start of book %
% Source: http://www.tug.org/pipermail/texhax/2010-June/015184.html %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\newenvironment{dedication}
{
\cleardoublepage
\thispagestyle{empty}
\vspace*{\stretch{1}}
\hfill\begin{minipage}[t]{0.66\textwidth}
\raggedright
}%
{
\end{minipage}
\vspace*{\stretch{3}}
\clearpage
}
%**************************** Algorithm ******************************
\newenvironment{algo}
{
\hfill\begin{minipage}[t]{0.9\textwidth}
\hrule
%\raggedright
}%
{
\end{minipage}
}
%***********************************************************************
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Chapter quote at the start of chapter %
% Source: http://tex.stackexchange.com/a/53380 %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\makeatletter
\renewcommand{\@chapapp}{}% Not necessary...
\newenvironment{chapquote}[2][2em]
{\setlength{\@tempdima}{#1}%
\def\chapquote@author{#2}%
\parshape 1 \@tempdima \dimexpr\textwidth-2\@tempdima\relax%
\itshape}
{\par\normalfont\hfill--\ \chapquote@author\hspace*{\@tempdima}\par\bigskip}
\makeatother
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% First page of book which contains 'stuff' like: %
% - Book title, subtitle %
% - Book author name %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Book's title and subtitle
\title{{\Huge {\stitr{بهینهسازی مهندسی}}}\\% \footnote{این یک پانوشت.} \\
\vspace{1cm} \huge {\khayam معرفی به همراه کاربردهایی از الگوریتمهای فراابتکاری}} %\footnote{این یک پانوشت دیگر است.}}
% Author
\author{\textsc{محمد گلستانی و علیرضا سپاسیان}}%\thanks{\url{www.example.com}}
\date{دی ماه 1396}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Glassory %%%%%%%%%%%%%%%%%%%%%%%%
%\makeglossaries
\begin{document}
\providecommand{\url}[1]{{#1}}
\providecommand{\urlprefix}{URL }
\expandafter\ifx\csname urlstyle\endcsname\relax
\providecommand{\doi}[1]{DOI~\discretionary{}{}{}#1}\else
\providecommand{\doi}{DOI~\discretionary{}{}{}\begingroup
\urlstyle{rm}\Url}\fi
\frontmatter
\maketitle
\end{document}
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.