-
Notifications
You must be signed in to change notification settings - Fork 0
/
my_modifications.sty
126 lines (114 loc) · 3.56 KB
/
my_modifications.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
% flow charts
\usepackage{tikz}
\usetikzlibrary{shapes, arrows}
\usepackage{nameref}
\usepackage[super]{nth}
\usepackage{longtable}
\usepackage{tabularray}
% for side by side figures
\usepackage{caption}
\usepackage{subcaption}
% for my table env
\usepackage{booktabs}
\usepackage{tabularx}
\usepackage{lipsum}
\usepackage{enumitem} %for compact itemize
% \usepackage{makecell} %for table
%-------
% to reduce spacing between figure and caption
\usepackage{caption}
\captionsetup[figure]{skip=0pt}
\renewcommand\labelitemi{---}
% for pandas table
\usepackage{multirow}
\usepackage{booktabs}
% \usepackage[table]{xcolor}
\usepackage{siunitx}
% \usepackage[colorlinks=true, linkcolor=blue]{hyperref}
\usepackage{xcolor}
\usepackage{multirow}
\usepackage{colortbl}
% -----------------
\usepackage{bbm} % for mathbbm 1
\usepackage{todonotes}
% only numerate referenced equations (refrence with \eqref{key})
\usepackage{mathtools}
\mathtoolsset{showonlyrefs}
\newenvironment{my_figure}[3][h]{
\begin{figure}[#1]
\begin{center}
% \fbox % trim= left bottom right top % trim= 0.8cm 0.8cm 0.6cm 0.8cm
\includegraphics[#2]{#3}
% for more options: https://latexref.xyz/_005cincludegraphics.html
\label{fig:#3}
}{
\end{center}
\end{figure}
}
\pdfstringdefDisableCommands{%
\def\textsuperscript#1{\textasciicircum(#1)}%
}
% Environment for pros and cons table
\usepackage{float} % for H force-here
\newenvironment{my_pros_cons_table}[3][topsep=0pt,parsep=2pt,partopsep=0pt, leftmargin=5pt, rightmargin=-10pt]{
\begin{table}[H]
\vspace{-8pt} % remove space before table
\begin{tabularx}{\linewidth}{>{\parskip1ex}X@{\kern4\tabcolsep}>{\parskip1ex}X}
% \toprule %makes a bar at the top
\hfil\bfseries Strengths & \hfil\bfseries Weaknesses % consider repalcing `\hfil' with `\texorpdfstring{\hfil}{\space}'
\\\cmidrule(r{3\tabcolsep}){1-1}\cmidrule(l{-\tabcolsep}){2-2}
\vspace{-11pt} % no gap wetween pros/cons and list
\begin{itemize}[#1]
#2
\end{itemize}
% \vspace{-11pt} % no effect
\nointerlineskip &
\vspace{-11pt} % no gap wetween pros/cons and list
\begin{itemize}[#1]
#3
\end{itemize}
% \vspace{-11pt} % no effect
\nointerlineskip
\\\bottomrule
\end{tabularx}
\vspace{-5pt}
}{\end{table}}
\newenvironment{cptitemize}
{\par \parskip=0pt
\begin{minipage}[t]{\linewidth}
\begin{itemize}[nosep, topsep=0pt,parsep=2pt,partopsep=0pt, leftmargin=5pt, rightmargin=0pt,after=\strut]
}{
\end{itemize}
\end{minipage}
}
% footnotes reference
\newcommand\footnoteref[1]{\protected@xdef\@thefnmark{\ref{#1}}\@footnotemark}
% Assummption
\newtheorem*{assumption*}{\assumptionnumber}
\providecommand{\assumptionnumber}{}
\makeatletter
\newenvironment{assumption}[1]
{%
\renewcommand{\assumptionnumber}{Assumption #1}%
\begin{assumption*}%
\protected@edef\@currentlabel{#1}%
}
{%
\end{assumption*}
}
%% use:
% \begin{assumption}{1}{F}\label{1F}
% Something
% \end{assumption}
\definecolor{SCL0color}{HTML}{000000}
\definecolor{SCL1color}{HTML}{ff0000}
\definecolor{SCL2color}{HTML}{404040}
\definecolor{SCL3color}{HTML}{bf8144}
\definecolor{SCL4color}{HTML}{00ff3c}
\definecolor{SCL5color}{HTML}{ffed50}
\definecolor{SCL6color}{HTML}{0d00fa}
\definecolor{SCL7color}{HTML}{808080}
\definecolor{SCL8color}{HTML}{bfbfbf}
\definecolor{SCL9color}{HTML}{eeeeee}
\definecolor{SCL10color}{HTML}{0bb8f0}
\definecolor{SCL11color}{HTML}{ffbfbf}