我正在使用 arabtext+ arqam
我想做一个像图片那样的章节
请问该怎么办?
1\ 一个最小的例子:
\documentclass[12pt]{arabbook} %{arabart},oneside
\usepackage{amsfonts,amssymb,amsmath}
\usepackage{graphicx}
\usepackage{arqam}
\usepackage{fancyhdr}
\usepackage{mathrsfs}
\usepackage{color}
\novocalize
%\parskip 0mm
%\setcounter{page}{1}\setcounter{chapter}{1}
\mathchardef\cap="225C
%\dominitoc \linespread{1.5} \setlength{\hoffset}{-18pt}
\textwidth=17.5truecm
\hoffset=-2truecm
\textheight=24truecm
\voffset=-3truecm
\newcommand{\vc}[3]{\overset{#2}{\underset{#3}{#1}}}
\usepackage{etoolbox}
\makeatletter
\newcommand{\arabic@words}[1]{
\ifcase#1\or
Al'awl:\or
Al_tAny:\or
Al_tAlt:\or
AlrAb`:\or
Al_hms:\or
AlsAds:
\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 }}
\at@arabtext{%
\def \l@subsection #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 }}
\at@arabtext{%
\def \l@subsubsection #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
\renewcommand{\thesection}{\LR\arabic{section}}
\renewcommand{\thesubsection}{\LR\arabic{section}.\LR\arabic{subsection}}
\renewcommand{\thesubsubsection}{\LR\arabic{section}.\LR\arabic{subsection}.\LR\arabic{subsubsection}}
\setcounter{secnumdepth}{5}
\pagestyle{fancy}
\renewcommand{\headrulewidth}{1.5pt}
\renewcommand{\footrulewidth}{1.5pt}
\renewcommand{\baselinestretch}{1}
\begin{document}
\begin{arabtext}
\tableofcontents
\chapter{Alzmr}
\end{arabtext}
\pagestyle{fancy}
\renewcommand{\headrulewidth}{1pt}
\renewcommand{\footrulewidth}{1pt}
\renewcommand{\baselinestretch}{1}
\lhead{\RL{ Alzmr}}
\chead{\hspace{1cm}}
\rhead{\RL{Alf.sl Al-'wal }}
\begin{arabtext}
\end{arabtext}
\end{document}
2\ 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
\usepackage[Sonny]{fncychap}
\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
答案1
这是一个解决方案。
\documentclass[12pt]{arabbook} %{arabart},oneside
\usepackage{amsfonts,amssymb,amsmath}
\usepackage{graphicx}
\usepackage{arqam}
\usepackage{fancyhdr}
\usepackage{mathrsfs}
\usepackage{color}
\novocalize
%\parskip 0mm
%\setcounter{page}{1}\setcounter{chapter}{1}
\mathchardef\cap="225C
%\dominitoc \linespread{1.5} \setlength{\hoffset}{-18pt}
\textwidth=17.5truecm
\hoffset=-2truecm
\textheight=24truecm
\voffset=-3truecm
\newcommand{\vc}[3]{\overset{#2}{\underset{#3}{#1}}}
\usepackage{etoolbox}
\makeatletter
\newcommand{\arabic@words}[1]{
\ifcase#1\or
Al'awl\or
Al_tAny\or
Al_tAlt\or
AlrAb`\or
Al_hms\or
AlsAds
\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 }
\newcommand{\ahhrule}{\leavevmode\leaders\hrule height 5pt\hfill\kern\z@}
\def\a@makechapterhead #1{% make heading with number
\null \vskip 50\p@
\begingroup \let \end \a@@par \a@@centering \interlinepenalty\@M
\ifnum \c@secnumdepth >\m@ne
\if@mainmatter
\edef \thechapter {\LR{\ahhrule}\@chapapp \space\arabicwords{chapter} \LR{\ahhrule}}%
\huge \nashbf \set@arabfont \test@token {\thechapter } \end
%\nobreak \vskip 10\p@
\fi\fi
\hrule width \linewidth height 1pt \vskip10pt
\Huge \nashbf \set@arabfont \test@token #1 \end
\vskip10pt\hrule width \linewidth height 1pt
\nobreak \vskip 40\p@
\endgroup }
\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 }}
\at@arabtext{%
\def \l@subsection #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 }}
\at@arabtext{%
\def \l@subsubsection #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
\renewcommand{\thesection}{\LR\arabic{section}}
\renewcommand{\thesubsection}{\LR\arabic{section}.\LR\arabic{subsection}}
\renewcommand{\thesubsubsection}{\LR\arabic{section}.\LR\arabic{subsection}.\LR\arabic{subsubsection}}
\setcounter{secnumdepth}{5}
\pagestyle{fancy}
\renewcommand{\headrulewidth}{1.5pt}
\renewcommand{\footrulewidth}{1.5pt}
\renewcommand{\baselinestretch}{1}
\begin{document}
\begin{arabtext}
\tableofcontents
\chapter{Alzmr}
\end{arabtext}
\pagestyle{fancy}
\renewcommand{\headrulewidth}{1pt}
\renewcommand{\footrulewidth}{1pt}
\renewcommand{\baselinestretch}{1}
\lhead{\RL{ Alzmr}}
\chead{\hspace{1cm}}
\rhead{\RL{Alf.sl Al-'wal }}
\begin{arabtext}
\end{arabtext}
\end{document}
笔记:
- 不再需要
\patchcmd\a@makechapterhead{\LR{\thechapter}}{\arabicwords{chapter}}{}{}
- commande
\arabic@words
重新定义,我们不需要number
,number:
仅\number:
在中使用toc
,这是通过\addcontentsline {toc}{chapter}% {\protect\numberline {\@chapapp\space\arabicwords{chapter}:}\protect\RL {#1}}
的定义实现的\a@chapter
。