Skip to content

Commit 8e1cbe2

Browse files
committed
First push
Add `Dockerfile` for building the `wsams/latex` image. Add `README.md` and sample shell script for compiling the `README.md` into a PDF document.
0 parents  commit 8e1cbe2

File tree

4 files changed

+161
-0
lines changed

4 files changed

+161
-0
lines changed

.gitignore

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
*.pdf
2+
*.out
3+
*.aux

Dockerfile

+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# Sample usage:
2+
#
3+
# docker run --rm -v $(pwd):/work wsams/latex bash \
4+
# -c 'cd /work && pandoc -s resume.md -o resume.tex && \
5+
# pdflatex resume.tex'
6+
#
7+
# Sample build command:
8+
#
9+
# docker build -t wsams/latex --pull .
10+
11+
FROM debian:bullseye
12+
13+
ENV DEBIAN_FRONTEND noninteractive
14+
15+
USER root
16+
17+
RUN apt-get update && \
18+
apt-get install -y git \
19+
vim \
20+
wget \
21+
curl \
22+
zip \
23+
unzip \
24+
make \
25+
pandoc \
26+
pandoc-citeproc \
27+
pandoc-sidenote \
28+
python3-pygments \
29+
fig2dev \
30+
texlive \
31+
texlive-fonts-recommended \
32+
texlive-latex-recommended \
33+
texlive-latex-extra && \
34+
apt-get clean -y
35+
36+
WORKDIR /work
37+

README.md

+105
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
1+
# wsams/latex \LaTeX environment
2+
3+
This image was created to provide a consistent \LaTeX environment. It also provides the `pandoc` tool for converting documents into various types. For example, this `README.md` document can be converted into \LaTeX and then further a PDF document. Give it a try,
4+
5+
```
6+
./compile-document.sh README
7+
```
8+
9+
The command above should produce a `README.pdf`. The script is just running the following Docker command,
10+
11+
```
12+
docker run --rm -v $(pwd):/work wsams/latex bash \
13+
-c "cd /work && \
14+
pandoc -s README.md -o README.tex && \
15+
pdflatex README.tex"
16+
```
17+
18+
If you just want to convert a `resume.tex` document into a PDF using `pdflatex` you can run the following,
19+
20+
```
21+
docker run --rm -v $(pwd):/work wsams/latex bash \
22+
-c "cd /work && pdflatex resume.tex"
23+
```
24+
25+
Of course you can do anything possible with the `texlive` packages. Below is a list currently available in `debian:bullseye`. Below the list is an example if you want to build your own custom image.
26+
27+
```
28+
These are all of the packages available in debian:bullseye
29+
30+
texlive - TeX Live: A decent selection of the TeX Live packages
31+
texlive-base - TeX Live: Essential programs and files
32+
texlive-fonts-recommended - TeX Live: Recommended fonts
33+
texlive-fonts-recommended-doc - TeX Live: Documentation files for texlive-fonts-recommended
34+
texlive-full - TeX Live: metapackage pulling in all components of TeX Live
35+
texlive-latex-base - TeX Live: LaTeX fundamental packages
36+
texlive-latex-base-doc - TeX Live: Documentation files for texlive-latex-base
37+
texlive-latex-recommended - TeX Live: LaTeX recommended packages
38+
texlive-latex-recommended-doc - TeX Live: Documentation files for texlive-latex-recommended
39+
texlive-luatex - TeX Live: LuaTeX packages
40+
texlive-metapost - TeX Live: MetaPost and Metafont packages
41+
texlive-metapost-doc - TeX Live: Documentation files for texlive-metapost
42+
texlive-pictures - TeX Live: Graphics, pictures, diagrams
43+
texlive-pictures-doc - TeX Live: Documentation files for texlive-pictures
44+
texlive-xetex - TeX Live: XeTeX and packages
45+
texlive-binaries - Binaries for TeX Live
46+
texlive-bibtex-extra - TeX Live: BibTeX additional styles
47+
texlive-extra-utils - TeX Live: TeX auxiliary programs
48+
texlive-font-utils - TeX Live: Graphics and font utilities
49+
texlive-fonts-extra - TeX Live: Additional fonts
50+
texlive-fonts-extra-doc - TeX Live: Documentation files for texlive-fonts-extra
51+
texlive-fonts-extra-links - TeX Live:
52+
texlive-formats-extra - TeX Live: Additional formats
53+
texlive-games - TeX Live: Games typesetting
54+
texlive-humanities - TeX Live: Humanities packages
55+
texlive-humanities-doc - TeX Live: Documentation files for texlive-humanities
56+
texlive-latex-extra - TeX Live: LaTeX additional packages
57+
texlive-latex-extra-doc - TeX Live: Documentation files for texlive-latex-extra
58+
texlive-music - TeX Live: Music packages
59+
texlive-plain-generic - TeX Live: Plain (La)TeX packages
60+
texlive-pstricks - TeX Live: PSTricks
61+
texlive-pstricks-doc - TeX Live: Documentation files for texlive-pstricks
62+
texlive-publishers - TeX Live: Publisher styles, theses, etc.
63+
texlive-publishers-doc - TeX Live: Documentation files for texlive-publishers
64+
texlive-science - TeX Live: Mathematics, natural sciences, computer science packages
65+
texlive-science-doc - TeX Live: Documentation files for texlive-science
66+
texlive-lang-all - TeX Live: metapackage depending on all TeX Live language packages
67+
texlive-lang-arabic - TeX Live: Arabic
68+
texlive-lang-chinese - TeX Live: Chinese
69+
texlive-lang-cjk - TeX Live: Chinese/Japanese/Korean (base)
70+
texlive-lang-cyrillic - TeX Live: Cyrillic
71+
texlive-lang-czechslovak - TeX Live: Czech/Slovak
72+
texlive-lang-english - TeX Live: US and UK English
73+
texlive-lang-european - TeX Live: Other European languages
74+
texlive-lang-french - TeX Live: French
75+
texlive-lang-german - TeX Live: German
76+
texlive-lang-greek - TeX Live: Greek
77+
texlive-lang-italian - TeX Live: Italian
78+
texlive-lang-japanese - TeX Live: Japanese
79+
texlive-lang-korean - TeX Live: Korean
80+
texlive-lang-other - TeX Live: Other languages
81+
texlive-lang-polish - TeX Live: Polish
82+
texlive-lang-portuguese - TeX Live: Portuguese
83+
texlive-lang-spanish - TeX Live: Spanish
84+
```
85+
86+
Create your own `Dockerfile` with the following contents. In this example we'll install the `texlive-music` package.
87+
88+
```
89+
FROM wsams/latex
90+
91+
RUN apt-get update && \
92+
apt-get install -y texlive-music && \
93+
apt-get clean -y
94+
```
95+
96+
Now build your image,
97+
98+
```
99+
docker build -t music-latex --pull .
100+
```
101+
102+
Once your new `music-latex` image is built you can [begin creating beautiful sheetmusic](https://packages.debian.org/sid/texlive-music). The commands will be similar to the previous examples.
103+
104+
Have fun!
105+

compile-document.sh

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#!/bin/bash
2+
3+
if [ -z $1 ]; then
4+
echo "This script accepts a Markdown document and produces a PDF document."
5+
echo "Usage: ./compile-resume <markdown document name without .md extension>"
6+
exit
7+
fi
8+
9+
document=$1
10+
11+
trap "rm ${document}.aux ${document}.log ${document}.out ${document}.tex" 0
12+
13+
docker run --rm -v $(pwd):/work wsams/latex bash \
14+
-c "cd /work && \
15+
pandoc -s ${document}.md -o ${document}.tex && \
16+
pdflatex ${document}.tex"

0 commit comments

Comments
 (0)