-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathAmin.sty
401 lines (309 loc) · 9.64 KB
/
Amin.sty
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
\ProvidesPackage{Amin}[2019/07/14 Amin most used commands]
\RequirePackage[dvipsnames,table,xcdraw]{xcolor}
%%%%%%%%%% Commands %%%%%%%%%%%%%
%%%%% block comment
\newcommand{\cm}[1]{} % multi-line block comment
% example:
%
\cm{
comments here
}
%
%%%%% email
% example:
% \email{email}
\RequirePackage{fontawesome} % http://mirrors.ctan.org/fonts/fontawesome/doc/fontawesome.pdf
\RequirePackage{hyperref}
\RequirePackage[dvipsnames]{xcolor}
% Color setup for the links
\hypersetup{
colorlinks=true, % hyperlinks will be coloured
linkcolor=blue, % hyperlink text will be green
urlcolor=blue,
filecolor=magenta,
linkbordercolor=blue,% hyperlink border will be red
allbordercolors={0 0 0},
pdfborderstyle={/S/U/W 1}, % underline links instead of boxes
% linkbordercolor=blue, % color of internal links
% citebordercolor=blue, % color of links to bibliography
% filebordercolor=blue, % color of file links
% urlbordercolor=blue % color of external links
}
%
\newcommand{\email}[1]{\faEnvelopeO \reps{1} \href{mailto:#1} { \underline{\texttt{#1}} } }
%%%%%%% link
% url with description
% example:
% \link{link description}{url itself}
\newcommand{\link}[2]{\href{#1}{\underline{\texttt{#2}}}}
%%%%%%% link with Icon
% example:
% \link{icon}{link description}{url itself}
\newcommand{\linkIcon}[3]{#1\space \href{#2} {\underline{\texttt{#3}}}}
%%%%%%% Website
% example:
% \web{website url}
\newcommand{\web}[1]{\linkIcon{\faGlobe}{#1}{Page}}
%%%%%%% Github
% example:
% \github{website url}
\newcommand{\github}[2]{\linkIcon{\faGithub}{#1}{#2}}
%%%%%%% Linkedin
% example:
% \linkedin{website url}
\newcommand{\linkedin}[1]{\linkIcon{\faLinkedin}{#1}{}}
%%%%% url
% url without description
% example:
\newcommand{\linkto}[1]{\faLink \reps{1}\href{#1} { \underline{\texttt{Link}} } }
\newcommand{\pdf}[1]{\faFilePdfO \reps{1}\href{#1} { \underline{\texttt{Link}} } }
%%%% Expert Icon
\newcommand{\ex}{\includegraphics[width=4mm]{expert.png}}
%%%% Bullet Icon
\newcommand{\bul}{\textbullet \reps{1}}
%%%% right sided text
% example:
% \rightSide{text}
\newcommand{\rightSide}[1]{\hspace*{\fill}#1}
% other ways - affects line vertical distance
\newcommand{\rightSideT}[1]{\hfill#1}
\newcommand{\rightSideTT}[1]{\hspace*{\fill}#1}
\newcommand{\rightSideTTT}[1]{\null\hfill#1}
\newcommand{\rightSideTTTT}[1]{\hspace*{0pt}\hfill#1}
\newcommand{\rightSideTTTTT}[1]{\mbox{}\hfill#1}
%%%%% Char repeater - rep
% example:
% \rep{3}{A}
% \rep[-]{4}{x}
\RequirePackage{xparse}
\ExplSyntaxOn
\DeclareExpandableDocumentCommand{\rep}{O{}mm}
{
\int_compare:nT { #2 > 0 }
{
#3 \prg_replicate:nn { #2 - 1 } { #1#3 }
}
}
\ExplSyntaxOff
%%%%%%% Space repeater - reps
% example:
% \reps{10}
\newcommand{\reps}[1]{\rep{#1}{\space}}
%%%%%%% bold item - bitem
% Item with 1st phrase being Bold
% example:
% \bolditem{bold phrase}{rest of the text}
\newcommand{\bitem}[2]{\item{\textbf{#1} #2}}
%%%%%%% sub Item
% 1 quick sub item
% example:
% \begin{itemize}
% \subItem{a sub item}
% \end{itemize}
\newcommand{\subItem}[1]{\begin{itemize} \item #1 \vspace{-2.5pt} \end{itemize}}
\newcommand{\subItemm}[1]{\begin{itemize} \addtolength{\itemindent}{-0.5cm} \item #1 \vspace{-2.5pt} \end{itemize}}
%%%%% Fake item
\newcommand{\fakeItemb}[1]{\vspace{4pt} \\\bul #1} % bullet
\newcommand{\fakeItemh}[1]{\vspace{4pt} \\- #1} % hyphen
%%%%%%% rect Head
% title bar - A rectangle which contains the title
% example:
% \resheading{title here}
\RequirePackage{framed}
\RequirePackage[dvipsnames]{xcolor}
\setlength{\outerbordwidth}{3pt} % Width of border outside of title bar
\definecolor{shadecolor}{gray}{1} % Outer background color of title bar (0 = black, 1 = white/invisible)
\definecolor{LightGray}{gray}{0.9} % Inner background color of title bar
\newcommand{\rectHead}[1]{\vspace{-10pt}
\parbox{\textwidth}{\setlength{\FrameSep}{\outerbordwidth}
\begin{shaded}
\setlength{\fboxsep}{0pt}\framebox[\textwidth][l]{\setlength{\fboxsep}{1pt}\fcolorbox{LightGray}{LightGray}{\textbf{\sffamily{\mbox{~}\makebox[6.762in][l]{\large #1} \vphantom{p\^{E}}}}}}
\end{shaded}
}\vspace{-8pt}
}
%%%%%%% sub Tab
% 4 element table like text, with top left item being bold
% example:
% \ressubheading{Title}{right description}{bottom left description}{bottom right description}
% can be used inside an itemize after \item
% \begin{itemize}
% \item \ressubheading{Title}{right description}{bottom left description}{bottom right description}
% \end{itemize}
\newcommand{\subTab}[4]{
\begin{tabular*}{6.5in}{l@{\cftdotfill{\cftsecdotsep}\extracolsep{\fill}}r}
\textbf{#1} & #2 \\
\textit{#3} & \textsl{#4} \\
\end{tabular*}\vspace{-5pt}}
%%%%%%%%% Changing bullet point to - in items globally
% insert at the before the document starts
% \renewcommand{\labelitemi}{$-}
% instead of star you find more symbols in:
% http://www.ctan.org/tex-archive/info/symbols/comprehensive/
%%%%%%%% Justifying Itemize
% example:
% after begin{itemize} or similar commands use : \justifying
\RequirePackage{ragged2e}
%%%%% Color Names
\RequirePackage[dvipsnames]{xcolor}
%%%%%%%% Numbered items
%\begin{enumerate}
% \item First item
% \item Second item
%\end{enumerate}
%%%%% List items
% example:
% \begin{itemize}[label={--}]
% \item
% \end{itemize}
% \RequirePackage{enumitem} % http://ctan.org/pkg/enumitem
%%%%% Tags
\RequirePackage{tikz}
% Create a tag
% Usage: \cvtag{<tag label>}
\newcommand{\cvtag}[1]{%
\tikz[baseline]\node[anchor=base,draw=Black!70,rounded corners=0.5ex,inner xsep=1ex,inner ysep =0.55ex,text height=1.3ex,text depth=.25ex]{#1};
}
\newcommand{\tags}[1]{\footnotesize{\foreach \n in {#1}{\cvtag{\n}}}}
%%%%% Tables:
% https://www.tablesgenerator.com/latex_tables
\RequirePackage{booktabs}
%%%%%%%%%% Environments %%%%%%%%%%%%%
%%%%%% code snippets
% example:
% \codeIn{matlab}{code here}
% https://www.overleaf.com/learn/latex/Code_Highlighting_with_minted
\RequirePackage[dvipsnames]{xcolor}
\definecolor{LightGray}{gray}{0.93} % background color of codes
\RequirePackage{minted}
%%% code inline - codeIn
\newcommand{\codeIn}[2]{\mint{#1}{#2}}
%%%% Code - code
% example:
% \begin{code}{lang}
% code here
% \end{code}
\newenvironment{code}[1]
{
\VerbatimEnvironment
\begin{minted}[
frame=lines, % lines below/above the code
framesep=2mm,
% baselinestretch=1.2, % distance between lines
% bgcolor=LightGray, % back ground color
fontfamily=courier,
% fontsize=\scriptsize, % \footnotesize \large
% xleftmargin=21pt
% linenos, % code line number
]{#1}}
{\end{minted}
}
%%%% code with caption - codeCap
% example:
% \begin{codeCap}{lang}{caption}{Code:label}
% code here
% \end{codeCap}
% label is for refering
\newenvironment{codeCap}[3]
{
\VerbatimEnvironment
\begin{listing}
\caption{#2}\label{#3}
\begin{minted}[
frame=lines, % lines below/above the code
framesep=2mm,
% baselinestretch=1.2, % distance between lines
% bgcolor=LightGray, % back ground color
fontfamily=courier,
% fontsize=\scriptsize, % \footnotesize \large
% xleftmargin=21pt
% linenos, % code line number
]{#1}}
{\end{minted}
\end{listing}
}
%%%%%% Code File - codeFile
% example:
% \codeFile{language}{filename with extension}
\newcommand{\codeFile}[2]{\inputminted{#1}{#2}}
%%%%%% Code File with caption - codeFileCap
% example:
% \begin{codeFileCap}{lang}{filename with extension}{caption}{Code:label}
% \end{codeCap}
\newenvironment{codeFileCap}[4]
{
\VerbatimEnvironment
\begin{listing}
\caption{#3}\label{#4}
\inputminted[
frame=lines, % lines below/above the code
framesep=2mm,
% baselinestretch=1.2, % distance between lines
% bgcolor=LightGray, % back ground color
fontfamily=courier,
% fontsize=\scriptsize, % \footnotesize \large
% xleftmargin=21pt
% linenos, % code line number
]{#1}{#2}
}
{ \end{listing}}
%%%%%% Auto Multi Column Items - autoMulCol
% example:
\RequirePackage{etoolbox} % \preto
\RequirePackage{refcount} % multiple commands
\RequirePackage{multicol} % \multicols
% required counters
\newcounter{countitems}
\newcounter{nextitemizecount}
\newcommand{\setupcountitems}{%
\stepcounter{nextitemizecount}%
\setcounter{countitems}{0}%
\preto\item{\stepcounter{countitems}}%
}
\makeatletter
\newcommand{\computecountitems}{%
\edef\@currentlabel{\number\c@countitems}%
\label{countitems@\number\numexpr\value{nextitemizecount}-1\relax}%
}
\newcommand{\nextitemizecount}{%
\getrefnumber{countitems@\number\c@nextitemizecount}%
}
\newcommand{\previtemizecount}{%
\getrefnumber{countitems@\number\numexpr\value{nextitemizecount}-1\relax}%
}
\makeatother
% environment itself
\newenvironment{autoMulCol}{%
\ifnumcomp{\nextitemizecount}{>}{3}{\begin{multicols}{2}}{}%
\setupcountitems\begin{itemize}}%
{\end{itemize}%
\unskip\computecountitems\ifnumcomp{\previtemizecount}{>}{3}{\end{multicols}}{}}
%%%%%%%%%%% Quick Table of Content Items
% example:
% \begin{qtoc}
% \qtem{left side text 1}{right side text 1}
% \qtem{left side text 2}{right side text 2}
% \end{qtoc}
\RequirePackage{tocloft}
% qtoc environment
\newenvironment{qtoc}{
\begin{center}
\begin{minipage}{6.5in}
}{
\end{minipage}
\end{center}
}
% new qtoc item
\newcommand{\qtem}[2]{#1 \dotfill #2\\}
% \RequirePackage{multicol} % \multicolumn
% % qtoc environment
% \newenvironment{qtoc}{
% % \VerbatimEnvironment
% \begin{center}
% \begin{tabular*}{7in}{l 1@{\extracolsep{\fill}}r}
% }{
% \end{tabular*}
% \end{center}
% }
% % new qtoc item
% \newcommand{\qtem}[2]{\multicolumn{2}{c}{#1 \cftdotfill{\cftdotsep}#2} \vspace{1pt} \\
% \vphantom{E}}