Add Group 02 LaTeX manual source for peer review
This commit is contained in:
@@ -0,0 +1,89 @@
|
||||
\chapter{LaTeX Docker}
|
||||
\ChapterLabel{LaTeXDocker}
|
||||
|
||||
\section{Purpose}
|
||||
This activity uses a Docker container with TeX Live to compile a simple LaTeX
|
||||
document in a repeatable environment. The work was performed on the group's
|
||||
DigitalOcean Droplet.
|
||||
|
||||
\section{Project Files}
|
||||
The demonstration used two files in the
|
||||
\texttt{/root/latex-docker-demo} directory:
|
||||
|
||||
\begin{itemize}
|
||||
\item \texttt{Dockerfile} defines the TeX Live container image.
|
||||
\item \texttt{hello.tex} contains the sample LaTeX document.
|
||||
\end{itemize}
|
||||
|
||||
\section{Dockerfile}
|
||||
The following Dockerfile starts with Ubuntu, installs the TeX Live LaTeX
|
||||
package, and sets \texttt{pdflatex} as the container's default command.
|
||||
|
||||
\begin{minted}[fontsize=\small,breaklines,frame=single]{dockerfile}
|
||||
FROM ubuntu:24.04
|
||||
|
||||
RUN apt-get update \
|
||||
&& DEBIAN_FRONTEND=noninteractive apt-get install -y \
|
||||
--no-install-recommends texlive-latex-base \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
WORKDIR /work
|
||||
|
||||
CMD ["pdflatex", "-interaction=nonstopmode", "-halt-on-error", "hello.tex"]
|
||||
\end{minted}
|
||||
|
||||
\section{Sample LaTeX Document}
|
||||
The following source was saved as \texttt{hello.tex}. It creates a short PDF
|
||||
with a title and one sentence.
|
||||
|
||||
\begin{minted}[fontsize=\small,breaklines,frame=single,escapeinside=||]{latex}
|
||||
|\textbackslash|documentclass[12pt]{article}
|
||||
|
||||
\title{LaTeX Docker Demonstration}
|
||||
\author{SSW 590 Group 02}
|
||||
\date{\today}
|
||||
|
||||
\begin{document}
|
||||
\maketitle
|
||||
|
||||
This PDF was compiled by TeX Live inside a Docker container.
|
||||
|
||||
\end{document}
|
||||
\end{minted}
|
||||
|
||||
\section{Building the Docker Image}
|
||||
At the Droplet prompt, the following commands selected the demonstration
|
||||
directory and built the image:
|
||||
|
||||
\begin{minted}[fontsize=\small,breaklines,frame=single]{bash}
|
||||
cd /root/latex-docker-demo
|
||||
docker build -t ssw590-latex-demo .
|
||||
\end{minted}
|
||||
|
||||
\section{Compiling the LaTeX Document}
|
||||
The image was run as a temporary container. A bind mount saved the generated
|
||||
files in the Droplet directory, where they remained after the container
|
||||
stopped.
|
||||
|
||||
\begin{minted}[fontsize=\small,breaklines,frame=single]{bash}
|
||||
docker run --rm \
|
||||
--mount type=bind,source="$PWD",target=/work \
|
||||
ssw590-latex-demo
|
||||
|
||||
ls -lh hello.pdf
|
||||
\end{minted}
|
||||
|
||||
\section{Results}
|
||||
The container ran the LaTeX compiler and reported that its transcript was
|
||||
written to \texttt{hello.log}. The file check showed \texttt{hello.pdf} in
|
||||
the demonstration directory with a size of approximately 27 KB. This
|
||||
confirmed that the sample document was compiled into a PDF on the Droplet.
|
||||
|
||||
\section{Cleanup}
|
||||
The \texttt{--rm} option removed the container after it stopped. The image
|
||||
and demonstration files were retained. If the image is no longer needed,
|
||||
it can be removed with:
|
||||
|
||||
\begin{minted}[fontsize=\small,breaklines,frame=single]{bash}
|
||||
docker image rm ssw590-latex-demo
|
||||
\end{minted}
|
||||
Reference in New Issue
Block a user