summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJake VanderVaate <jake.vandervaate@protonmail.com>2021-11-24 14:44:06 -0600
committerJake VanderVaate <jake.vandervaate@protonmail.com>2021-11-24 14:44:06 -0600
commitd472fa0b8850acbb7f55cbb2ed570d2aa81cc334 (patch)
treefa6dfdc19c1cc52ad3db1c259daa06bb1964e807
parenta7a33e85b36e9465481d4b5ec08bc01bd434820f (diff)
added article template, updated resume and pdf2png
-rw-r--r--README.md57
-rw-r--r--article/article-1.pngbin0 -> 6011 bytes
-rw-r--r--article/article-2.pngbin0 -> 4691 bytes
-rw-r--r--article/article-3.pngbin0 -> 47968 bytes
-rw-r--r--article/article.pdfbin0 -> 125429 bytes
-rw-r--r--article/article.tex85
-rw-r--r--article/commands.tex76
-rw-r--r--article/packages.tex19
-rwxr-xr-xpdf2png.sh28
-rw-r--r--resume/commands.tex3
-rw-r--r--resume/packages.tex4
-rw-r--r--resume/resume.pdfbin71675 -> 76670 bytes
-rw-r--r--resume/resume.tex15
13 files changed, 268 insertions, 19 deletions
diff --git a/README.md b/README.md
index ef11b1b..d45c491 100644
--- a/README.md
+++ b/README.md
@@ -2,6 +2,27 @@
Templates I've designed for LaTeX documents
+[TOC]
+
+
+## Article
+
+![Cover page of the article document](article/article-1.png)
+![Table of contents of the article document](article/article-2.png)
+![Content page for the article document](article/article-3.png)
+
+The article uses the three following files:
+
+* **article.tex**- This is the main document file where document content goes.
+ I've different lines of this to explain what they do and what editing them changes.
+* **commands.tex**- This file has my custom commands to style the headings, title, and lists.
+ This file has a commented out section (lines that start with `%`) that can number each section in the body of the document if you'd like them numbered.
+ Also change the line `\setcounter{secnumberdepth}{0}` to the section numbering depth you'd like in your document table of contents (TOC). `0` means show no numbers at any level, where `3` would number the sections, subsections, and subsubsections in the TOC.
+* **packages.tex**- This file contains all the packages I use in this template.
+ More packages may need to be added to extend the functionality of this template if you'd like it to do more.
+ I did already include the table and graphics packages you need to include tables and images in the document.
+
+
## Resume
![Resume screenshot](resume/resume.png)
@@ -16,6 +37,7 @@ The resume is made up of the three following files:
The main resume file needs the commands.tex and packages.tex file in order to work, so you should copy the entire folder when you want to make another copy of this resume (this is a good idea with any LaTeX document).
+
## pdf2png.sh
This shell script is what I used to generate the document screenshots for this README.
@@ -27,5 +49,38 @@ These are the dependencies for this script:
* imagemagick
* optipng
+Follow these steps to use the script:
+
+1. Make the script executable with `chmod +x pdf2png.sh`
+2. `cd` into the input PDF's directory
+3. Use the command syntax `pdf2png.sh input.pdf first_page_to_convert last_page_to_convert`
+
+If you didn't add pdf2png.sh to your $PATH, make sure to include the path to the script in your command like `path/to/pdf2png.sh file.pdf 1 3`
+
+**Examples**
+
+Turn pages 1-3 from example.pdf into 3 separate PNG images
+
+`pdf2png.sh example.pdf 1 3`
+
+
+Convert the first page of example.pdf into a PNG image
+
+`pdf2png.sh example.pdf 1 1`
+
+or
+
+`pdf2png.sh example.pdf`
+
+
+Convert the third page of example.pdf into a PNG image
+
+`pdf2png.sh example.pdf 3 3`
+
+or
+
+`pdf2png.sh example.pdf 3`
+
+
I've only tested this script on Linux; I can't speak to how well it will work on Mac.
-This script will only work on Windows through Windows Subsystem for Linux (WSL).
+This script should work on Windows through Windows Subsystem for Linux (WSL), but I haven't tested that either.
diff --git a/article/article-1.png b/article/article-1.png
new file mode 100644
index 0000000..681a58b
--- /dev/null
+++ b/article/article-1.png
Binary files differ
diff --git a/article/article-2.png b/article/article-2.png
new file mode 100644
index 0000000..bcb566e
--- /dev/null
+++ b/article/article-2.png
Binary files differ
diff --git a/article/article-3.png b/article/article-3.png
new file mode 100644
index 0000000..f2179ed
--- /dev/null
+++ b/article/article-3.png
Binary files differ
diff --git a/article/article.pdf b/article/article.pdf
new file mode 100644
index 0000000..61fc4c0
--- /dev/null
+++ b/article/article.pdf
Binary files differ
diff --git a/article/article.tex b/article/article.tex
new file mode 100644
index 0000000..8660070
--- /dev/null
+++ b/article/article.tex
@@ -0,0 +1,85 @@
+\documentclass[english]{article}
+\usepackage{titling}
+\title{LaTeX Article Template} %Name the document between the brackets
+\author{Your Name} %Put your name between the brackets
+\date{\today} %Leave this alone and it will automatically use today's date. Change to a specific date if you don't want the date to update automatically.
+
+\input{packages}
+\input{commands}
+
+\hypersetup{
+colorlinks=true,
+linkcolor=black,
+filecolor=magenta,
+urlcolor=cyan,
+pdftitle={\thetitle}, %this displays in the web browser window
+pdfauthor={\theauthor},
+pdfsubject={This is a template for making modern-looking LaTex documents},
+pdfkeywords={LaTeX, template, article},
+}
+
+
+\begin{document}
+\maketitle
+%Begin Document
+
+\section{Introduction}
+
+This is a basic article document.
+This is my standard document that I like to use that doesn't look too \LaTeX-ey.
+The table of contents (TOC) for this document updates automatically as long as you use the proper section labels.
+
+\subsection{A subsection}
+
+This is a subsection.
+This template currently features sections, subsections, and subsubsections (H1, H2, and H3).
+
+\subsubsection{A subsubsection}
+
+This is a subsubsection; this is the third level heading.
+
+This is an example of a basic table.
+
+\begin{center}
+\begin{tabular}{lll}
+ \large{\textbf{A}} & \large{\textbf{Header}} & \large{\textbf{Row}} \\ \hline
+ A & normal & row \\
+ A & normal & row \\
+ A & normal & row \\
+\end{tabular}
+\end{center}
+
+
+\section{This is another section}
+
+I like to put each sentence of a document on its own line.
+I think it makes it easier to edit the document later.
+\LaTeX ignores single line breaks and puts the sentences together into paragraphs.
+
+Include an empty line between sentences to start a new paragraph.
+Here are some examples of other writing elements you might want to use in a document.
+
+This is a bulleted list.
+
+\begin{itemize}
+ \item This
+ \item is
+ \item a
+ \item bulleted
+ \item list
+\end{itemize}
+
+This is a numbered list.
+
+\begin{enumerate}
+ \item This
+ \item is
+ \item a
+ \item numbered
+ \item list
+\end{enumerate}
+
+This is \textbf{bold} and this is \textit{italic} text.
+This is a \href{https://www.gitlab.com/jakevandervaate/latex-templates}{hyperlink to the repository that has this template}.
+
+\end{document}
diff --git a/article/commands.tex b/article/commands.tex
new file mode 100644
index 0000000..3ab9dbb
--- /dev/null
+++ b/article/commands.tex
@@ -0,0 +1,76 @@
+%%%%%%%%%%%%%%%%%%%%%%%%%
+% Non-numbered sections %
+%%%%%%%%%%%%%%%%%%%%%%%%%
+\titleformat{\section}
+[block] %shape of the text (options are hang, block, display, runin, leftmargin, rightmargin, drop, wrap and frame)
+{\LARGE\bfseries} %formatting for the text
+{} %section label. Any text placed in these brackets will precede the section title.
+{0em} %space between the labe and the text
+{} %code that precedes the text
+[\vspace{-.5em}] %code after the text
+
+\titleformat{\subsection}
+[block]
+{\Large\bfseries}
+{} %section label
+{0em}
+{}
+[\vspace{-.5em}]
+
+\titleformat{\subsubsection}
+[block]
+{\normalsize\bfseries}
+{} %section label
+{0em}
+{}
+[\vspace{-.5em}]
+
+%%%%%%%%%%%%%%%%%%%%%
+% Numbered sections %
+%%%%%%%%%%%%%%%%%%%%%
+%\titleformat{\section}
+%[block]
+%{\LARGE\bfseries}
+%{\thesection}
+%{1em}
+%{}
+%[\vspace{-.5em}]
+
+%\titleformat{\subsection}[block]
+%{\Large\bfseries}
+%{\thesubsection}
+%{1em}
+%{}
+%[\vspace{-.5em}]
+
+%\titleformat{\subsubsection}[block]
+%{\normalsize\bfseries}
+%{\thesubsubsection} %section label
+%{1em}
+%{}
+%[\vspace{-.5em}]
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% End of section numbering commands %
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+
+\setlength{\parskip}{1em} %The spacing between paragraphs
+\setlist{nosep} %Single-spacing in lists
+
+% Define the \maketitle command that creates the title page and TOC
+\renewcommand{\maketitle}{
+\sffamily %Set san serif font for body text
+{\Huge\bfseries
+\thetitle}
+
+{\huge\theauthor}
+
+{\Large\thedate}
+\newpage
+\setcounter{tocdepth}{3}
+\setcounter{secnumdepth}{0} %Change 0 to 3 to number the TOC
+\tableofcontents
+\newpage
+\raggedright
+}
diff --git a/article/packages.tex b/article/packages.tex
new file mode 100644
index 0000000..6a89ad6
--- /dev/null
+++ b/article/packages.tex
@@ -0,0 +1,19 @@
+\usepackage[margin=1.00in]{geometry} %Set page margins
+\usepackage{tabularx} %Enable more advanced tables than tabular
+\usepackage[T1]{fontenc} %Encode font for screen readers
+\usepackage{titlesec}
+\usepackage{hyperref}
+\usepackage[useregional]{datetime2}
+\usepackage{longtable,booktabs,array}
+\usepackage{calc}
+\usepackage{enumitem}
+\usepackage{graphicx}
+
+\input{glyphtounicode}
+\pdfgentounicode=1
+
+\usepackage{fancyhdr} %Page numbers, headers, and footers
+\pagestyle{fancy}
+\fancyhf{} %Clear all default header and footer
+\fancyfoot[R]{\thepage} %right aling the page number in the footer
+\renewcommand{\headrulewidth}{0pt} %Remove the package's default rule at the top of the page
diff --git a/pdf2png.sh b/pdf2png.sh
index 37c30b8..5628bdb 100755
--- a/pdf2png.sh
+++ b/pdf2png.sh
@@ -1,13 +1,31 @@
#!/bin/sh
#strip the file name off the input PDF
-file="$(ls ""$1"" | sed 's|\.pdf||g')"
+input_pdf="$1"
+file_name="$(find """$1""" | sed 's|\.pdf||g')"
+first_page="$2"
+last_page="$3"
+if [ "$2" = "" ]
+then
+ first_page="1"
+else
+ :
+fi
+
+if [ "$3" = "" ]
+then
+ last_page="$first_page"
+else
+ :
+fi
#convert the PDF to a 600px wide PNG image
-pdftoppm -singlefile -png -scale-to-x 696 -scale-to-y -1 "$1" "$file"
+pdftoppm -f "$first_page" -l "$last_page" -png -scale-to-x 696 -scale-to-y -1 "$input_pdf" "$file_name"
#add a 2x2px border to the image.png file
-convert "$file".png -bordercolor black -border 2x2 "$file".png
+for file in *.png; do
+ convert "$file" -bordercolor black -border 2x2 "$file"
-#compress the image
-optipng "$file".png
+ #compress the image
+ optipng "$file";
+done
diff --git a/resume/commands.tex b/resume/commands.tex
index a6d2897..3abc222 100644
--- a/resume/commands.tex
+++ b/resume/commands.tex
@@ -6,12 +6,14 @@ rightmargin=9pt,
itemsep=4pt
}
+
\titleformat{\section}
{\vspace{-4mm}\raggedright\LARGE\mdseries}
{}
{0em}
{\vspace{-8mm}\hrule}
+
%Entry for experience
\newcommand{\entry}[5]{
\vspace{-2mm} %top spacing
@@ -45,6 +47,7 @@ itemsep=4pt
\raggedright
}
+
%Coursework and descriptions
\newcommand{\course}[2]{
\normalsize{\textbf{#1}} \\
diff --git a/resume/packages.tex b/resume/packages.tex
index cf371cf..e2e5342 100644
--- a/resume/packages.tex
+++ b/resume/packages.tex
@@ -11,5 +11,5 @@
\usepackage[dvipsnames]{xcolor} %Allow the \color{name_of_color} command
\usepackage{enumitem} %Modify bullet spacing in lists
\usepackage{titlesec} %Change the section headings
-\input{glyphtounicode}
-\pdfgentounicode=1
+\input{glyphtounicode} %Ensure proper encoding
+\pdfgentounicode=1 %Ensure proper encoding
diff --git a/resume/resume.pdf b/resume/resume.pdf
index 86f3abb..f0f506f 100644
--- a/resume/resume.pdf
+++ b/resume/resume.pdf
Binary files differ
diff --git a/resume/resume.tex b/resume/resume.tex
index ac13228..9b44e49 100644
--- a/resume/resume.tex
+++ b/resume/resume.tex
@@ -4,14 +4,14 @@
\author{Your Name}
\date{The Date}
+\input{packages}
+\input{commands}
+
\newcommand{\email}{your.email@email.com}
\newcommand{\phone}{+1(111)111-1111}
\newcommand{\linkedin}{your-linkedin-slug} %slug (the last part) for url
\newcommand{\website}{yourwebsiteontheweb.com}
-\input{packages}
-\input{commands}
-
\hypersetup{
colorlinks=true, %"false" disables link colors
linkcolor=black, %links elsewhere in document
@@ -24,11 +24,8 @@ pdfkeywords={resume, cv}, %Populates PDF keyword metadata, separate with commans
}
-
-
-
\begin{document}
-\NumTabs{10}
+\NumTabs{10} %Allow use of the \tab command for alignment
\sffamily %Set san serif font for body text
\maketitle
@@ -52,8 +49,6 @@ pdfkeywords={resume, cv}, %Populates PDF keyword metadata, separate with commans
}
-
-
\section{Experience}
\entry
@@ -67,7 +62,6 @@ pdfkeywords={resume, cv}, %Populates PDF keyword metadata, separate with commans
\end{itemize}
}
-
\entry
{Name of Role}{Start Date -- End Date}
{Name of Company}{City, ST}
@@ -80,7 +74,6 @@ pdfkeywords={resume, cv}, %Populates PDF keyword metadata, separate with commans
}
-
\section{Projects}
\entry