diff --git a/devopsAssignment.tex b/devopsAssignment.tex index dcd2ce3..ae58503 100644 --- a/devopsAssignment.tex +++ b/devopsAssignment.tex @@ -22,6 +22,7 @@ \usepackage{makeidx} \usepackage[colorlinks=true,citecolor=blue,linkcolor=blue,urlcolor=blue]{hyperref} \usepackage[acronym,toc]{glossaries} +\usepackage{minted} \makeindex \makeglossaries diff --git a/latexDocker.tex b/latexDocker.tex index 75c67f5..8c2be81 100644 --- a/latexDocker.tex +++ b/latexDocker.tex @@ -1,3 +1,49 @@ \chapter{LaTeX Docker} \ChapterLabel{LatexDocker} +To compile a LaTeX file through a Docker container, the first step was to create a Dockerfile. Using the texlive and latexmk frameworks, we created this Dockerfile: + +\begin{minted}{javascript} + +FROM debian:bookworm-slim + +ENV DEBIAN_FRONTEND=noninteractive + +RUN apt-get update && apt-get install -y --no-install-recommends \ + texlive-latex-base \ + texlive-latex-recommended \ + texlive-latex-extra \ + texlive-fonts-recommended \ + latexmk \ + && rm -rf /var/lib/apt/lists/* + +WORKDIR /data + +CMD ["latexmk", "-pdf", "main.tex"] + +\end{minted} + +The file uses a lightweight Debian base to install the requird tools from texlive and latexmk. From there, it establishes /data as the working directory of the container, and runs a command to compile a LaTeX file named "main.tex". + +\newpage + +From there, we build the container by placing the Dockerfile inside the directory of the LaTeX project and running: + +\begin{minted}{bash} +docker build -t my-latex-compiler . +\end{minted} + +This sets up the container, named "my-latex-compiler" for use. To start the container and compile the LaTeX project, we run: + +\begin{minted}{bash} +docker run --rm -v "$(pwd):/data" my-latex-compiler +\end{minted} + +Once the command runs, a main.pdf file is created inside the LaTeX project directory, containing the compiled project. To test this, we ran the container on a barebones sample document containing some text, an image, and a table. The compiler created an identical result to downloading the document as a pdf from Overleaf, proving its success. The only downsides are that the primary .tex file of the project being compiled must be named main.tex, and that LaTeX errors that Overleaf can still compile through cannot be ignored by our compiler. These can be overcome by changing the expected name in the Dockerfile and being more thorough in error fixing when manually editing the LaTeX. + +\begin{figure}[hbt!] + \centering + \includegraphics[width=1\linewidth]{sample.pdf} + \caption{The pdf result of the Docker compiler on our sample document, with whitespace cropped out for readability.} + \label{fig:placeholder} +\end{figure} \ No newline at end of file diff --git a/linuxCommands.tex b/linuxCommands.tex index 8a37759..cefa361 100644 --- a/linuxCommands.tex +++ b/linuxCommands.tex @@ -315,21 +315,6 @@ \newpage \section{Bash and Scripting} - -\begin{figure}[hbt!] - \centering - \includegraphics[width=1\linewidth]{linux/image37.png} - \caption{One-liner that loops over *.txt in src.} - \label{fig:img38} -\end{figure} - -\begin{figure}[hbt!] - \centering - \includegraphics[width=1\linewidth]{linux/image38.png} - \caption{Command that exports csv rows where dept == "CS" to cs.txt.} - \label{fig:img39} -\end{figure} - \begin{figure}[hbt!] \centering \includegraphics[width=1\linewidth]{linux/image39.png} diff --git a/prologue.tex b/prologue.tex index a3d604e..d4c5345 100644 --- a/prologue.tex +++ b/prologue.tex @@ -18,7 +18,9 @@ This DevOps assignment template was developed by \textbf{Darian Muresan, Ph.D.}, in conjunction with \textbf{OpenAI Codex} and \textbf{Anthropic Claude Code}. \clearpage -\begin{abstract}\input{abstract.tex}\end{abstract} +\begin{abstract} +\input{abstract.tex} +\end{abstract} \input{devopsDocumentHistory.tex} \contentspage \tablelistpage diff --git a/sample.pdf b/sample.pdf new file mode 100644 index 0000000..95123fd Binary files /dev/null and b/sample.pdf differ