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
9 .nr fa.in 0 \" current indentation
10 .nr fa.ip 2m \" IP indentation
11 .nr fa.pi 2m \" RS indentation
12 .nr fa.pg 1 \" page numbering (0 disables)
13 .ds fa.cl "0 \" header colour
14 .\" Reset variables; when beginning a paragraph, e.g.
32 . if \\n(.d%\\n(.v 'sp \\n(.vu-(\\n(.du%\\n(.vu)
35 .de LP \" Paragraphs without temporary indentation
38 .de PP \" Ordinary paragraphs
42 .de QP \" Quoted paragraphs
44 . in2 \\n[fa.in]u+0.5i
47 .de IP \" Indented paragraphs
52 . if \\n(.$>1 .nr fa.ip \\$2
57 .de IP.en \" Indented paragraphs (English)
62 . if \\n(.$>1 .nr fa.ip \\$2
67 .de RS \" Indented block start
69 . if \\n(.$ .nr fa.pi \\$1
70 . nr fa.in +\\n[fa.pi]
72 .de RE \" Indented block end
74 . if \\n(.$ .nr fa.pi \\$1
75 . nr fa.in -\\n[fa.pi]
116 .\" Preprocessor macros
130 . ie "\\*[fa.eqlab]"" .fa.eqdiv
133 . if \\n[fa.eqwid]<(\\n(.lu/2u) .nr fa.eqwid \\n(.lu/2u
139 . in +(\\n[fa.eqwid]u+2m)
155 . in (\\n(.lu-\\$2)/2u
170 .\" Header and footer macros
171 .de FT \" Page footer
174 ' sp |\\n(.pu+\\n(FPu
180 . if \\n(.t==(\\n(.p+(\\n(FP)) .HD
182 .de HD \" Page header (called by FT)
191 .de FT.pg \" Footer page number
192 . ie \\n[fa.pg]=1 'tl ''\>%\<''
195 .de HD.pg \" Header page number
201 . ie \\n[fa.footnum] .ne 1
203 . if !\\n[fa.footnum] .nr fa.footpos 0\\n(FP+\\n(VSp
212 . if \\n[fa.footnum]=1 \l'\\n(.lu'
213 . ds fa.footsign "\\n[fa.footnum]
214 . if \\n(.$>0 .ds fa.footsign "\\$1
238 \s-4\d\>\\*[fa.footsign]\<\u\s+4\c
239 . nr fa.footpos -\\n(dn
240 . ch FT \\n[fa.footpos]u
243 . if \\n[fa.footnum] \{\
254 .\" Including EPS files (overrides -meps)
258 . __EPS "\\$1" \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
261 .de fa.gmap \" Mapping glyphs
263 . if \w'\N'\\$2'' .fmap \\n(.f \\$1 \\$2
265 .de fa.cmap \" Mapping characters
267 . if !\w'\\$1' .ochar \\n(.f \\$1 \\$2
269 .de fa.umap \" Mapping characters (unconditionally)
271 . if \w'\\$2' .ochar \\n(.f \\$1 \\$2
273 .de fa.ffont \" Adjusting old Farsi fonts
275 . ff \\$1 +ccmp +rlig +rclt +calt +mset +curs +kern +mark +mkmk
298 .de fa.efont \" Adjusting English fonts
301 .de fa.mfont \" Adjusting equation fonts
304 . fa.umap 0 "\f(FR۰\fP
305 . fa.umap 1 "\f(FR۱\fP
306 . fa.umap 2 "\f(FR۲\fP
307 . fa.umap 3 "\f(FR۳\fP
308 . fa.umap 4 "\f(FR۴\fP
309 . fa.umap 5 "\f(FR۵\fP
310 . fa.umap 6 "\f(FR۶\fP
311 . fa.umap 7 "\f(FR۷\fP
312 . fa.umap 8 "\f(FR۸\fP
313 . fa.umap 9 "\f(FR۹\fP
316 .de fa.fonts \" Adjust the default fonts
327 .\" Small auxiliary macros
328 .ds en "\>\fR\\$1\fP\<
331 .de fs \" English Footnote
339 .de fs.fa \" Farsi Footnote
408 . \" Fonts: Times Roman + IR Nazanin + Computer Modern
409 . fp 5 FR IRNazanin \" Farsi regular font
410 . fp 6 FI IRNazaninIranic \" Farsi italic font
411 . fp 7 FB IRNazaninBold \" Farsi bold font
412 . fp 8 HD IRNazaninBold \" Farsi header font
417 . fspecial CMR S1 S CMEX CMSY
420 . ds .eqnbeg "\\\\?'\\\\n[.td]@\>'
421 . ds .eqnend "\\\\?'\\\\n[.td]@\<'
422 . ochar CMR { "\f[CMSY]{\fP
423 . ochar CMR } "\f[CMSY]}\fP
424 . ochar CMR \(<= "\f[CMSY]\(<=\fP
425 . ochar CMR < "\f[CMSY]<\fP
426 . ochar CMR > "\f[CMSY]>\fP
427 . ochar CMR \(>= "\f[CMSY]\(>=\fP
428 . ochar CMR \(mi "\f[CMSY]\(mi\fP
429 . ochar CMR \(mu "\f[CMSY]\(mu\fP