-
Notifications
You must be signed in to change notification settings - Fork 0
/
commands.tex
435 lines (369 loc) · 17.2 KB
/
commands.tex
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
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
% در این فایل، دستورها و تنظیمات مورد نیاز، آورده شده است.
%-------------------------------------------------------------------------------------------------------------------
% دستوراتی که پوشه پیشفرض زیرفایلهای tex را مشخص میکند.
%\makeatletter
%\def\input@path{{./tex/}}
%\makeatother
% در ورژن جدید زیپرشین برای تایپ متنهای ریاضی، این سه بسته، حتماً باید فراخوانی شود
\usepackage{amsthm,amssymb,amsmath}
% بستهای برای تنطیم حاشیههای بالا، پایین، چپ و راست صفحه
\usepackage[top=40mm, bottom=40mm, left=25mm, right=35mm]{geometry}
\usepackage{enumerate}
%\usepackage{bm}
% بستهای برای ظاهر شدن شکلها و تعیین آدرس تصاویر
\usepackage[final]{graphicx}
\graphicspath{{./figs/}}
\usepackage{caption}
%\usepackage{subcaption}
%\usepackage{subfig}
\usepackage{float}
\usepackage{xparse}
\usepackage{listing}
\usepackage[final]{listings}
\lstset{inputpath=./codes/}
%\usepackage{color}
\usepackage[usenames,dvipsnames,svgnames,table]{xcolor}
\usepackage{soulutf8}
% بستهای برای رسم کادر
\usepackage{framed}
% بستهای برای چاپ شدن خودکار تعداد صفحات در صفحه «معرفی پایاننامه»
\usepackage{lastpage}
\usepackage{cite} % Add by Morteza %
% بستهٔ لازم برای: ۱. تغییر شمارهگذاری صفحات پیوست. ۲. تصحیح باگ آدرس وب حاوی '%' در مراجع
\usepackage{etoolbox}
\usepackage{comment}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%% دستورات وابسته به استیل مراجع:
%% اگر از استیلهای natbib (plainnat-fa، asa-fa، chicago-fa) استفاده میکنید، خط زیر را فعال و بعدیاش را غیرفعال کنید.
%\usepackage{natbib}
%\newcommand{\citelatin}[1]{\cite{#1}\LTRfootnote{\citeauthor*{#1}}}
%\newcommand{\citeplatin}[1]{\citep{#1}\LTRfootnote{\citeauthor*{#1}}}
%% اگر از سایر استیلها استفاده میکنید، خط بالا را غیرفعال و خطهای زیر را فعال کنید.
\let\citep\cite
\let\citelatin\cite
\let\citeplatin\cite
%%%%%%%%%%%%
%\usepackage[nostamp]{draftwatermark}
% بررسی حالت پیش نویس
\usepackage{ifdraft}
\ifdraft
{%
% بستهٔ ایجاد لینکهای رنگی با امکان جهش
\usepackage[unicode=true,pagebackref=true,colorlinks,linkcolor=blue,citecolor=red,bookmarks=true, final]{hyperref}
%\usepackage{todonotes}
%\usepackage[firstpage]{draftwatermark}
\usepackage{draftwatermark}
\SetWatermarkText{\ \ \ پیشنویس}
\SetWatermarkScale{1.2}
}
{
%
\usepackage[unicode=true, pagebackref=false, colorlinks, linkcolor=Blue, citecolor=Purple, urlcolor=Red, bookmarks=true]{hyperref}
%\usepackage[disable]{todonotes} % final without TODOs
%\usepackage[firstpage]{draftwatermark}
%\usepackage{draftwatermark}
%\SetWatermarkColor[RGB]{240, 240, 245}
%\SetWatermarkLightness{0.9813}
%\SetWatermarkText{مرتـضی ذاکــری}
%\SetWatermarkText{\ \ \ پیشنویس}
%\SetWatermarkScale{0.65}
}
\usepackage[obeyDraft]{todonotes}
\setlength{\marginparwidth}{2cm}
% تعیین مشخصات فایل PDF
\hypersetup{
pdftitle={Automatic test data generation in file format fuzzers},
pdfauthor={Morteza ZAKERI},
pdfsubject={Master Thesis},
pdfkeywords={keywords},
pdfdirection={R2L}
}
%%%%%%%%%%%%
%%% تصحیح باگ: اگر در مراجع، آدرس وب حاوی '%' بوده و pagebackref فعال باشد، دستورات زیر باید بیایند:
%% برای استیلهای natbib مثل plainnat-fa، asa-fa، chicago-fa
\makeatletter
\let\ORIG@BR@@lbibitem\BR@@lbibitem
\apptocmd\ORIG@BR@@lbibitem{\endgroup}{}{}
\def\BR@@lbibitem{\begingroup\catcode`\%=12 \ORIG@BR@@lbibitem}
\makeatother
%% برای سایر استیلها
\makeatletter
\let\ORIG@BR@@bibitem\BR@@bibitem
\apptocmd\ORIG@BR@@bibitem{\endgroup}{}{}
\def\BR@@bibitem{\begingroup\catcode`\%=12 \ORIG@BR@@bibitem}
\makeatother
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% بسته و دستوراتی برای ایجاد لینکهای رنگی با امکان جهش
%\usepackage[pagebackref=false,colorlinks,linkcolor=blue,citecolor=purple]{hyperref}
% چنانچه قصد پرینت گرفتن نوشته خود را دارید، خط بالا را غیرفعال و از دستور زیر استفاده کنید چون در صورت استفاده از دستور زیر،
% لینکها به رنگ سیاه ظاهر خواهند شد که برای پرینت گرفتن، مناسبتر است
%\usepackage[pagebackref=false]{hyperref}
% بسته لازم برای تنظیم سربرگها
\usepackage{fancyhdr}
\usepackage{setspace}
% بستههای لازم برای نوشتن الگوریتم
\usepackage{algorithm}
\usepackage{algorithmic}
% Add by Morteza %
%\usepackage[linesnumbered,ruled,vlined]{algorithm2e}
% بستههای لازم برای رسم بهتر جداول
\usepackage{tabulary}
\usepackage{tabularx}
%% Add by Morteza
\usepackage{multirow}
\usepackage{fourier}
\usepackage{array}
\usepackage{makecell} % I use this %
\usepackage{booktabs}
%%
% بستههای لازم برای رسم تنظیم بهتر شکلها و زیرشکلها
\usepackage[export]{adjustbox}
%\usepackage{subfigure}
%\usepackage[subfigure]{tocloft}
\usepackage{tocloft}
%\usepackage{subfig}
%\usepackage{caption}
%\usepackage{subcaption}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% بستهای برای رسم نمودارها و نیز صفحه مالکیت اثر
\usepackage{tikz}
% بستهای برای ظاهر شدن «مراجع» و «نمایه» در فهرست مطالب
\usepackage[nottoc]{tocbibind}
% دستورات مربوط به ایجاد نمایه
\usepackage{makeidx}
\makeindex
%%% بسته ایجاد واژهنامه با xindy
\usepackage[xindy,acronym,nonumberlist=true]{glossaries}
% بسته زیر باگ ناشی از فراخوانی بستههای زیاد را برطرف میکند.
\usepackage{morewrites}
%%%%%%%%%%%%%%%%%%%%%%%%%%
% بخش قلم باید بازنویسی و قابل حمل شود. نیازمند تغییر جدی
% فراخوانی بسته زیپرشین و تعریف قلم فارسی و انگلیسی
%\usepackage[extrafootnotefeatures]{xepersian}
\usepackage{xepersian}
\settextfont[Scale=1]{XB Niloofar}
\setlatintextfont[Scale=0.9]{Times New Roman}
% چنانچه میخواهید اعداد در فرمولها، انگلیسی باشد، خط زیر را غیرفعال کنید
\setdigitfont[Scale=1]{XB Zar}%{Persian Modern}
% تعریف قلمهای فارسی و انگلیسی اضافی برای استفاده در بعضی از قسمتهای متن
\defpersianfont\titlefont[Scale=1]{XB Titre}
% \defpersianfont\iranic[Scale=1.1]{XB Zar Oblique}%Italic}%
\defpersianfont\nastaliq[Scale=1.2]{IranNastaliq}
%%%%%%%%%%%%%%%%%%%%%%%%%%
% بسته زیر و متعاقباً دستورات ادامه آن، برای برای ریست کردن شماره پانویسها در هر صفحه قرار داده شده است (به درخواست دکتر محمد عبداللهی ازگمی)
%\usepackage[perpage]{footmisc}
\usepackage{zref-perpage}
\zmakeperpage{footnote}
\usepackage{bidi}
\makeatletter
\@bidi@removefromreset{footnote}{chapter}
\makeatother
% راستچین شدن todonotes
\presetkeys{todonotes}{align=right, textdirection=righttoleft}{}
\makeatletter
\providecommand\@dotsep{5}
\def\listtodoname{فهرست کارهای باقیمانده}
\def\listoftodos{\noindent{\Large\vspace{10mm}\textbf{\listtodoname}}\@starttoc{tdo}}
\renewcommand{\@todonotes@MissingFigureText}{شکل}
\renewcommand{\@todonotes@MissingFigureUp}{شکل}
\renewcommand{\@todonotes@MissingFigureDown}{جاافتاده}
\makeatother
% دستوری برای حذف کلمه «چکیده»
\renewcommand{\abstractname}{}
% دستوری برای حذف کلمه «abstract»
%\renewcommand{\latinabstract}{}
% دستوری برای تغییر نام کلمه «اثبات» به «برهان»
\renewcommand\proofname{\textbf{برهان}}
% دستوری برای تغییر نام کلمه «کتابنامه» به «مراجع»
\renewcommand{\bibname}{مراجع}
% دستوری برای تعریف واژهنامه انگلیسی به فارسی
\newcommand\persiangloss[2]{#1\dotfill\lr{#2}\\}
% دستوری برای تعریف واژهنامه فارسی به انگلیسی
\newcommand\englishgloss[2]{#2\dotfill\lr{#1}\\}
% تعریف دستور جدید «\پ» برای خلاصهنویسی جهت نوشتن عبارت «پروژه/پایاننامه/رساله»
\newcommand{\پ}{پروژه/پایاننامه/رساله}
%\newcommand\BackSlash{\char`\\}
%%%%%%%%%%%%%%%%%%%%%%%%%%
\SepMark{-}
% تعریف و نحوه ظاهر شدن عنوان قضیهها، تعریفها، مثالها و ...
\theoremstyle{definition}
\newtheorem{definition}{تعریف}[section]
\theoremstyle{theorem}
\newtheorem{theorem}[definition]{قضیه}
\newtheorem{lemma}[definition]{لم}
\newtheorem{proposition}[definition]{گزاره}
\newtheorem{corollary}[definition]{نتیجه}
\newtheorem{remark}[definition]{ملاحظه}
\theoremstyle{definition}
\newtheorem{example}[definition]{مثال}
%\renewcommand{\theequation}{\thechapter-\arabic{equation}}
%\def\bibname{مراجع}
\numberwithin{algorithm}{chapter}
\def\listalgorithmname{فهرست الگوریتمها}
\def\listfigurename{فهرست شکلها}
\def\listtablename{فهرست جدولها}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% دستورهایی برای سفارشی کردن سربرگ صفحات
% \newcommand{\SetHeader}{
% \csname@twosidetrue\endcsname
% \pagestyle{fancy}
% \fancyhf{}
% \fancyhead[OL,EL]{\thepage}
% \fancyhead[OR]{\small\rightmark}
% \fancyhead[ER]{\small\leftmark}
% \renewcommand{\chaptermark}[1]{%
% \markboth{\thechapter-\ #1}{}}
% }
%%%%%%%%%%%%
%\def\MATtextbaseline{1.5}
%\renewcommand{\baselinestretch}{\MATtextbaseline}
%\fancyhead[LE,RO]{\slshape \rightmark}
%\fancyhead[LO,RE]{\slshape \leftmark}
%\fancyfoot[C]{\thepage}
\doublespacing
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% دستوراتی برای اضافه کردن کلمه «فصل» در فهرست مطالب
\newlength\mylenprt
\newlength\mylenchp
\newlength\mylenapp
\renewcommand\cftpartpresnum{\partname~}
\renewcommand\cftchappresnum{\chaptername~}
\renewcommand\cftchapaftersnum{:}
\settowidth\mylenprt{\cftpartfont\cftpartpresnum\cftpartaftersnum}
\settowidth\mylenchp{\cftchapfont\cftchappresnum\cftchapaftersnum}
\settowidth\mylenapp{\cftchapfont\appendixname~\cftchapaftersnum}
\addtolength\mylenprt{\cftpartnumwidth}
\addtolength\mylenchp{\cftchapnumwidth}
\addtolength\mylenapp{\cftchapnumwidth}
\setlength\cftpartnumwidth{\mylenprt}
\setlength\cftchapnumwidth{\mylenchp}
\makeatletter
{\def\thebibliography#1{\chapter*{\refname\@mkboth
{\uppercase{\refname}}{\uppercase{\refname}}}\list
{[\arabic{enumi}]}{\settowidth\labelwidth{[#1]}
\rightmargin\labelwidth
\advance\rightmargin\labelsep
\advance\rightmargin\bibindent
\itemindent -\bibindent
\listparindent \itemindent
\parsep \z@
\usecounter{enumi}}
\def\newblock{}
\sloppy
\sfcode`\.=1000\relax}}
%اگر مایلید در شماره گذاری حرفی و ابجد به جای آ از الف استفاده شود دستورات زیر را فعال کنید.
%\def\@Abjad#1{%
% \ifcase#1\or الف\or ب\or ج\or د%
% \or هـ\or و\or ز\or ح\or ط%
% \or ی\or ک\or ل\or م\or ن%
% \or س\or ع\or ف\or ص%
% \or ق\or ر\or ش\or ت\or ث%
% \or خ\or ذ\or ض\or ظ\or غ%
% \else\@ctrerr\fi}
%
% \def\abj@num@i#1{%
% \ifcase#1\or الف\or ب\or ج\or د%
% \or هـ\or و\or ز\or ح\or ط\fi
% \ifnum#1=\z@\abjad@zero\fi}
%
% \def\@harfi#1{\ifcase#1\or الف\or ب\or پ\or ت\or ث\or
% ج\or چ\or ح\or خ\or د\or ذ\or ر\or ز\or ژ\or س\or ش\or ص\or ض\or ط\or ظ\or ع\or غ\or
% ف\or ق\or ک\or گ\or ل\or م\or ن\or و\or ه\or ی\else\@ctrerr\fi}
\makeatother
%%%%%%%%%%
% Packages add by Morteza Zakeri to support code snips M.Sc. Thesis 13970415
% بستههای مورد نیاز برای نوشتن کدها، رنگآمیزی آنها و تعیین پوشهٔ کدها
\definecolor{mygreen}{rgb}{0,0.6,0}
\definecolor{mygray}{rgb}{0.1,0.1,0.1}
\definecolor{mymauve}{rgb}{0.58,0,0.82}
%\ProvidesFile{listings-xepersian.def}[2014/07/17 v0.3 bilingual captions for listings package]
%\def\lstlistingname{\if@RTL else\ Listing\fi}
%\def\lstlistlistingname{\if@RTL else\ Listings\fi}
\lstdefinestyle{myStyle}{
backgroundcolor=\color{white}, % choose the background color; you must add \usepackage{color} or \usepackage{xcolor}; should come as last argument
basicstyle=\ttfamily, % whole listing /w verbatim font
breakatwhitespace=false, % sets if automatic breaks should only happen at whitespace
breaklines=true, % sets automatic line breaking
captionpos=b, % sets the caption-position to bottom
commentstyle=\color{mygreen}, % comment style
deletekeywords={...}, % if you want to delete keywords from the given language
escapeinside={\%*}{*)}, % if you want to add LaTeX within your code
extendedchars=true, % lets you use non-ASCII characters; for 8-bits encodings only, does not work with UTF-8
frame=tb, % adds a frame around the code
lineskip=.2cm, % space between code lines
keepspaces=true, % keeps spaces in text, useful for keeping indentation of code (possibly needs columns=flexible)
keywordstyle=\color{blue}, % keyword style
language=Octave, % the language of the code
morekeywords={*,...}, % if you want to add more keywords to the set
numbers=left, % where to put the line-numbers; possible values are (none, left, right)
numbersep=3pt, % how far the line-numbers are from the code
numberstyle=\tiny\color{mygray}\lr, % the style that is used for the line-numbers
rulecolor=\color{black}, % if not set, the frame-color may be changed on line-breaks within not-black text (e.g. comments (green here))
showspaces=false, % show spaces everywhere adding particular underscores; it overrides 'showstringspaces'
showstringspaces=false, % underline spaces within strings only
showtabs=false, % show tabs within strings adding particular underscores
stepnumber=1, % the step between two line-numbers. If it's 1, each line will be numbered
stringstyle=\ttfamily\color{mymauve}, % string literal style
tabsize=2, % sets default tabsize to 2 spaces
title=\lstname, % show the filename of files included with \lstinputlisting; also try caption instead of title
captionpos=b,
captiondirection=RTL
}
\lstdefinestyle{myStyle2}{
basicstyle=\ttfamily, % whole listing /w verbatim font
keywordstyle=\color{blue}\bfseries, % bold black keywords
identifierstyle=, % nothing happens
commentstyle=\color{LimeGreen}, % green comments
stringstyle=\ttfamily\color{red}, % red typewriter font for strings
showstringspaces=false % no special string spaces
breaklines=true,
breakatwhitespace=false,
numbers=right, % line number formats
numberstyle=\footnotesize\lr,
numbersep=-10pt,
frame=single,
captionpos=b,
captiondirection=RTL
}
\lstset{style=myStyle} % command to set default style
%\def\listingsfont{\ttfamily}
\def\lstlistingname{\rl{برنامه}}
%\def\lstlistingname{\rl{تکه کد}}
% for numbering subsubsections
%\setcounter{secnumdepth}{3}
% to include subsubsections in the table of contents
%\setcounter{tocdepth}{3}
%\usepackage{hyperref}
\usepackage{csquotes}
\usepackage{epigraph}
\setlength\epigraphwidth{.7\textwidth}
\renewcommand{\epigraphflush}{flushleft}
\renewcommand{\sourceflush}{flushleft}
\renewcommand{\textflush}{flushepinormal}
%\usepackage{polyglossia}
%\usepackage[algo2e,linesnumbered,ruled,vlined]{algorithm2e}
\usepackage{textgreek}
\usepackage{booktabs} % professional-quality tables
\usepackage{amsfonts} % blackboard math symbols
\usepackage{nicefrac} % compact symbols for 1/2, etc.
\usepackage{microtype} % microtypography
\usepackage{amsmath}
\usepackage[algo2e, ruled, linesnumbered, resetcount]{algorithm2e}
\def\HiLi{\leavevmode\rlap{\hbox to \hsize{\color{yellow!50}\leaders\hrule height .8\baselineskip depth .5ex\hfill}}}
%\usepackage[printwatermark]{xwatermark}
\usepackage{watermark}
%\usepackage{bm}
\usepackage{subcaption}
%\usepackage{multicol}
%\renewcommand\thesubfigure{\harfi{subfigure}}
\renewcommand{\thesubfigure}{\harfi{subfigure}}
%%%
\usepackage[open, openlevel=1, atend]{bookmark}[2018/07/22]
\bookmarksetup{color=blue}
\bookmark[dest=titlefa]{تولید خودکار داده آزمون در فازرهای قالب فایل}
%\bookmark[dest=acknowledgement]{درباره نسخه پیشنویس}
\bookmark[dest=acknowledgment]{قدردانی}
\bookmark[dest=abstractfa]{چکیده}
\bookmark[dest=tableofcontent]{فهرست مطالب}
% end of packages add by Morteza
%%%%%%%%%