summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/xelatex/xepersian/packages-localise-xepersian.def
blob: 2803e774e78ee03d82b34df11d139e36ad01572d (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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
%%
%% This is file `packages-localise-xepersian.def',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% xepersian.dtx  (with options: `packages-localise-xepersian.def')
%% 
%%   ______________________________________
%%   Copyright © 2008–2012  Vafa Khalighi
%% 
%%   License information appended.
%% 
%% 
\آماده‌سازی‌پرونده{packages-localise-xepersian.def}[2011/03/01 v0.1 localising LaTeX2e Packages]
\@گرسبک‌فراخوانی‌شده{color}{\ورودی{color-localise.def}}{}
\@ifpackageloaded{multicol}{%
\newenvironment{چندستونی‌ها}{\begin{multicols}}{\end{multicols}}%
\newenvironment{چندستونی‌ها*}{\begin{multicols*}}{\end{multicols*}}%
}{}
\@ifpackageloaded{verbatim}{%
\begingroup
 \vrb@catcodes
 \lccode`\!=`\\ \lccode`\[=`\{ \lccode`\]=`\}
 \catcode`\~=\active \lccode`\~=`\^^M
 \lccode`\C=`\C
 \lowercase{\endgroup
    \def\xepersian@localize@verbatim@start#1{%
      \verbatim@startline
      \if\noexpand#1\noexpand~%
        \let\next\xepersian@localize@verbatim@
      \else \def\next{\xepersian@localize@verbatim@#1}\fi
      \next}%
    \def\xepersian@localize@verbatim@#1~{\xepersian@localize@verbatim@@#1!پایان\@nil}%
    \def\xepersian@localize@verbatim@@#1!پایان{%
       \verbatim@addtoline{#1}%
       \futurelet\next\xepersian@localize@verbatim@@@}%
    \def\xepersian@localize@verbatim@@@#1\@nil{%
       \ifx\next\@nil
         \verbatim@processline
         \verbatim@startline
         \let\next\xepersian@localize@verbatim@
       \else
         \def\@tempa##1!پایان\@nil{##1}%
         \@temptokena{!پایان}%
         \def\next{\expandafter\verbatim@test\@tempa#1\@nil~}%
       \fi \next}%
    \def\verbatim@test#1{%
           \let\next\verbatim@test
           \if\noexpand#1\noexpand~%
             \expandafter\verbatim@addtoline
               \expandafter{\the\@temptokena}%
             \verbatim@processline
             \verbatim@startline
             \let\next\xepersian@localize@verbatim@
           \else \if\noexpand#1
             \@temptokena\expandafter{\the\@temptokena#1}%
           \else \if\noexpand#1\noexpand[%
             \let\@tempc\@empty
             \let\next\verbatim@testend
           \else
             \expandafter\verbatim@addtoline
               \expandafter{\the\@temptokena}%
             \def\next{\xepersian@localize@verbatim@#1}%
           \fi\fi\fi
           \next}%
    \def\verbatim@testend#1{%
         \if\noexpand#1\noexpand~%
           \expandafter\verbatim@addtoline
             \expandafter{\the\@temptokena[}%
           \expandafter\verbatim@addtoline
             \expandafter{\@tempc}%
           \verbatim@processline
           \verbatim@startline
           \let\next\xepersian@localize@verbatim@
         \else\if\noexpand#1\noexpand]%
           \let\next\verbatim@@testend
         \else\if\noexpand#1\noexpand!%
           \expandafter\verbatim@addtoline
             \expandafter{\the\@temptokena[}%
           \expandafter\verbatim@addtoline
             \expandafter{\@tempc}%
           \def\next{\xepersian@localize@verbatim@!}%
         \else \expandafter\def\expandafter\@tempc\expandafter
           {\@tempc#1}\fi\fi\fi
         \next}%
    \def\verbatim@@testend{%
       \ifx\@tempc\@currenvir
         \verbatim@finish
         \edef\next{\noexpand\end{\@currenvir}%
                    \noexpand\verbatim@rescan{\@currenvir}}%
       \else
         \expandafter\verbatim@addtoline
           \expandafter{\the\@temptokena[}%
           \expandafter\verbatim@addtoline
             \expandafter{\@tempc]}%
         \let\next\xepersian@localize@verbatim@
       \fi
       \next}%
    \def\verbatim@rescan#1#2~{\if\noexpand~\noexpand#2~\else
        \@warning{Characters dropped after `\string\end{#1}'}\fi}}%
\def\همانطورکه‌هست{\begingroup\@verbatim \frenchspacing\@vobeyspaces
              \xepersian@localize@verbatim@start}
\@namedef{همانطورکه‌هست*}{\begingroup\@verbatim\xepersian@localize@verbatim@start}
\def\endهمانطورکه‌هست{\endtrivlist\endgroup\@doendpe}
\expandafter\let\csname endهمانطورکه‌هست*\endcsname =\endهمانطورکه‌هست
}{}
\ExplSyntaxOn
\AtBeginDocument{
  \xepersian_localize_patch_verbatim:
}
\cs_set:Npn \xepersian_localize_patch_verbatim: {
  \@ifpackageloaded{verbatim}{
    \cs_set:cpn {همانطورکه‌هست*} {
      \group_begin: \@verbatim \fontspec_print_visible_spaces: \xepersian@localize@verbatim@start
    }
  }{
  }
}
\ExplSyntaxOff
%% 
%% Copyright © 2008–2012  Vafa Khalighi <vafaklg@gmail.com>
%% 
%% It may be distributed and/or modified under the LaTeX Project Public License,
%% version 1.3c or higher (your choice). The latest version of
%% this license is at: http://www.latex-project.org/lppl.txt
%% 
%% This work is “author-maintained” (as per LPPL maintenance status)
%% by Vafa Khalighi.
%% 
%% 
%% 
%%
%% End of file `packages-localise-xepersian.def'.