更改“arqam.sty” arabtex

更改“arqam.sty” arabtex

我使用 \usepackage{arqam} 来更改章节编号、节编号、页编号...

我想对此文件进行修改以获得:第 1 个而不是第 1 个,并改善目录

这是 arqam.sty

\typeout{ArqAm Document Style `arqAm' <25 sb.tmr 99>.}
\catcode`\@=11
%%%%%
\ifa@book
% 'a.dyf mA yly 4 'as.tr:
\renewcommand\thesection%
{\LR{\@arabic\c@section.\@arabic\c@chapter}}
%t.gyiyr 220698
\renewcommand\thesubsection %
{\LR{\@arabic\c@subsection.\@arabic\c@section.\@arabic\c@chapter}}
\renewcommand\thesubsubsection % 'a.dyf 'amryn al-sAbq w-al-lA.hq
{\LR{\@arabic\c@subsubsection.\@arabic\c@subsection.\@arabic\c@section.%
\@arabic\c@chapter}}
%   220698
\fi
%%%
\ifa@article
\renewcommand\thesection {\LR{\@arabic\c@section}}  %t.gyiyr 220698
\renewcommand\thesubsection {\LR{\@arabic\c@subsection.\@arabic\c@section} }
\renewcommand\thesubsubsection % 'a.dyf 'amryn al-sAbq w-al-lA.hq
{\LR{\@arabic\c@subsubsection.\@arabic\c@subsection.\@arabic\c@section}
}
\fi
%    ****************************************
%    *             SECTIONS                 *
%    ****************************************

\def \a@c@section {\a@startsection
{section}{1}{\z@}{-3.5ex plus-1ex minus -.2ex}{2.3ex plus.2ex}%
%{\reset@font \Large\setnashbf }}
{\tr@ceoff \reset@font \Large \tr@ceon \setnashbf }}

\def \a@c@subsection {\a@startsection
{subsection}{2}{\z@}{-3.25ex plus-1ex minus-.2ex}{-1.5ex plus.2ex}%
%{\reset@font \large\setnashbf }}
{\tr@ceoff \reset@font \large \tr@ceon \setnashbf }}

\def \a@c@subsubsection {\a@startsection
{subsubsection}{3}{\z@}{-3.25ex plus -1ex minus-.2ex}{-1.5ex plus.2ex}%
%{\reset@font \normalsize\setnashbf }}
{\tr@ceoff \reset@font \normalsize \tr@ceon \setnashbf }}

\def \a@c@paragraph {\a@startsection
{paragraph}{4}{\z@}{3.25ex plus1ex minus.2ex}{-1em}%
%{\reset@font \normalsize\setnashbf }}
{\tr@ceoff \reset@font \normalsize \tr@ceon\setnashbf }}

\def\a@c@subparagraph {\a@startsection
{subparagraph}{5}{\parindent}{3.25ex plus1ex minus .2ex}{-1em}%
%{\reset@font \normalsize\setnashbf }}
{\tr@ceoff \reset@font \normalsize \tr@ceon\setnashbf }}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%240999
\def\a@sect #1#2#3#4#5#6[#7]#8{% Arabic mode
\ifnum #2 > \c@secnumdepth \let \@svsec \@empty
\else \refstepcounter{#1}%
    \edef \@svsec {\hskip 1em \nxp\RL {\csname the#1\endcsname}}%
\fi \@tempskipa #5\relax \ifdim \@tempskipa > \z@
    \begingroup \let \end \a@@par
        #6\relax \set@arabfont % style
            \a@hangfrom {\hskip #3\relax \@svsec }% section number
        \test@token #8 \end
    \endgroup
    \csname #1mark\endcsname {\RL {#7}}% 161099
        \addcontentsline {toc}{#1}%
        {\ifnum #2 > \c@secnumdepth \else
        \protect\numberline {\csname the#1\endcsname }\fi
        \protect\RL {#7}}%
\else \def \@svsechd % saved head, executed by \everypar
{\putwordb@x {#6\xpa\RL{#8}% $\bullet\hspace{-2truemm}-$}%
\@svsec\hskip #3\relax}%
        \csname #1mark\endcsname {\RL {#7}}%
    \addcontentsline {toc}{#1}%
        {\ifnum #2>\c@secnumdepth \else
        \protect\numberline {\csname the#1\endcsname}\fi
        \protect\RL {#7}}}% \@svsechd
\fi \a@xsect {#5}}

%%%%%240999
%%%
%    ****************************************
%    *         PAGE STYLES                  *
%    ****************************************

\if@twoside         % If two-sided printing.
 \def \ps@headings {% for arabic mode
        \let \@mkboth \markboth \def\@oddfoot{}\def\@evenfoot{}%
    \def \@evenhead {\edef \thepage {\nxp\RL{\thepage }}% left heading
                \leftmark \hfil \LR{\thepage} }% \LR 311098
        \def \@oddhead {\edef \thepage {\nxp\RL{\thepage}}% right heading
        \def \chaptermark ##1{\markboth {##1%
                \ifnum \c@secnumdepth >\m@ne
                \if@mainmatter
                 \hskip 1em\relax \RL{\@chapapp \space \thechapter  }%
                \fi\fi }{}}%
        \def \sectionmark ##1{\markleft {##1\ifnum \c@secnumdepth >\@ne
                \hskip 1em\relax \RL{\thesection}\fi }}%
        \ifa@article
      \def \subsectionmark ##1{\markleft {##1\ifnum \c@secnumdepth >\@ne
                \hskip 1em\relax \RL{\thesubsection }\fi }}%
        \fi }
\else               % If one-sided printing.
\def \ps@headings {% for arabic mode
        \let \@mkboth \markboth \def \@oddfoot{}\def \@evenfoot{}%
        \def \@oddhead {\edef \thepage {\nxp \LR{\thepage}}% right heading
                \LR{\thepage} \hfil \rightmark }%
        \def \chaptermark ##1{\markright {##1%
                \ifnum \c@secnumdepth >\m@ne
                \if@mainmatter
                \hskip 1em\relax \RL{\@chapapp\space $\thechapter$  }%
                \fi\fi }}}
\fi

\def \ps@plain {% for arabic mode
 \let \@mkboth\@gobbletwo \let\@oddhead\@empty \let\@evenhead\@empty
   \def \@oddfoot {\edef \thepage {\nxp\LR{ \thepage }}% right heading
                \hfil \LR{\thepage} \hfil }%
        \let \@evenfoot\@oddfoot }

\def \ps@myheadings {% for arabic mode
        \let\@oddfoot \@empty \let\@evenfoot \@empty
        \def \@oddhead {\edef \thepage {\nxp \LR{\thepage }}% right heading
               \LR{\thepage} \hfil \rightmark }%
        \def \@evenhead {\edef \thepage {\nxp\LR{\thepage }}% left heading
                \leftmark \hfil \LR{\thepage} }%
        \let\@mkboth\@gobbletwo \let\subsectionmark\@gobble
        \let\chaptermark\@gobble \let\sectionmark\@gobble }
%%%%ktAbT al-.sf.hT al-'awlY mn al-bAb wrqmh
\def\a@makechapterhead #1{% make heading with number
\null \vskip 50\p@
\begingroup \let \end \a@@par \a@@raggedright \interlinepenalty\@M
\ifnum \c@secnumdepth >\m@ne
\if@mainmatter
        \edef \thechapter {\@chapapp \space \LR{\thechapter}  }%
        \huge \nashbf \set@arabfont \test@token {\thechapter } \end
        \nobreak \vskip 20\p@
\fi\fi
        \Huge \nashbf \set@arabfont \test@token #1 \end
        \nobreak \vskip 40\p@
\endgroup }

%%%%*********************************************************************
\ifa@book
 \renewcommand\theequation{\@arabic\c@equation.\@arabic\c@chapter}
\pagestyle{headings}
\else
\pagestyle{plain}
\fi
\pagenumbering{arabic}

\if@twoside
\else \raggedbottom
\fi

\if@twocolumn \twocolumn \sloppy \flushbottom
\else \onecolumn
\fi

%\else %============= arabart.cls ==================================

% Default initializations

\ifa@book \pagestyle{headings} \else \pagestyle{plain} \fi
\pagenumbering{arabic}      % Arabic page numbers

%    ****************************************
\catcode`\@=\active

这是一个最小的例子

\documentclass[12pt]{arabbook}
%%%%%%%%%%% packages
\usepackage{fancyhdr}
 \usepackage{arabtex} 
 \usepackage{amssymb}
 \usepackage{amsmath}
 \usepackage{arqam}
\usepackage{amsfonts}% R ensemble des nombres reels
\usepackage{graphicx}% ajouter des photos
\usepackage{pstricks}% pour dessiner
%%%%%%%%%%%% ab3ad AlsfhA
\textwidth= 15truecm % 
\textheight= 22.27truecm % 
\hoffset= -1.5 cm%truecm %
\voffset= -1.5 cm%truecm %
%%%%%%%%%%
\pagestyle{fancy}
\renewcommand{\headrulewidth}{1.5pt}
\renewcommand{\footrulewidth}{1.5pt}
\renewcommand{\baselinestretch}{1.5}
% `dm Alt^skyl 
\novocalize
\begin{document}
\begin{arabtext}
\tableofcontents

\chapter{Alzmr}
\section{t_dkyr}

\section{tmAryn}

\end{arabtext}
\end{document}

答案1

这里有一些简单但实用的技巧。

\documentclass[12pt]{arabbook}

\usepackage{fancyhdr}
\usepackage{arabtex} 
\usepackage{amssymb}
\usepackage{amsmath}
\usepackage{arqam}
\usepackage{graphicx}
\usepackage{pstricks}

\textwidth= 15truecm % 
\textheight= 22.27truecm % 
\hoffset= -1.5 cm%truecm %
\voffset= -1.5 cm%truecm %
\pagestyle{fancy}
\renewcommand{\headrulewidth}{1.5pt}
\renewcommand{\footrulewidth}{1.5pt}
\renewcommand{\baselinestretch}{1.5}

\novocalize

%-----------------------------------------
\usepackage{etoolbox}
\makeatletter 
\newcommand{\arabic@words}[1]{% %https://tex.stackexchange.com/questions/494419/numbering-from-indian-to-arabic-arabic-babel/
\ifcase#1\or 
Al'awl\or 
Al_tAny\or 
Al_tAlt\or
AlrAb`\else\@ctrerr\fi}
\newcommand*\arabicwords[1]{\expandafter\arabic@words\csname c@#1\endcsname}
\def \a@chapter [#1]#2{% numbered chapter
    \ifnum \c@secnumdepth >\m@ne
        \if@mainmatter
            \refstepcounter {chapter}%
            \typeout {\@chapapp \space \thechapter.}%
            \addcontentsline {toc}{chapter}%
            {\protect\numberline {\@chapapp\space\arabicwords{chapter} }\protect\RL {#1}}%
        \else \addcontentsline {toc}{chapter}{\protect\RL {#1}}%
        \fi          
    \else \addcontentsline {toc}{chapter}{\protect\RL {#1}}%
    \fi
\chaptermark{\RL {#1}}%
\addtocontents {lof}{\protect\addvspace {10\p@}}%
\addtocontents {lot}{\protect\addvspace {10\p@}}%
    \if@twocolumn \@topnewpage [\a@makechapterhead {#2}]%
    \else \a@makechapterhead {#2}\a@afterheading
    \fi 
\tracingmacros 0
\test@token }
\patchcmd\a@makechapterhead{\LR{\thechapter}}{\arabicwords{chapter}}{}{}

\def \a@l@chapter #1#2{% for arabic mode
\ifnum \c@tocdepth >\m@ne
    \addpenalty {-\@highpenalty }\addvspace {1.0em plus\p@ }
     \@tempdima 4em 
    \begin{arabtext}
    \hskip .7\@tempdima #1 \hfill  \LR{#2}
    \end{arabtext}
        \penalty\@highpenalty
\fi }

\at@arabtext{%
\def \l@section #1#2{% for arabic mode
\ifnum \c@tocdepth >\z@
    \addpenalty {\@secpenalty }
     \@tempdima 2.8em 
    \begin{arabtext}
    \hskip \@tempdima #1 \LR{\dotfill}  \LR{#2}
    \end{arabtext}
        \penalty\@secpenalty
\fi }}
\makeatother
\begin{document}
\begin{arabtext}
\tableofcontents

\chapter{Alzmr}
\section{t_dkyr}

\section{tmAryn m.hlwlT}

\chapter{Alzmr AlnA.zmyT}
\section{t_dkyr}

\section{tmAryn}

\chapter{Alzmr}
\section{t_dkyr}

\section{tmAryn}

\chapter{Alzmr}
\section{t_dkyr}

\section{tmAryn}

\end{arabtext}
\end{document}

相关内容