1 .\" A package for short Farsi manuscripts
2 .\" Registers and their default values
3 .nr PS 14 \" point size
4 .nr VS \n(PS+12 \" vertical spacing
5 .nr LL 6i \" line length
6 .nr PO 1.1i \" page offset
7 .nr FP -1.2i \" footer position
8 .\" Fonts: Times Roman + IR Nazanin + Computer Modern
9 .fp 5 FR IRNazanin \" Farsi regular font
10 .fp 6 FI IRNazaninIranic \" Farsi italic font
11 .fp 7 FB IRNazaninBold \" Farsi bold font
12 .fp 8 HD IRNazaninBold \" Farsi header font
17 .fspecial CMR S1 S CMEX CMSY
18 .\" Internal registers
19 .nr fa.sh 0 \" just following section headers
20 .nr fa.in 0 \" current indentation
21 .nr fa.ip 2m \" IP indentation
22 .nr fa.pi 2m \" RS indentation
23 .nr fa.pg 1 \" page numbering (0 disables)
24 .ds fa.cl "0 \" header colour
25 .\" Reset variables; when beginning a paragraph, e.g.
43 . if \\n(.d%\\n(.v 'sp \\n(.vu-(\\n(.du%\\n(.vu)
46 .de LP \" Paragraphs without temporary indentation
50 .de PP \" Ordinary paragraphs
52 . if !\\n[fa.sh] .ti2 +3n
55 .de QP \" Quoted paragraphs
57 . in2 \\n[fa.in]u+0.5i
60 .de IP \" Indented paragraphs
65 . if \\n(.$>1 .nr fa.ip \\$2
70 .de IP.en \" Indented paragraphs (English)
75 . if \\n(.$>1 .nr fa.ip \\$2
80 .de RS \" Indented block start
82 . if \\n(.$ .nr fa.pi \\$1
83 . nr fa.in +\\n[fa.pi]
85 .de RE \" Indented block end
87 . if \\n(.$ .nr fa.pi \\$1
88 . nr fa.in -\\n[fa.pi]
131 .\" Preprocessor macros
156 . in (\\n(.lu-\\$2)/2u
171 .\" Header and footer macros
172 .de FT \" Page footer
175 ' sp |\\n(.pu+\\n(FPu
183 .de HD \" Page header (called by FT)
192 .de FT.pg \" Footer page number
193 . ie \\n[fa.pg]=1 'tl ''\>%\<''
196 .de HD.pg \" Header page number
202 . ie \\n[fa.footnum] .ne 1
204 . if !\\n[fa.footnum] .nr fa.footpos 0\\n(FP+\\n(VSp
213 . if \\n[fa.footnum]=1 \l'3i'
217 \\n[fa.footnum]\h'|3n'\c
223 \s-4\d\>\\n[fa.footnum]\<\u\s+4\c
224 . nr fa.footpos -\\n(dn
225 . ch FT \\n[fa.footpos]u
228 . if \\n[fa.footnum] \{\
238 .\" Including EPS files (overrides -meps)
242 . _EPS \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
245 .de fa.gmap \" Mapping glyphs
246 . if \w'\N'\\$2'' .fmap \\n(.f \\$1 \\$2
248 .de fa.cmap \" Mapping characters
249 . if !\w'\\$1' .ochar \\n(.f \\$1 \\$2
251 .de fa.umap \" Mapping characters (unconditionally)
252 . if \w'\\$2' .ochar \\n(.f \\$1 \\$2
254 .de fa.ffont \" Adjusting old Farsi fonts
256 . ff \\$1 +ccmp +rlig +rclt +calt +mset +curs +kern +mark +mkmk
281 .de fa.efont \" Adjusting English fonts
284 .de fa.mfont \" Adjusting equation fonts
287 . fa.umap 0 "\f(FR۰\fP
288 . fa.umap 1 "\f(FR۱\fP
289 . fa.umap 2 "\f(FR۲\fP
290 . fa.umap 3 "\f(FR۳\fP
291 . fa.umap 4 "\f(FR۴\fP
292 . fa.umap 5 "\f(FR۵\fP
293 . fa.umap 6 "\f(FR۶\fP
294 . fa.umap 7 "\f(FR۷\fP
295 . fa.umap 8 "\f(FR۸\fP
296 . fa.umap 9 "\f(FR۹\fP
299 .de fa.fonts \" Adjust the default fonts
310 .\" Small auxiliary macros
311 .de en \" English phrases
315 .de num \" Farsi numbers
344 . ds .eqnbeg "\\?'\\n[.td]@\>'
345 . ds .eqnend "\\?'\\n[.td]@\<'
346 . ds .eqnbeg "\\?'\\n[.td]@\>'
347 . ds .eqnend "\\?'\\n[.td]@\<'
348 . ochar CMR { "\f[CMSY]{\fP
349 . ochar CMR } "\f[CMSY]}\fP
350 . ochar CMR \(<= "\f[CMSY]\(<=\fP
351 . ochar CMR < "\f[CMSY]<\fP
352 . ochar CMR > "\f[CMSY]>\fP
353 . ochar CMR \(>= "\f[CMSY]\(>=\fP