Skip to content
This repository has been archived by the owner on Nov 30, 2019. It is now read-only.

TeXlive 2019 #3

Closed
Mahicopoli opened this issue Jun 10, 2019 · 6 comments
Closed

TeXlive 2019 #3

Mahicopoli opened this issue Jun 10, 2019 · 6 comments
Assignees
Labels
Bug Something isn't working Invalid This doesn't seem right Question Further information is requested

Comments

@Mahicopoli
Copy link

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

@Mahicopoli Mahicopoli added the Bug Something isn't working label Jun 10, 2019
@user-is-inactive-forever
Copy link
Owner

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

@user-is-inactive-forever user-is-inactive-forever added the Invalid This doesn't seem right label Jun 10, 2019
@user-is-inactive-forever
Copy link
Owner

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
Copy link
Author

Mahicopoli commented Jun 10, 2019 via email

@user-is-inactive-forever
Copy link
Owner

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}

@user-is-inactive-forever user-is-inactive-forever added the Question Further information is requested label Jun 10, 2019
@Mahicopoli
Copy link
Author

Mahicopoli commented Jun 11, 2019 via email

@Mahicopoli
Copy link
Author

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Bug Something isn't working Invalid This doesn't seem right Question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants