sync with kladjes and update template

This commit is contained in:
Laila van Reenen 2025-02-16 22:46:04 +01:00
parent f1a691296b
commit 8ea8614fe5
Signed by: LailaTheElf
GPG Key ID: 8A3EF0226518C12D
2 changed files with 148 additions and 106 deletions

View File

@ -1,7 +1,8 @@
MD_FILE="$1"
TEX_FILE="$2"
BUILD_DIR="$3"
BASE_DIR="$(pwd)"
TEX_FILE="${BASE_DIR}/latex/$(basename "$MD_FILE" | sed -e 's/\.md$/.latex/')"
BUILD_DIR="${BASE_DIR}/build/$(basename "$MD_FILE" | sed -e 's/\.md$//')"
TEMP_MD_FILE="$BUILD_DIR/$(basename "$MD_FILE")"
TEMP_TEX_FILE="$BUILD_DIR/$(basename "$MD_FILE" | sed -e 's|md$|latex|')"
mkdir -p "$(dirname "$TEMP_MD_FILE")"
@ -13,111 +14,14 @@ cat "$MD_FILE" | sed \
-e 's|^\[parent\].*$||' \
-e 's|^# .*$||' \
-e 's|^#||' \
-e 's|^# |\\newpage\n# |' \
-e 's|\[\([^]]*\)\](#\([^)]*\))|[\1](#\L\2)|' \
>"$TEMP_MD_FILE"
CUR_DIR="$(pwd)"
cd "$BUILD_DIR"
pandoc --to=latex -o "$(basename "$TEMP_TEX_FILE")" "$(basename "$TEMP_MD_FILE")"
cd "$CUR_DIR"
pandoc --to=latex --template "${BASE_DIR}/converters/template.latex" -o "$TEX_FILE" "$(basename "$TEMP_MD_FILE")"
cd "$BASE_DIR"
cat >"$TEX_FILE" <<EOF
\documentclass[11pt]{article}
\usepackage[a4paper, portrait, includehead, includefoot, margin=1.5cm]{geometry}
% \usepackage[dutch]{babel}
\usepackage{pdfpages}
\usepackage{xcolor}
\usepackage{makecell}
\usepackage{tabularx}
\usepackage{adjustbox}
\usepackage{longtable}
\providecommand{\tightlist}{\setlength{\itemsep}{0pt}\setlength{\parskip}{0pt}}
\usepackage{booktabs}
\usepackage{fontspec}
\usepackage{xunicode}
\usepackage{xltxtra}
\usepackage[sfdefault]{roboto}
\newfontfamily\fontUbuntu[]{Ubuntu}
% \usepackage[none]{ubuntu}
% \usepackage[style=ieee]{biblatex}
% \usepackage{csquotes}
% \addbibresource{bibliography.bib}
% header and footer
\usepackage{fancyhdr}
\renewcommand{\headrule}{}
\usepackage[nodayofweek]{datetime}
\definecolor{darkishyellow}{rgb}{177, 179, 173}
% for images
\usepackage{graphbox}
% add bookmarks with \hypertarget
% \usepackage{bookmark}
% \usepackage{hyperref}
% heading numberging
\setcounter{secnumdepth}{3}
\renewcommand\thesection{{\fontUbuntu\arabic{section}}}
\renewcommand\thesubsection{{\fontUbuntu\arabic{section}.\arabic{subsection}}}
\renewcommand\thesubsubsection{{\fontUbuntu\arabic{section}.\arabic{subsection}.\arabic{subsubsection}}}
\usepackage{sectsty}
\allsectionsfont{\fontUbuntu}
\setlength{\headheight}{14pt}
% no indent at paragraphs
\usepackage{parskip}
\usepackage{setspace}
\setstretch{1.1}
\let\tmpitem\itemize
\let\tmpenditem\enditemize
\renewenvironment{itemize}{\tmpitem\setlength\itemsep{-.4em}}{\tmpenditem}
\begin{document}
\raggedright
\pagecolor{darkishyellow}
\begin{titlepage}
\null\vfill
\begin{center}
{\Huge\fontUbuntu $title \par}
\vskip 3em
% \includegraphics{assets/eriks.50.png}
\vskip 3em
{\huge\fontUbuntu Formula Student \par}
\end{center}
\vskip 25em
{
\large
\lineskip .75em
\begin{tabular}{r l}
gemaakt door: & ... (...) \\\\
klas: & ... \\\\
vak code: & ELEPEE51 \\\\
ge\\"exporteerd op: & \today
\end{tabular}
}
\vfill\null
\end{titlepage}
\pagestyle{fancy}
\fancyhead{} % clear all header fields
\fancyhead[LO]{\color{gray}\fontUbuntu $title}
\fancyhead[RO]{\color{gray}\fontUbuntu Formula Student}
\fancyfoot{} % clear all footer fields
\fancyfoot[LO]{\color{gray}\fontUbuntu ...}
\fancyfoot[CO]{\color{gray}\fontUbuntu Hoogeschool Rotterdam}
\fancyfoot[RO]{\color{gray}\fontUbuntu pagina \thepage}
EOF
cat "$TEMP_TEX_FILE" >>"$TEX_FILE"
cat >>"$TEX_FILE" <<EOF
\end{document}
EOF
sed --in-place \
-e "s|\*title\*|$title|" \
"$TEX_FILE"

138
converters/template.latex Normal file
View File

@ -0,0 +1,138 @@
\documentclass[11pt]{article}
\usepackage[a4paper, portrait, includehead, includefoot, margin=1.5cm]{geometry}
\usepackage[dutch]{babel}
\usepackage{pdfpages}
\usepackage{xcolor}
\usepackage{makecell}
\usepackage{tabularx}
\usepackage{adjustbox}
\usepackage{framed}
\usepackage{longtable}
\providecommand{\tightlist}{\setlength{\itemsep}{0pt}\setlength{\parskip}{0pt}}
\usepackage{booktabs}
\usepackage{fontspec}
\usepackage{xunicode}
\usepackage{xltxtra}
\usepackage[sfdefault]{roboto}
\newfontfamily\fontUbuntu[]{Ubuntu}
% \usepackage[none]{ubuntu}
% \usepackage[style=ieee]{biblatex}
% \usepackage{csquotes}
% \addbibresource{bibliography.bib}
% header and footer
\usepackage{fancyhdr}
\renewcommand{\headrule}{}
\usepackage[nodayofweek]{datetime}
\definecolor{darkishyellow}{rgb}{177, 179, 173}
% for images
\usepackage{graphbox}
% add bookmarks with \hypertarget
\usepackage{bookmark}
\usepackage{hyperref}
% heading numberging
\setcounter{secnumdepth}{3}
\renewcommand\thesection{{\fontUbuntu\arabic{section}}}
\renewcommand\thesubsection{{\fontUbuntu\arabic{section}.\arabic{subsection}}}
\renewcommand\thesubsubsection{{\fontUbuntu\arabic{section}.\arabic{subsection}.\arabic{subsubsection}}}
\usepackage{sectsty}
\allsectionsfont{\fontUbuntu}
\setlength{\headheight}{14pt}
% no indent at paragraphs
\usepackage{parskip}
\usepackage{setspace}
\setstretch{1.1}
\let\tmpitem\itemize
\let\tmpenditem\enditemize
\renewenvironment{itemize}{\tmpitem\setlength\itemsep{-.4em}}{\tmpenditem}
\begin{document}
\raggedright
\pagecolor{darkishyellow}
\begin{titlepage}
\null\vfill
\begin{center}
{\Huge\fontUbuntu *title* \par}
\vskip 3em
% \includegraphics{assets/eriks.50.png}
\vskip 3em
{\huge\fontUbuntu Superlight Personal Carrier \par}
\end{center}
\vskip 25em
{
\large
\lineskip .75em
\begin{tabular}{r l}
gemaakt door: & Finley van Reenen (0964590@hr.nl) \\
& Gryvon Belfor (0985890@hr.nl) \\
& Chris Tan (0992143@hr.nl) \\
& Mohamed El Morabiti (1014780@hr.nl) \\\\
vak code: & ELEPEE51 \\\\
ge\"exporteerd op: & \today
\end{tabular}
}
\vfill\null
\end{titlepage}
\pagestyle{fancy}
\fancyhead{} % clear all header fields
\fancyhead[LO]{\color{gray}\fontUbuntu *title*}
\fancyhead[RO]{\color{gray}\fontUbuntu Superlight Personal Carrier}
\fancyfoot{} % clear all footer fields
\fancyfoot[LO]{\color{gray}\fontUbuntu ...}
\fancyfoot[CO]{\color{gray}\fontUbuntu Hoogeschool Rotterdam}
\fancyfoot[RO]{\color{gray}\fontUbuntu pagina \thepage}
$if(lof)$
\listoffigures
$endif$
$if(lot)$
\listoftables
$endif$
$if(linestretch)$
\setstretch{$linestretch$}
$endif$
$body$
$if(nocite-ids)$
\nocite{$for(nocite-ids)$$it$$sep$, $endfor$}
$endif$
$if(natbib)$
$if(bibliography)$
$if(biblio-title)$
$if(has-chapters)$
\renewcommand\bibname{$biblio-title$}
$else$
\renewcommand\refname{$biblio-title$}
$endif$
$endif$
\bibliography{$for(bibliography)$$bibliography$$sep$,$endfor$}
$endif$
$endif$
$if(biblatex)$
\printbibliography$if(biblio-title)$[title=$biblio-title$]$endif$
$endif$
\end{document}