Code Monkey home page Code Monkey logo

xepersian's Introduction

The xepersian Package

The xepersian package provides a convenient interface for typesetting Persian and English documents with LaTeX, using the XeTeX engine.

The package includes adaptations for use with many other commonly-used packages.

The official versions of the package is released on CTAN.

Using the Package

The following example illustrates how the package can be used.

\documentclass{article}
\usepackage{xepersian}
\settextfont{<fontname>}
\begin{document}
...
\end{document}

Reporting Issues

If you think that you have found an issue in the package, please use the package issue tracker to report it.

xepersian's People

Contributors

vafakhalighi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

hadisfr neouyghur

xepersian's Issues

Problem in beamer columns with blocks in shadow rounded themes


Brief outline of the issue

When I use some themes such as Warsaw that has shadow rounded inner theme, the block texts direction and their boxes around the texts in the blocks are messed up; But there is no problem with other innertheme.

Check/indicate

  • [*] Relevant to the bidi package
  • [*] The bidi package issue tracker has been searched for similar issues?
  • Issue tracker has been searched for similar issues?
  • Links to <tex.stackexchange.com> discussion if appropriate
  • Links to <qa.parsilatex.com> discussion if appropriate

Minimal example showing the issue

% !TEX TS-program = XeLaTeX
% !TEX encoding = UTF-8 Unicode


\documentclass{beamer}            % or some other class

\usetheme{Warsaw}
  % Any packages other than the xepersian package must be loaded here

  % The xepersian package must be loaded as the last package
\usepackage[%
    % Any xepersian package option goes here
]{xepersian}
\settextfont{IRXLotus}

  % Any preamble code goes here
  
\begin{document}
	
\begin{frame}[t]{بلوکها در ستونها}
\begin{columns}[t]
	\column{0.5\textwidth}
	\begin{block}{Block 1}
					متن مربوط به بلوک 1
	\end{block}
	\column{0.5\textwidth}
	\begin{block}{Block 2}
				متن مربوط به بلوک 2
	\end{block}
	\end{columns}
\end{frame}
	
\end{document}

Expected behavior

Log and PDF files

Math Digits


Hi,
I write a simple tex file. When I enter the command \setmathdigitfont is see the following error:
_xepersian_mathsdigitspec_primitive_font_char_if_exist:nF ...
\l_fontspec_font "#1\scan
...

Brief outline of the issue

Check/indicate

  • Relevant to the bidi package
  • The bidi package issue tracker has been searched for similar issues?
  • Issue tracker has been searched for similar issues?
  • Links to <tex.stackexchange.com> discussion if appropriate
  • Links to <qa.parsilatex.com> discussion if appropriate

Minimal example showing the issue

% !TEX TS-program = XeLaTeX
% !TEX encoding = UTF-8 Unicode


\documentclass{book}

\usepackage{xepersian}
\setlength{\textheight}{25cm}
\settextfont{Persian Modern}
%\setlatintextfont{Persian Modern}
\setmathdigitfont{Tahoma}
%\setmathsfdigitfont{Persian Modern}
%\setmathttdigitfont{Persian Modern}
\begin{document}
 سلام 123456790
\[1023\] 
  $1234567890$
\end{document}

Expected behavior

Log and PDF files

Test2.pdf
Test2.log

\setdigitfont doesn't work!

After updating to the latest version of TeXLive [Version 3.14159265-2.6-0.999992 (TeX Live 2020) (preloaded format=xelatex 2020.7.22)], \setdigitfont and its family doesn't work resulting in an error like below:

! Undefined control sequence.
\__xepersian_mathsdigitspec_primitive_font_char_if_exist:nF ...
                                                  \l_fontspec_font "#1\scan_...

MWE:

\documentclass{article}

\usepackage{xepersian}
\settextfont{Yas}
\setdigitfont{Yas}

\begin{document}
سلام این یک متن آزمایشی با عدد ۰۱۲۳۴۵۶۷۸۹ است. 
\end{document}

Default paper size for exported pdf


When xepersian is used, default paper size is US Letter, even though I've set tlmgr paper a4.

I should use [a4paper] after documentclass to solve this issue
But when I use xelatex without including xepersian, there's no problem.

XeTeX, Version 3.14159265-2.6-0.999992 (TeX Live 2020) (preloaded format=xelatex 2020.8.13)

Incorrect margin display with xepersian and showframe in last update (2021)


Brief outline of the issue

Margin display with xepersian and showframe is not correct.

Check/indicate

  • Relevant to the xepersian package
  • The xepersian package issue tracker has been searched for similar issues?
  • Issue tracker has been searched for similar issues?
  • Links to <tex.stackexchange.com> discussion if appropriate
  • Links to <qa.parsilatex.com> discussion if appropriate

Minimal example showing the issue

% !TEX TS-program = XeLaTeX
% !TEX encoding = UTF-8 Unicode
\documentclass{article} % Also report and book
\usepackage{showframe}
\usepackage{xepersian}
\settextfont{Amiri}
\begin{document}
سلام
\end{document}

Expected behavior

Log and PDF files

test.log
test.pdf

Broken characters in Kashida in dev version

Hi Vafa!

Brief outline of the issue

Different difficulties have been known for using Kashida options. With recent changes, many of them seems to be fixed.

It seems that recent unreleased commit a91d9bc will make some of the fixed problem reappear.

Minimal example showing the issue

\documentclass{article}
\usepackage{bidipoem}
\usepackage[localise, Kashida]{xepersian}
\settextfont{XB Niloofar}
\begin{document}
\begin{traditionalpoem}
من آن مرغ سخندانم که در خاکم رود صورت&
هنوز آواز می‌آید به معنی از گلستانم
\end{traditionalpoem}
\end{document}

Expected behavior

image

(Seen in v23.1, 2020/05/17)

Actual behavior

image

(Seen after patching a91d9bc)

Log and PDF files

xepersian_poem_002.log
xepersian_poem_002.pdf

\special issues in right to left mode

The TeX--XeT algorithm reverses whatsits and as a result, the \special pairs will be placed in the wrong order. For instance, color or links or any other thing which is achieved via driver is fundamentally broken in right to left mode.

For instance, the following minimal Plain TeX document illustrates the issue with color.

\TeXXeTstate=1
This is \beginR\special{color push rgb 1 0 0}RED COLOR\special{color pop}\endR{} as you can see.
\bye

As mentioned above, this is Engine issue. Peter was working towards fixing this (See this TeXLive commit and this one.

The bidi package fixes this in a limited way; if the colored text only is on a single line then text will be colored correctly. However, if the colored text is more than a line (it breaks across several lines), then the resulting colored text is wrong.

This can be fixed in the macro level as the following example illustrates.

\documentclass{article}


\usepackage{xepersian}

\settextfont{Yas}

\makeatletter

\long\def\bidi@addto#1#2{\expandafter\def\expandafter#1\expandafter{#1#2}}

\bgroup \catcode`!=3 \catcode`?=3
\gdef\bidi@replacestrings#1#2{\long\def\bidi@replacestringsA##1#1##2!{%
   \ifx!##2!\bidi@addto\bidi@tmpb{##1}\else\bidi@addto\bidi@tmpb{##1#2}\bidi@replacestringsA##2!\fi}%
   \edef\bidi@tmpb{\expandafter}\expandafter\bidi@replacestringsA\bidi@tmpb?#1!%
   \long\def\bidi@replacestringsA##1?{\def\bidi@tmpb{##1}}\expandafter\bidi@replacestringsA\bidi@tmpb
}
\egroup



\newbox\bidi@color@start@box  \newbox\bidi@color@end@box
\setbox\bidi@color@start@box=\hbox{\special{color pop}}
\setbox\bidi@color@end@box=\hbox{\special{color push rgb 1 0 0}}%

\def\bidicolor#1{\def\bidi@tmpb{#1}\bidi@replacestrings{ }{\bidi@specialspace}%
   {\copy\bidi@color@start@box\bidi@tmpb\copy\bidi@color@end@box}%
}
\def\bidi@specialspace{%
   \discretionary{\copy\bidi@color@end@box}{\copy\bidi@color@start@box}{\kern\fontdimen2\font}%      
   \nobreak\hskip 0pt plus\fontdimen3\font minus\fontdimen4\font
}

\makeatother

\begin{document}
این یک متن معمولی است
\bidicolor{این متن با رنگ قرمز نوشته می‌شود که در یک سطر قرار می‌گیرد}
و این متن بعد آن است که به سطر بعد می‌رود و
\bidicolor{%
حالا یک متن رنگی می‌نویسیم که در چندین سطر قرار بگیرید تا کارایی رنگی کردن متن را ببینیم کنون ای خردمند وصف خرد          بدین جایگه گفتن اندرخورد
کنون تا چه داری بیار از خرد          که گوش نیوشنده زو برخورد
خرد بهتر از هر چه ایزد بداد          ستایش خرد را به از راه داد
خرد رهنمای و خرد دلگشای          خرد دست گیرد به هر دو سرای
ازو شادمانی وزویت غمیست          وزویت فزونی وزویت کمیست
خرد تیره و مرد روشن روان          نباشد همی شادمان یک زمان
چه گفت آن خردمند مرد خرد          که دانا ز گفتار از برخور
}
و ادامه متن که با رنگ سیاه نوشته می‌شود همانطوری که می‌بینید هیچ مشکلی ندارد و رنگ چکه نمی‌کند.
\end{document}

The only disadvantage of this is that there is no hyphenation but that is rarely a problem since we do not really have hyphenation in right to left text.

Perhaps this approach can be extended to support any packages which uses \special (e.g. color, xcolor, hyperref, etc).

Package conflict: catchfilebetweentags


Brief outline of the issue

As per the documentation, XePersian should be loaded last. However, loading the catchfilebetweentags package before XePersian causes a bunch of errors. Loading it after XePersian works, but with a warning.

Check/indicate

  • Relevant to the bidi package
  • The bidi package issue tracker has been searched for similar issues?
  • Issue tracker has been searched for similar issues?
  • Links to <tex.stackexchange.com> discussion if appropriate
  • Links to <qa.parsilatex.com> discussion if appropriate

Minimal example showing the issue

% !TEX TS-program = XeLaTeX
% !TEX encoding = UTF-8 Unicode

\documentclass{article}

\usepackage{catchfilebetweentags}
\usepackage{xepersian}

\settextfont[ExternalLocation]{XB Niloofar.ttf}

\begin{document} 

سلام

\end{document}

Expected behavior

Compilation without errors or warnings.

Log and PDF files

xepersian-catchfilebetweentags.log
xepersian-catchfilebetweentags.pdf

The problem of not displaying the sidebar on the first few pages of Steel Saahel

In question parsilatex

Minimal code:

\PassOptionsToPackage{urlcolor=link-text,colorlinks=true,linkcolor=link-text,setpagesize=false,pdfpagemode=FullScreen}{hyperref}
\documentclass[12pt,oneside]{bidipresentation}
\usepackage{xcolor}
\usepackage{tikz}

\def\theTitle{آشنایی با نرم‌افزار حروف‌چینی لاتک و بستهٔ زی‌پرشین}
\def\theAuthor{محمود امین‌طوسی}
\def\theAuthorUrl{http://profs.hsu.ac.ir/mamintoosi}
\def\theCompany{دانشگاه حکیم سبزواری، دانشکده ریاضی و علوم کامپیوتر}
\def\theCompanyUrl{http://www.parsilatex.com}
\def\theDate{ مهر ۱۳۹۲}
\def\Logo{HSU-logo}

\usepackage{saahel}
\usepackage{xepersian}
\settextfont{Yas}

\title{\theTitle}
\author{\href{\theAuthorUrl}{\theAuthor}}
\date{\theDate}
\selectThemeColor{NavyBlue}
\linespread{2}
\pagestyle{pres}

\begin{document}

\setTextTL{\bfseries\theTitle}
\setTextBR{گروه پارسی‌لاتک \hfill \lr{$\qquad$ www.parsilatex.com} }
\setcounter{tocdepth}{1}
\begin{plainslide}
اسلاید اول
\end{plainslide}
\begin{plainslide}
اسلاید دوم
\end{plainslide}
\subsection{زیربخش}
\begin{plainslide}
اسلاید سوم
\end{plainslide}

\end{document}

Sahel2014.zip

If the class is written before the document:
\RequirePackage{tikz}

output:
با افزودن بسته تیکز قبل داکیومنت کلاس در تک لایو 2015 تا 2020 خروجی زیر هست.
exam.pdf

Right-to-left columns in Latin environment


Brief outline of the issue

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.

Check/indicate

  • Relevant to the bidi package
  • The bidi package issue tracker has been searched for similar issues?
  • Issue tracker has been searched for similar issues?
  • Links to <tex.stackexchange.com> discussion if appropriate
  • Links to <qa.parsilatex.com> discussion if appropriate

Minimal example showing the issue

% !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}

Expected behavior

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.

Log and PDF files

xepersiancolumns.log

xepersiancolumns.pdf

Proposed Changes

It was indeed my expectation that any columns started in a latin environment would default to LTR. Using a single global option works fine for my document, where I only need one and the same column order throughout. I can see how switching between different column orders within the same document may actually be really confusing, but a RTL column order with LTR text (and vice versa) is, too. Perhaps it's best to leave the choice to the user, but emphasise that this choice exists --- e.g. \begin{...}[LTRcols] and \begin{...}[RTLcols] as additional, optional arguments for the latin and persian environments.

The background color is not to be placed when used xepersian! Is it solvable?

% !TeX TS-program = xelatex
\documentclass{beamer}
\setbeamertemplate{background canvas}[vertical shading][bottom=blue!50,top=blue!1]

\usepackage{xepersian}
\settextfont{Yas}

\title{background}
\author{M.Ahmadi}
\date{\today}
\begin{document}

\begin{frame}
\titlepage 
\end{frame}

\end{document}

output:
background-canvas-xepersian.log

background-canvas-xepersian.pdf

output Without xepersian:
background-canvas.log

background-canvas.pdf

Error when using blur shadow with setdigitfont command


\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{shadows.blur}
\usepackage{xepersian}
\settextfont{Yas}
%استفاده از 2 دستور زیر با گزینه مثال shadows.blur خطا دارد!
\setdigitfont{Yas}
%\settextdigitfont{Yas}
% استفاده از دستور زیر مشکلی ندارد.
%\setmathdigitfont{Yas}

\begin{document}
تست
\begin{tikzpicture}
\filldraw[fill=white, draw=black,blur shadow](0,0) rectangle (1,1);
\end{tikzpicture}

\end{document}

output:
shadows-blur-TL2020.log

shadows-blur-TL2020.pdf

Kashida option incompatible with Ligatures=Rare (+dlig)


Brief outline of the issue

Through a lot of trial and error, I seem to have found out that settextfont does not pass Ligatures=Rare (or RawFeature=+dlig) to fontspec when package class option Kashida is used.

Is this a bug or a feature ?

Upon further inspection, the issue is not related to package option Kashida per se, but with Kashida activation within text which disables ligatures as a side effect.

In the latter case, then the documentation should specify that using Kashida excludes using discretionary ligatures.

Check/indicate

  • Relevant to the bidi package
  • The bidi package issue tracker has been searched for similar issues?
  • Issue tracker has been searched for similar issues?
  • Links to <tex.stackexchange.com> discussion if appropriate
  • Links to <qa.parsilatex.com> discussion if appropriate

Minimal example showing the issue

%%!TEX TS-program = xelatex
%!TEX encoding = UTF-8 Unicode
\documentclass[12pt,a4paper]{article}
\usepackage{polyglossia}
\setdefaultlanguage{persian}
\usepackage[Kashida]{xepersian}
\settextfont{Noto Sans Arabic}[Ligatures=Rare]
\begin{document}
\begin{latin}
With KashidaOn:
\end{latin}

\KashidaOn
فرج‌الله نیک‌نژاد.


\begin{latin}
With KashidaOff:
\end{latin}

\KashidaOff
فرج‌الله نیک‌نژاد.
\end{document}

Note: The source code does not contain the kasra that is shown on Github site (where ligatures are activated !!).

Same issue appears with other fonts such as Adobe Arabic.

Expected behavior

Log and PDF files

siunitx package is incompatible with bidi / XePersian


Brief outline of the feature request

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.

Check/indicate

  • Relevant to the bidi package
  • The bidi package issue tracker has been searched for similar issues?
  • Issue tracker has been searched for similar issues?
  • Links to <tex.stackexchange.com> discussion if appropriate
  • Links to <qa.parsilatex.com> discussion if appropriate

Minimal example

% !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}

Expected behavior

See outline.

Log and PDF files

siunitx.MWE.log

siunitx.MWE.pdf

Kashida in color texts

The horizontal lines produced by Kashida feature do not follow the color of the font.
image

Related to this parsilatex post.

Minimal example showing the issue

%In the Name of God, Most Gracious, Most Merciful

\documentclass[11pt, a4paper]{book}

\usepackage{xecolor}
\usepackage[Kashida]{xepersian}

\settextfont[Scale=2]{IRNazanin}

\begin{document}
\def\sampletext{وی دهقان و دهقان‌زاده بود. او آغاز زندگی را در روزگار سامانیان و هم‌زمان با جنبش استقلال‌خواهی و هویت‌طلبی در میان ایرانیان سپری کرد.}
\noindent
\sampletext
\\
{\xecolor{red} \sampletext}
\end{document}

تغییر عنوان فهرست جداول

کاربرد جمع مکسر (مانند موارد، مدارس، تفاسیر، جداول، و غیره) ویژه‌ی زبان عربی است و برای فارسی‌نویسی باید تا جایی که ممکن است واژه‌های عربی را با نشانه فارسی جمع ببندیم. بنابراین موردها، مدرسه‌ها، تفسیرها، جدولها، کتابها، و غیره درست‌تر است. نتیجه این که کاربرد «فهرست جدولها» درست‌تر است.
من به کاربرد دستور

\renewcommand{\listtablename}{فهرست جدولها}

آگاه هستم؛ اما پیش‌نهاد میکنم این تغییر در بسته زی‌پرشین انجام شود.

باتشکر – فرشاد رسولی

problem with natbib (style: chicago-fa)


Brief outline of the issue

I am using xepersian with hyperref and natbib (bibliograpgystyle: chicago-fa). The problem is this:
If a reference with two authors is cited in a way that the first author's namepositioned is at the end of one line and the second author's name at the beginning of the next line, the whole text in these two lines (instead of the names and the year) will be linked to the bib entry.

P.S. I am using the texlive distribution included in Debian Buster.

Check/indicate

  • Relevant to the bidi package
  • The bidi package issue tracker has been searched for similar issues?
  • Issue tracker has been searched for similar issues?
  • Links to <tex.stackexchange.com> discussion if appropriate
  • Links to <qa.parsilatex.com> discussion if appropriate

Minimal example showing the issue

\documentclass[12pt,a4paper]{article}

\usepackage{natbib}
\usepackage[pdfusetitle]{hyperref}
\usepackage{xepersian}
\settextfont[
Script=Arabic,
ItalicFont=Nazli,
ItalicFeatures={FakeSlant=0.25},
]{Nazli}
\setlatintextfont{Liberation Serif}
\begin{document}
	سلام سلام سلام سلام سلام سلام سلام سلام سلام سلام سلام سلام سلام سلام سلام سلام
	\cite{Staniforth2012Horizontal}
	سلام سلام سلام سلام سلام سلام سلام سلام سلام سلام سلام سلام سلام سلام سلام سلام سلام سلام سلام سلام سلام سلام سلام سلام سلام سلام سلام سلام سلام سلام سلام سلام
\bibliographystyle{chicago-fa}
\bibliography{main}

\end{document}

main.bib

@Article{Staniforth2012Horizontal,
  author    = {Staniforth, Andrew and Thuburn, John},
  title     = {Horizontal grids for global weather and climate prediction models: a review},
  journal   = {Quarterly Journal of the Royal Meteorological Society},
  year      = {2012},
  volume    = {138},
  number    = {662},
  pages     = {1-26},
  authorfa  = { استنیفورث and توبرن },
  doi       = {10.1002/qj.958},
  eprint    = {https://rmets.onlinelibrary.wiley.com/doi/pdf/10.1002/qj.958},
}

Expected behavior

Log and PDF files

Graphite-rendered font (Awami) not loaded correctly


Brief outline of the issue

The Awami Nastaliq font (also attached) requires the Graphite rendering engine to be displayed properly. The font commands provided by XePersian do not appear to allow this to be configured correctly. I am assuming this is not unique to Awami.

Check/indicate

  • Relevant to the bidi package
  • The bidi package issue tracker has been searched for similar issues?
  • Issue tracker has been searched for similar issues?
  • Links to <tex.stackexchange.com> discussion if appropriate
  • Links to <qa.parsilatex.com> discussion if appropriate

Minimal example showing the issue

% !TEX TS-program = XeLaTeX
% !TEX encoding = UTF-8 Unicode

\documentclass{article}

\usepackage[]{xepersian}
     
\settextfont[Renderer=Graphite]%
    {AwamiNastaliq-Regular.ttf}
\newfontfamily\awami[Renderer=Graphite]%
    {AwamiNastaliq-Regular.ttf}

\begin{document}

یک دو سه چهار پنخ شش هفت هشت نه ده

\awami
یک دو سه چهار پنخ شش هفت هشت نه ده

\end{document}

Expected behavior

XePersian's settextfont should behave the same as the corresponding fontspec command. However, it produces a warning that the font does not contain the requested Persian script, and does not render the Persian text correctly.

The issue appears to be with the explicit indication of a script---any script. When we add Script=Persian, Script=Arabic, or even Script= to the newfontfamily command, the results are identical to those of XePersian, and the text does not render correctly.

Log and PDF files

xepersian-graphite-awami.pdf
xepersian-graphite-awami.txt
AwamiNastaliq-2.000.zip

written permission -> nonfree

Hi Vafa - requiring your written permission to use a feature makes a package nonfree. I understand you have good reason to do this, but I have no alternative but to remove it from TeX Live as a result, which I just did. Just wanted to let you know. Hope the situation gets better one day. --best, karl.

Right-To-Left with nicematrix in math environment


Brief outline of the issue

Incorrect typesetting (direction) in math environment with nicematrix package.

TeX Live: 2021 up to date (Mid-July)
nicematrix: version 5.18 2021/07/15

Check/indicate

  • Relevant to the bidi package
  • The bidi package issue tracker has been searched for similar issues?
  • Issue tracker has been searched for similar issues?
  • Links to <tex.stackexchange.com> discussion if appropriate
  • Links to <qa.parsilatex.com> discussion if appropriate

Minimal example showing the issue

% !TEX TS-program = XeLaTeX
% !TEX encoding = UTF-8 Unicode


\documentclass[12pt]{article}

\usepackage{nicematrix}

\usepackage{xepersian}
\settextfont{IRXLotus}

\begin{document}

\[
%\setLTR % enable this command for correct output!
\begin{NiceArray}{ccc}
1 & 2 & 3 \\
4 & 5 & 6
\end{NiceArray}
\]
  
\end{document}

Expected behavior

1 2 3
4 5 6

Not:
3 2 1
6 5 4

Log and PDF files

test.log
test.pdf

Need \RequirePackage{xepersian-persiancal}

Hi There,
I am trying to use XePersian to write Farsi documents. When compiling the source file, Texmaker
returns the error message "File xepersian-persiancal not found" . Inside the XePersian style file
I see the command \RequirePackage{xepersian-persiancal}. How can I get this package?

Brief outline of the question

Check/indicate

  • Relevant to the bidi package
  • The bidi package issue tracker has been searched for similar issues?
  • Issue tracker has been searched for similar issues?
  • Links to <tex.stackexchange.com> discussion if appropriate
  • Links to <qa.parsilatex.com> discussion if appropriate

Minimal example

% !TEX TS-program = XeLaTeX
% !TEX encoding = UTF-8 Unicode


\documentclass{article}            % or some other class

  % Any packages other than the xepersian package must be loaded here

  % The xepersian package must be loaded as the last package
\usepackage[%
    % Any xepersian package option goes here
]{xepersian}
\settextfont{IRXLotus}

  % Any preamble code goes here
  
\begin{document}

  % Demonstration of question here
  
\end{document}

Expected behavior

Log and PDF files

Letting TeX users in Afghanistan use xepersian


Brief outline of the feature request

TeX 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.

Afghanistan.pdf

Check/indicate

  • Relevant to the bidi package
  • The bidi package issue tracker has been searched for similar issues?
  • Issue tracker has been searched for similar issues?
  • Links to <tex.stackexchange.com> discussion if appropriate
  • Links to <qa.parsilatex.com> discussion if appropriate

Minimal example

% !TEX TS-program = XeLaTeX
% !TEX encoding = UTF-8 Unicode


\documentclass{article}            % or some other class

  % Any packages other than the xepersian package must be loaded here

  % The xepersian package must be loaded as the last package
\usepackage[%
    % Any xepersian package option goes here
]{xepersian}
\settextfont{IRXLotus}

  % Any preamble code goes here
  
\begin{document}

  % Demonstration of feature request here
  
\end{document}

Expected behavior

Using the tkz-fct package between the curves is not colored!

\documentclass[border=3mm]{standalone}
\usepackage{amsmath,tkz-fct}
\usepackage{xepersian}
\settextfont{Yas}
\setdigitfont{Yas}

\begin{document}

\begin{tikzpicture}[scale=2.5]
\tkzInit[xmin=-1,xmax=4,ymin=0,ymax=5]
\tkzGrid
\tkzAxeXY
\tkzFct[domain = -.5:4]{ 4*x-x**2+4/(x**2+1)**2}
\tkzFct[domain = -.5:4]{x-1+4/(x**2+1)**2}
\tkzDrawAreafg[color=green,domain = 1:4]
\tkzDrawAreafg[pattern=north west lines,domain = -.5:1]
\tkzRep
\tkzText(2.5,4.5){$C_f$}
\tkzText(2.5,1){$C_g$}
\end{tikzpicture}

\end{document}

output:
tkz-fct-xepersian-TL2020.log

tkz-fct-xepersian-TL2020.pdf

output Without xepersian:
tkz-fct-TL2020.log

tkz-fct-TL2020.pdf

Wrong PDF layers in right to left mode with the package ocg-p


Brief outline of the issue

When the ocg-p package is used to create different PDF layers, the PDF layers are in the wrong order in the right to left mode.

Check/indicate

  • Relevant to the bidi package
  • The bidi package issue tracker has been searched for similar issues?
  • Issue tracker has been searched for similar issues?
  • Links to <tex.stackexchange.com> discussion if appropriate
  • Links to <qa.parsilatex.com> discussion if appropriate

Minimal example showing the issue

\documentclass{article}
\usepackage{ocg-p}
\usepackage{xepersian}
\settextfont{Yas}
\begin{document}
پایتخت ایران کجاست؟
\begin{ocg}{result layer}{rela1}{0}
تهران
\end{ocg}
\end{document}

Expected behavior

Log and PDF files

test-ocg-p.zip

setmathdigitfont doesn't work


Error for \setmathdigitfont

Recently when I updated all packages (especially xepersian-hm), gives an error for \setmathdigitfont command.

Check/indicate

Minimal example showing the issue

% !TEX TS-program = XeLaTeX
% !TEX encoding = UTF-8 Unicode
\documentclass{article}
\usepackage{xepersian}
\settextfont{Amiri}
\setmathdigitfont{Amiri}
\begin{document}
Test
\end{document}

Test.log

Log and PDF files

Problem with \DefaultMathsDigits and \PersianMathsDigits Switches

Dear Vafa

First I would like to thank you for your superb work that brings us the XePersian package!

After the recent update, the two macros of \DefaultMathsDigits and \PersianMathsDigits have stopped working. I encountered this issue with both MikTex and Tex Live on Windows platform. Here is a MWE:

\documentclass[a4paper,twoside,fleqn]{report}

\usepackage[a4paper]{geometry}
\usepackage{amsmath}
\usepackage{mathspec}
\usepackage{xepersian}

\settextfont{XB Zar}
\setlatintextfont{Times New Roman}

\setlength{\mathindent}{1cm}
\setmathdigitfont{XB Zar}
\DefaultMathsDigits

\newenvironment{parsimath}{\PersianMathsDigits}{}

\newgeometry{left=2.5cm,right=3cm,top=3cm,bottom=2.5cm}

\begin{document}

\begin{equation}
{P_{QN}} = 10\log \left( {\frac{{V_{LSB}^2}}{{12{f_s}}}} \right) = 20\log \left( {{V_{ref}}} \right) - 6.02N - 10.79 - 10\log \left( {{f_s}} \right)
\end{equation}

\begin{parsimath}
\begin{equation}
{P_{QN}} = 10\log \left( {\frac{{V_{LSB}^2}}{{12{f_s}}}} \right) = 20\log \left( {{V_{ref}}} \right) - 6.02N - 10.79 - 10\log \left( {{f_s}} \right)
\end{equation}
\end{parsimath}

\end{document}

The output: MWE.pdf

The comiler gives errors as "Undefined control sequence. \DefaultMathsDigits" and "Undefined control sequence. \PersianMathsDigits" while both equations are typeset via Persian digits, though the first one should be in English.

I appreciate your help on this matter.

The bracket inside the LRE changes

main code:

\documentclass{report}
\usepackage{xepersian}
\settextfont[Scale=1.2]{Yas}

\begin{document}

\begin{center}
 \LRE{[a=b]} 
 \\
\LRE{[a=\lr{b}]}  
\\
\LRE{\setlatin[a=\lr{b}]} 
\\
\LRE{[a=\lr{b}c]}     
\end{center} 
 
\end{document}

output:
[a=b]
[a=b[
[a=b[
[a=bc]

Make first row / column of table all bold


Brief outline of the feature request

I have a table with a number of columns and rows in which the title row has both text and math. I'd like to make all of the titles appear in bold shape. Clearly, I can add \textbf or \mathbf, etc. to each of them. However, I'm looking for a nicer way of doing this, particularly for tables with many columns. Tabu package provides \rowfont command which works perfectly with \bfseries and \boldmath as it's font specification. It would be awesome to have a similar command in bidi / xepersian packages to make first row / column of tabular environment.

Check/indicate

  • Relevant to the bidi package
  • The bidi package issue tracker has been searched for similar issues?
  • Issue tracker has been searched for similar issues?
  • Links to <tex.stackexchange.com> discussion if appropriate
  • Links to <qa.parsilatex.com> discussion if appropriate

Minimal example

\documentclass{article}
\usepackage{amsmath}
\usepackage{bm,tabu,array}
\usepackage{xepersian}
\settextfont{Yas}

\newcolumntype{+}{>{\global\let\currentrowstyle\relax}}
\newcolumntype{^}{>{\currentrowstyle}}
\newcommand{\rowstyle}[1]{\gdef\currentrowstyle{#1}%
  #1\ignorespaces
}

\begin{document}

\begin{table}[!h]
\centering
\caption{جدول ساخته شده در محیط \lr{tabular}}
\begin{tabular}{|*{11}{c|}}
\hline
\textbf{صفر}
& یک & دو &
$\bm{\Delta\mu\nabla\sigma}$
& سه & \% & 
\textbf{چهار}
& $\boldsymbol{n=10}$ & $\mathbf{n=15}$ & $\boldsymbol{\Delta\mu\nabla\sigma}$ & $\mathbf{\Delta\mu\nabla\sigma}$
\\ \hline
0 & 1 & 2 & 3 & 4 & 5 & 6 & 7 & 8 & 9 & 10 \\ \hline
\end{tabular}
\end{table}

\begin{table}[!h]
\caption{جدول ساخته شده در محیط \lr{tabu}}
\centering
\begin{tabu}{|*{11}{c|}}
\hline
\rowfont{\bfseries\boldmath}
صفر & یک & دو & $\Delta\mu\nabla\sigma$ & سه & \% & چهار
& $n=10$ & $n=15$ & $\Delta\mu\nabla\sigma$ & $\Delta\mu\nabla\sigma$
\\ \hline
0 & 1 & 2 & 3 & 4 & 5 & 6 & 7 & 8 & 9 & 10 \\ \hline
\end{tabu}
\end{table}

\begin{table}[!h]   % https://tex.stackexchange.com/questions/4811
\caption{جدول ساخته شده در محیط \lr{tabular} با دستورات تعریف شده بسته \lr{array}}
\centering
\begin{tabular}{|+c|*{10}{^c|}}
\hline
\rowstyle{\bfseries\boldmath}
صفر & یک & دو & $\Delta\mu\nabla\sigma$ & سه & \% & چهار
& $n=10$ & $n=15$ & $\Delta\mu\nabla\sigma$ & $\Delta\mu\nabla\sigma$
\\ \hline
0 & 1 & 2 & 3 & 4 & 5 & 6 & 7 & 8 & 9 & 10 \\ \hline
\end{tabular}
\end{table}
اعداد در متن 1234 و در فرمول $1234$
\[ 1 2 3 4 \]
\end{document}

Expected behavior

MWE-table-first-row.pdf

Overfull \hbox always breaks margin on the right side


Brief outline of the issue

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.

Check/indicate

  • Relevant to the bidi package
  • The bidi package issue tracker has been searched for similar issues?
  • Issue tracker has been searched for similar issues?
  • Links to <tex.stackexchange.com> discussion if appropriate
  • Links to <qa.parsilatex.com> discussion if appropriate

Minimal example showing the issue

% !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}

Expected behavior

Lines that do not fit within textwidth are extended beyond the margins on the left side.

Log and PDF files

xepersiantextmargins.log

xepersiantextmargins.pdf

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.