-
Notifications
You must be signed in to change notification settings - Fork 0
/
tst.sh
173 lines (140 loc) · 4.81 KB
/
tst.sh
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
#!/bin/bash
# Function to display a dropdown menu using fzf
DROP_DOWN () {
local options="$1"
local query="$2"
local selected=$(echo -e "$options" | fzf --height 10% --border --prompt "$query ")
[[ -z "$selected" || "$selected" == "exit" ]] && exit
echo "$selected"
}
# Function to get responses for Academic Transcript and References
GET_ACADEMIC_REFERENCES () {
local transcript_response
local references_response
while true; do
# Ask for academic transcript
transcript_response=$(DROP_DOWN "yes\nno" "ACADEMIC TRANSCRIPT? ")
if [[ "$transcript_response" == "xX" ]]; then
return # Exit if the user explicitly chooses "xX" for the first question
elif [[ "$transcript_response" == "yes" ]]; then
# If yes for academic transcript, ask for references
references_response=$(DROP_DOWN "yes\nno\nxX" "REFERENCES? ")
if [[ "$references_response" == "xX" ]]; then
continue # Go back to the academic transcript question
elif [[ "$references_response" == "yes" ]]; then
echo 12 # Both academic transcript and references
break
else
echo 1 # Only academic transcript
break
fi
else
# If no for academic transcript, ask for references
references_response=$(DROP_DOWN "yes\nno\nxX" "REFERENCES? ")
if [[ "$references_response" == "xX" ]]; then
continue # Go back to the academic transcript question
elif [[ "$references_response" == "yes" ]]; then
echo 2 # Only references
break
else
echo 0 # Neither academic transcript nor references
break
fi
fi
done
}
# Function to generate the LaTeX header
generate_header() {
cat <<EOF
\documentclass[12pt]{article}
\usepackage{geometry}
\usepackage{fancyhdr}
\usepackage{parskip}
\usepackage{enumitem}
\usepackage{setspace}
\usepackage{lipsum} % For placeholder text
% Page geometry
\geometry{a4paper, margin=1.5in}
% Title formatting to eliminate horizontal misalignment
\makeatletter
\renewcommand{\maketitle}{
\begin{center}
{\Huge \@title \par}
\vskip 0.01em
{\large \@author \par}
\vskip -1em
{\large \@date \par}
\noindent\hrulefill
\end{center}
}
\makeatother
% Title setup
\title{Application Overview}
\author{Arfaz Hossain}
\date{\today}
% Spacing
\setstretch{1.3}
\setstretch{1.3}
\pagestyle{fancy}
\fancyhf{}
\fancyfoot[C]{0}
\begin{document}
\maketitle
\vskip 2em
This document contains the following attachments, structured as follows:\\\\
\begin{itemize}[leftmargin=*,labelsep=1em]
\item \textbf{Page 1: Cover Letter}\\\\
This section contains a formal cover letter addressed to the hiring manager. It highlights my relevant skills, experience, and motivation for applying for the position.
\item \textbf{Pages 2-3: Resume}\\\\
My resume provides a detailed overview of my education, technical skills, projects, work experiences, and volunteering activities.
EOF
}
# Function to generate the Transcript section
generate_transcript() {
cat <<EOF
\item \textbf{Pages 4-6: University of Victoria Unofficial Transcript}\\\\
The transcript reflects my academic record at the University of Victoria, where I am pursuing a Bachelor of Engineering in Software Engineering.
EOF
}
# Function to generate the Reference section
generate_reference() {
local current_page=$1
cat <<EOF
\item \textbf{Page ${current_page}: Reference}\\\\
This section contains references or any additional information that supports my application.
EOF
}
# Function to generate the LaTeX footer
generate_footer() {
cat <<EOF
\end{itemize}
\vspace{2em}
Please feel free to reach out if you require any additional information or have any questions.
\vfill\noindent\hrulefill
\end{document}
EOF
}
# Main function to generate the complete LaTeX document
generate_tex() {
local include_sections=$1
local current_page=1
local preprocess_directory="$(dirname "$directory")/9.2 PreProcessed"
local tex_file="$(dirname "$directory")/9.2 PreProcessed/overview.tex"
generate_header > "$tex_file"
if [[ "$include_sections" == *"1"* ]]; then
current_page=$((current_page + 3))
generate_transcript >> "$tex_file"
fi
if [[ "$include_sections" == *"2"* ]]; then
current_page=$((current_page + 3))
generate_reference "$current_page" >> "$tex_file"
fi
generate_footer >> "$tex_file"
# Compile the LaTeX document
pdflatex -output-directory="$preprocess_directory" "$tex_file"
rm "$preprocess_directory"/overview.{aux,log}
}
# Example usage:
generate_tex $(GET_ACADEMIC_REFERENCES)
# Call the function
# GET_ACADEMIC_REFERENCES