Skip to content

Commit e715b1d

Browse files
committed
Change source tree structure and add Makefile
- This also drops the dependence on Charis SIL font, polyglossia, and therefore the requirement to compile with luatex or xetex. We use latex or pdflatex in the makefile now... simply type: make to compile the latest manuscript
1 parent f5a4cc2 commit e715b1d

File tree

4 files changed

+188
-19
lines changed

4 files changed

+188
-19
lines changed

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
revision.tex
2+
bash-workshop.out
3+
bash-workshop.toc
4+
bash-workshop.pdf
5+
bash-workshop.log

Makefile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
TARGET=bash-workshop
2+
include Makefile.include

Makefile.include

Lines changed: 164 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,164 @@
1+
###
2+
### generic GNU make Makefile for .tex -> .pdf.
3+
### ransford at cs.washington.edu
4+
### http://github.com/ransford/pdflatex-makefile
5+
###
6+
### Recommended usage:
7+
### 1. echo 'include Makefile.include' > Makefile
8+
### 2. Optional: Edit the Makefile to override $(TARGET)
9+
### and anything else (e.g., PDFVIEWER, AFTERALL)
10+
###
11+
### Final result:
12+
### % cat Makefile
13+
### TARGET=mypaper
14+
### PDFVIEWER=open -a 'Adobe Acrobat Professional'
15+
### AFTERALL=mypostprocessingstep
16+
### include Makefile.include
17+
###
18+
### mypostprocessingstep:
19+
### # do something...
20+
###
21+
22+
PDFLATEX ?= pdflatex -halt-on-error -file-line-error
23+
BIBTEX ?= bibtex
24+
25+
ifneq ($(QUIET),)
26+
PDFLATEX += -interaction=batchmode
27+
ERRFILTER := > /dev/null || (egrep ':[[:digit:]]+:' *.log && false)
28+
BIBTEX += -terse
29+
else
30+
PDFLATEX += -interaction=nonstopmode
31+
ERRFILTER=
32+
endif
33+
34+
## Action for 'make view'
35+
OS=$(shell uname -s)
36+
ifeq ($(OS),Darwin)
37+
PDFVIEWER ?= open
38+
else
39+
PDFVIEWER ?= xdg-open
40+
endif
41+
42+
## Name of the target file, minus .pdf: e.g., TARGET=mypaper causes this
43+
## Makefile to turn mypaper.tex into mypaper.pdf.
44+
TARGETS += $(TARGET)
45+
TEXTARGETS = $(TARGETS:=.tex)
46+
PDFTARGETS = $(TARGETS:=.pdf)
47+
AUXFILES = $(TARGETS:=.aux)
48+
LOGFILES = $(TARGETS:=.log)
49+
50+
## If $(TARGET).tex refers to .bib files like \bibliography{foo,bar}, then
51+
## $(BIBFILES) will contain foo.bib and bar.bib, and both files will be added as
52+
## dependencies to $(PDFTARGETS).
53+
## Effect: updating a .bib file will trigger re-typesetting.
54+
BIBFILES = $(patsubst %,%.bib,\
55+
$(shell grep '^[^%]*\\bibliography{' $(TEXTARGETS) | \
56+
grep -o '\\bibliography{[^}]\+}' | \
57+
sed -e 's/^[^%]*\\bibliography{\([^}]*\)}.*/\1/' \
58+
-e 's/, */ /g'))
59+
60+
## Add \input'ed or \include'd files to $(PDFTARGETS) dependencies; ignore
61+
## .tex extensions.
62+
INCLUDEDTEX = $(patsubst %,%.tex,\
63+
$(shell grep '^[^%]*\\\(input\|include\){' $(TEXTARGETS) | \
64+
grep -o '\\\(input\|include\){[^}]\+}' | \
65+
sed -e 's/^.*{\([^}]*\)}.*/\1/' \
66+
-e 's/\.tex$$//'))
67+
68+
AUXFILES += $(INCLUDEDTEX:.tex=.aux)
69+
70+
## grab a version number from the repository (if any) that stores this.
71+
## * REVISION is the current revision number (short form, for inclusion in text)
72+
## * VCSTURD is a file that gets touched after a repo update
73+
SPACE = $(empty) $(empty)
74+
ifeq ($(shell git status >/dev/null 2>&1 && echo USING_GIT),USING_GIT)
75+
ifeq ($(shell git svn info >/dev/null 2>&1 && echo USING_GIT_SVN),USING_GIT_SVN)
76+
# git-svn
77+
REVISION := $(shell git svn find-rev git-svn)
78+
VCSTURD := $(subst $(SPACE),\ ,$(shell git rev-parse --git-dir)/refs/remotes/git-svn)
79+
else
80+
# plain git
81+
REVISION := $(shell git rev-parse --short HEAD)
82+
GIT_BRANCH := $(shell git symbolic-ref HEAD 2>/dev/null)
83+
VCSTURD := $(subst $(SPACE),\ ,$(shell git rev-parse --git-dir)/$(GIT_BRANCH))
84+
endif
85+
else ifeq ($(shell hg root >/dev/null 2>&1 && echo USING_HG),USING_HG)
86+
# mercurial
87+
REVISION := $(shell hg id -i)
88+
VCSTURD := $(subst $(SPACE),\ ,$(shell hg root)/.hg/dirstate)
89+
else ifneq ($(wildcard .svn/entries),)
90+
# subversion
91+
REVISION := $(subst :,-,$(shell svnversion -n))
92+
VCSTURD := .svn/entries
93+
endif
94+
95+
# .PHONY names all targets that aren't filenames
96+
.PHONY: all clean pdf view snapshot distill distclean
97+
98+
all: pdf $(AFTERALL)
99+
100+
pdf: $(PDFTARGETS)
101+
102+
view: $(PDFTARGETS)
103+
$(PDFVIEWER) $(PDFTARGETS)
104+
105+
# define a \Revision{} command you can include in your document's preamble.
106+
# especially useful with e.g. draftfooter.sty or fancyhdr.
107+
# usage: \input{revision}
108+
# ... \Revision{}
109+
ifneq ($(REVISION),)
110+
REVDEPS += revision.tex
111+
revision.tex: $(VCSTURD)
112+
/bin/echo '\newcommand{\Revision}'"{$(REVISION)}" > $@
113+
AUXFILES += revision.aux
114+
endif
115+
116+
# to generate aux but not pdf from pdflatex, use -draftmode
117+
.INTERMEDIATE: $(AUXFILES)
118+
%.aux: %.tex $(REVDEPS)
119+
$(PDFLATEX) -draftmode $* $(ERRFILTER)
120+
121+
# introduce BibTeX dependency if we found a \bibliography
122+
ifneq ($(strip $(BIBFILES)),)
123+
BIBDEPS = %.bbl
124+
%.bbl: %.aux $(BIBFILES)
125+
$(BIBTEX) $*
126+
endif
127+
128+
$(PDFTARGETS): %.pdf: %.tex %.aux $(BIBDEPS) $(INCLUDEDTEX) $(REVDEPS)
129+
$(PDFLATEX) $* $(ERRFILTER)
130+
ifneq ($(strip $(BIBFILES)),)
131+
@if egrep -q "undefined (references|citations)" $*.log; then \
132+
$(BIBTEX) $* && $(PDFLATEX) $* $(ERRFILTER); fi
133+
endif
134+
@while grep -q "Rerun to" $*.log; do \
135+
$(PDFLATEX) $* $(ERRFILTER); done
136+
137+
DRAFTS := $(PDFTARGETS:.pdf=-$(REVISION).pdf)
138+
$(DRAFTS): %-$(REVISION).pdf: %.pdf
139+
cp $< $@
140+
snapshot: $(DRAFTS)
141+
142+
%.distilled.pdf: %.pdf
143+
gs -q -dSAFER -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -sOutputFile=$@ \
144+
-dCompatibilityLevel=1.5 -dPDFSETTINGS=/prepress -c .setpdfwrite -f $<
145+
exiftool -overwrite_original -Title="" -Creator="" -CreatorTool="" $@
146+
147+
distill: $(PDFTARGETS:.pdf=.distilled.pdf)
148+
149+
distclean: clean
150+
$(RM) $(PDFTARGETS) $(PDFTARGETS:.pdf=.distilled.pdf) $(EXTRADISTCLEAN)
151+
152+
clean:
153+
$(RM) $(foreach T,$(TARGETS), \
154+
$(T).bbl $(T).bcf $(T).bit $(T).blg \
155+
$(T)-blx.bib $(T).brf $(T).glo $(T).glx \
156+
$(T).gxg $(T).gxs $(T).idx $(T).ilg \
157+
$(T).ind $(T).loa $(T).lof $(T).lol \
158+
$(T).lot $(T).maf $(T).mtc $(T).nav \
159+
$(T).out $(T).pag $(T).run.xml $(T).snm \
160+
$(T).svn $(T).tdo $(T).tns $(T).toc \
161+
$(T).vtc $(T).url) \
162+
$(REVDEPS) $(AUXFILES) $(LOGFILES) \
163+
$(EXTRACLEAN)
164+
Lines changed: 17 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,7 @@
1212
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1313

1414
\documentclass[a4paper]{scrreprt}
15-
\usepackage{polyglossia}
16-
\setmainlanguage{english}
17-
\setmainfont{Charis SIL}
15+
\usepackage[english]{babel}
1816

1917
\usepackage{tabu}
2018
\usepackage{longtable}
@@ -35,7 +33,7 @@
3533
\vspace{2cm}
3634
{\LARGE Dimitri Robl\par}
3735
\vspace{1cm}
38-
\includegraphics[scale=0.6]{../pictures/xkcd456.png}
36+
\includegraphics[scale=0.6]{pictures/xkcd456.png}
3937
\newline
4038
{CC BY-NC 2.5 by Rendall Monroe\\
4139
\href{https://creativecommons.org/licenses/by-nc/2.5/legalcode}
@@ -127,15 +125,15 @@ \section{Installing a Virtual Machine Running Debian GNU/Linux}
127125
\item Open VirtualBox.
128126
\item Click on the ``New" button in the upper left corner.
129127
\begin{center}
130-
\includegraphics[scale=0.35]{../pictures/install_vm01.png}
128+
\includegraphics[scale=0.35]{pictures/install_vm01.png}
131129
\end{center}
132130
\item Enter a name for your VM, and if this is not automatically
133131
done select \emph{Type:} → \emph{Linux}, and \emph{Version:} →
134132
\emph{Debian (64-bit)}.\footnote{If you use a different
135133
rchitecture than x86\_64 you have to specify this here as well.}
136134
Press ``Next".
137135
\begin{center}
138-
\includegraphics[scale=0.40]{../pictures/install_vm02.png}
136+
\includegraphics[scale=0.40]{pictures/install_vm02.png}
139137
\end{center}
140138
\item Select the amount of memory the VM will have. The best
141139
value here depends on what you want to do with the VM and how
@@ -144,24 +142,24 @@ \section{Installing a Virtual Machine Running Debian GNU/Linux}
144142
if you want and less if you are very low on physical RAM (i.e.
145143
2GiB or less).
146144
\begin{center}
147-
\includegraphics[scale=0.40]{../pictures/install_vm03.png}
145+
\includegraphics[scale=0.40]{pictures/install_vm03.png}
148146
\end{center}
149147
\item Choose how much disk space to give to your VM. This includes
150148
several steps:
151149
\begin{enumerate}
152150
\item Select ``Create a virtual hard disk now" and press ``Create".
153151
\begin{center}
154-
\includegraphics[scale=0.40]{../pictures/install_vm04.png}
152+
\includegraphics[scale=0.40]{pictures/install_vm04.png}
155153
\end{center}
156154
\item Leave ``VDI (VirtualBox Disk image)" selected and press
157155
``Next".
158156
\begin{center}
159-
\includegraphics[scale=0.40]{../pictures/install_vm05.png}
157+
\includegraphics[scale=0.40]{pictures/install_vm05.png}
160158
\end{center}
161159
\item Again go with the default ``Dynamically allocated" and
162160
and press ``Next".
163161
\begin{center}
164-
\includegraphics[scale=0.40]{../pictures/install_vm06.png}
162+
\includegraphics[scale=0.40]{pictures/install_vm06.png}
165163
\end{center}
166164
\item You can now change name and location of the file that
167165
will be the VM's harddisk. If this sounds confusing: What the
@@ -176,21 +174,21 @@ \section{Installing a Virtual Machine Running Debian GNU/Linux}
176174

177175
After you are done, click on ``Create".
178176
\begin{center}
179-
\includegraphics[scale=0.40]{../pictures/install_vm07.png}
177+
\includegraphics[scale=0.40]{pictures/install_vm07.png}
180178
\end{center}
181179
\end{enumerate}
182180
\item Now you're back to the main screen, which should look
183181
something like this:
184182
\begin{center}
185-
\includegraphics[scale=0.40]{../pictures/install_vm08.png}
183+
\includegraphics[scale=0.40]{pictures/install_vm08.png}
186184
\end{center}
187185
Select you newly created VM and press ``Start".
188186
\item A pop-up should appear which asks you to select a start-up
189187
disk. Click on the folder icon and select the Debian GNU/Linux
190188
ISO-file you downloaded earlier (and whose download location you
191189
should remember ;)).
192190
\begin{center}
193-
\includegraphics[scale=0.50]{../pictures/install_vm09.png}
191+
\includegraphics[scale=0.50]{pictures/install_vm09.png}
194192
\end{center}
195193
Press the ``Start" button.
196194
\end{enumerate}
@@ -207,7 +205,7 @@ \section{Installing a Virtual Machine Running Debian GNU/Linux}
207205
blank to disable the \texttt{root} account and use \texttt{sudo}
208206
instead. We'll discuss the details later.
209207
\begin{center}
210-
\includegraphics[scale=0.35]{../pictures/install_vm10.png}
208+
\includegraphics[scale=0.35]{pictures/install_vm10.png}
211209
\end{center}
212210
\item If you don't know about disk partitioning leave the defaults
213211
intact. However, in case you install Debian GNU/Linux on real
@@ -241,15 +239,15 @@ \section{Installing a Virtual Machine Running Debian GNU/Linux}
241239
in the description \texttt{ftp.at.debian.org} is usually a good
242240
choice.
243241
\begin{center}
244-
\includegraphics[scale=0.40]{../pictures/install_vm11.png}
245-
\includegraphics[scale=0.40]{../pictures/install_vm12.png}
242+
\includegraphics[scale=0.40]{pictures/install_vm11.png}
243+
\includegraphics[scale=0.40]{pictures/install_vm12.png}
246244
\end{center}
247245
\item Once you come to the screen ``Software selection" we recommend
248246
selecting ``Xfce" or ``LXDE" if the VM is on low memory ( <
249247
2GiB), as these are very light weight GUIs. Otherwise you can
250248
stick with the default ``Debian desktop environment".
251249
\begin{center}
252-
\includegraphics[scale=0.35]{../pictures/install_vm13.png}
250+
\includegraphics[scale=0.35]{pictures/install_vm13.png}
253251
\end{center}
254252
\end{enumerate}
255253
If you run into any problems, use your favorite search engine and
@@ -545,7 +543,7 @@ \section{Shells, Terminals, and Commands}
545543

546544
\begin{figure}[h]
547545
\centering
548-
\includegraphics[scale=0.9]{../pictures/terminal-dec-vt100.jpg}
546+
\includegraphics[scale=0.9]{pictures/terminal-dec-vt100.jpg}
549547
\label{vt100}
550548
\caption{A DEC VT100 terminal. CC BY-SA \href{https://en.wikipedia.org/wiki/User:ClickRick?rdfrom=commons:User:ClickRick}{ClickRick}}
551549
\end{figure}
@@ -557,7 +555,7 @@ \section{Shells, Terminals, and Commands}
557555

558556
\begin{figure}[h]
559557
\centering
560-
\includegraphics[scale=0.4]{../pictures/xfce4-terminal.png}
558+
\includegraphics[scale=0.4]{pictures/xfce4-terminal.png}
561559
\caption{XFCE's terminal emulator}
562560
\label{xfce4-terminal}
563561
\end{figure}

0 commit comments

Comments
 (0)