summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/bezos/arabicfront.sty
blob: 1748dfb5fccc0b60417a9c8071828370c69762e4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
% +--------------------------------------------------+
% | Documentation in clear text follows              |
% +--------------------------------------------------+
%
%% Copyright (C) 2006 Javier Bezos
%% All Rights Reserved
%% http://www.tex-tipografia.com
%%
%% This work may be distributed and/or modified under the conditions
%% of the LaTeX Project Public License, either version 1.3 of this
%% license or (at your option) any later version.  The latest version
%% of this license is in
%%     http://www.latex-project.org/lppl.txt
%% and version 1.3 or later is part of all distributions of LaTeX
%% version 2003/12/01 or later.
%%
%% This work has the LPPL maintenance status "maintained".
%%
%% This Current Maintainer of this work is Javier Bezos.
%%
%% This work consists of this file.
%
% Usage
% ~~~~~
%
% This package modifies the definitions of \frontmatter and
% \mainmatter so that page numbering starts in arabic style from the
% front matter while preserving the rest of the original definitions.
% For it to work, \pagenumbering has to be inside these macros -- most
% of classes do that, but there are exceptions like memoir.
%
% To use it, just \usepackage{arabicfront}.
%
% Code
% ~~~~

\def\fileversion{1.0}
\def\filedate{2006/09/03}

\ProvidesPackage{arabicfront}[2006/09/03 v1.0 Arabic page numbering]

\def\arfr@rep#1\@@\@@#2#3{%
  \in@{\pagenumbering}{#1}%
  \ifin@
    #2#1\@@\@@
  \else
    \PackageWarningNoLine{arabicfront}%
      {Skipping \string#3 -- no \string\pagenumbering}%
  \fi}

\def\arfr@front#1\pagenumbering#2#3\@@\@@{%
  \renewcommand\frontmatter{#1\pagenumbering{arabic}#3}}

\def\arfr@main#1\pagenumbering#2#3\@@\@@{%
  \renewcommand\mainmatter{#1#3}}
  
\expandafter\arfr@rep\mainmatter\@@\@@\arfr@main\mainmatter
\expandafter\arfr@rep\frontmatter\@@\@@\arfr@front\frontmatter

\endinput