user-is-inactive-forever / xepersian

Persian for LaTeX, using XeTeX
https://ctan.org/pkg/xepersian
5 stars 1 forks source link

TeXlive 2019 #3

Closed Mahicopoli closed 5 years ago

Mahicopoli commented 5 years ago

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

user-is-inactive-forever commented 5 years ago

Can you provide a minimal example showing the issue? (otherwise I will have to close it).

user-is-inactive-forever commented 5 years ago

Just tested with updated TeXLive 2019 (as of today) and I can not see any issue with the following minimal example:

\documentclass{article}
\usepackage{xepersian}
\settextfont{Arial}
\begin{document}
این یک آزمایش است
\end{document}

I am closing the issue as invalid.

Mahicopoli commented 5 years ago

Thank you very much for your attention. In my previous version I do not have any problem but in this version writing the two similar line cause the problem.

%\defpersianfont\fontname[Scale=1.6]{IranNastaliq}

\defpersianfont\fontname[Scale=2]{IranNastaliq}

By omitting one command the error solved.

Thank you again for for attention.

Best regards

M. Golestani

On Mon, Jun 10, 2019 at 12:14 PM Vafa Khalighi notifications@github.com wrote:

Just tested with updated TeXLive 2019 (as of today) and I can not see any issue with the following minimal example:

\documentclass{article} \usepackage{xepersian} \settextfont{Arial} \begin{document}

این یک آزمایش است \end{document}

I am closing the issue as invalid.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/vafa-ac/xepersian/issues/3?email_source=notifications&email_token=AMJU4JMDINN2X76DSXHK3VDPZYA67A5CNFSM4HWRBAU2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODXJFNNA#issuecomment-500324020, or mute the thread https://github.com/notifications/unsubscribe-auth/AMJU4JNC5KKPWCXAMK7CRMDPZYA67ANCNFSM4HWRBAUQ .

user-is-inactive-forever commented 5 years ago

The control sequence \fontname is a primitive and the control sequence name should not be used for other purposes. So use something like

\documentclass{article}
\usepackage{xepersian}
\settextfont{Yas}
\defpersianfont\myfont{Yas}
\defpersianfont\myfont{Yas}
\begin{document}
این یک آزمایش است
\end{document}

However, you still get the error

LaTeX3 Error: Command '\myfont' already defined!

For immediate help type H <return>.
 ...                                              

This is because the control sequence \myfont is defined twice. If you want to redefine a particular control sequence for a font name, you need to use the control sequence \redefpersianfont:

\documentclass{article}
\usepackage{xepersian}
\settextfont{Yas}
\defpersianfont\myfont{Yas}
\redefpersianfont\myfont{Yas}
\begin{document}
این یک آزمایش است
\end{document}
Mahicopoli commented 5 years ago

Dear Dr. Khalighi

Thank you very much. It is very helpful.

Can I ask another question about BiBTEX in Xepersian?

Best regards M. Golestani

On Mon, Jun 10, 2019 at 5:46 PM Vafa Khalighi notifications@github.com wrote:

The control sequence \fontname is a primitive and the control sequence name should not be used for other purposes. So use something like

\documentclass{article} \usepackage{xepersian} \settextfont{Yas} \defpersianfont\myfont{Yas} \defpersianfont\myfont{Yas} \begin{document}

این یک آزمایش است \end{document}

However, you still get the error

LaTeX3 Error: Command '\myfont' already defined!

For immediate help type H .

...

This is because the control sequence \myfont is defined twice. If you want to redefine a particular control sequence for a font name, you need to use the control sequence \redefpersianfont:

\documentclass{article} \usepackage{xepersian} \settextfont{Yas} \defpersianfont\myfont{Yas} \redefpersianfont\myfont{Yas} \begin{document}

این یک آزمایش است \end{document}

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/vafa-ac/xepersian/issues/3?email_source=notifications&email_token=AMJU4JMEUVCXEUNO54OGFALPZZH4JA5CNFSM4HWRBAU2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODXJ3DSI#issuecomment-500412873, or mute the thread https://github.com/notifications/unsubscribe-auth/AMJU4JJ7TTKXXR3UGIVJPILPZZH4JANCNFSM4HWRBAUQ .

Mahicopoli commented 5 years ago

Dear Dr. Khalighi

I wrote a book with TeXLive using XePersian. I have some errors in the footnote, as you can see in the attached file. In the short text I do not see this problem. I import my chapters and section files. My source file is in the end of this letter. I will be appreciate if you help me for solving this problem.

Best regards Mohammad Golestani

%%%%%%% The code of the file. %%%%%%%%%%%% \documentclass[a4paper,11pt]{book} \usepackage[T1]{fontenc} \usepackage[utf8]{inputenc} \usepackage{lmodern} \usepackage{amsbsy,amssymb,amsmath,amsfonts} \usepackage[perpage]{footmisc}%reset footnote numbers \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} \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 \newpage\thispagestyle{empty} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Add a dedication paragraph to dedicate your book to someone % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \import{Auxilary/}{Dedicate} \thispagestyle{empty} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Auto-generated table of contents, list of figures and list of tables % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \tableofcontents \listoffigures %\listoftables

%\pagenumbering{harfi} \setlength{\baselineskip}{20pt}%%%%%%%%%%% % Preface % %%%%%%%%%%% \import{Auxilary/}{Preface} \end{document}

Some pages of the book: SAMPLE.pdf