diff --git a/book/book.tex b/book/book.tex index 16c6cb3..985fb10 100644 --- a/book/book.tex +++ b/book/book.tex @@ -39,6 +39,7 @@ At around \qty{60}{\degreeCelsius} (\qty{140}{\degF}) the microbes in your dough start to die. There are rumors that until this happens the microbes produce a lot of \ch{CO2}. +% Does not work \begin{figure}[!htb] \begin{center} \input{figures/fig-ethanol-oxidation.tex} @@ -46,7 +47,31 @@ produce a lot of \ch{CO2}. acid~\cite{acetic+acid+production}.}% \label{fig:ethanol-oxidation} \end{center} +\end{figure} +% Works +% Generate first with: cd figures && pdflatex fig-ethanol-oxidation-external.tex +\begin{figure}[!htb] + \begin{center} + \includegraphics{figures/fig-ethanol-oxidation-external.png} + \caption[Acetic acid creation]{Oxygen is required to create acetic + acid~\cite{acetic+acid+production}.}% + \end{center} +\end{figure} + +% Does not work +\begin{figure}[!htb] +\begin{center} + \input{figures/fig-life-planet-sourdough-timeline.tex} + \caption[Sourdough microbiology timeline]{Timeline giberrish on website}% +\end{center} +\end{figure} + +% Works +% Generate first with: cd figures && pdflatex fig-life-planet-sourdough-timeline-external.pdf +\begin{figure}[!htb] + \includegraphics{figures/fig-life-planet-sourdough-timeline-external.png} + \caption[Sourdough microbiology timeline]{Timeline works embedded as png}% \end{figure} \begin{figure}[!htb] @@ -72,7 +97,6 @@ a sample of your brew and checking the color. different baking methods.} \end{center} \end{table} -\printbibliography {% \hypersetup{hidelinks} \listofflowcharts diff --git a/book/figures/export_figures.sh b/book/figures/export_figures.sh index a4eef16..4d0532e 100755 --- a/book/figures/export_figures.sh +++ b/book/figures/export_figures.sh @@ -10,6 +10,7 @@ if [ "$#" -ne 1 ]; then done else target=figures/`basename $1 .png.pdf`.png + echo ${target} echo "Converting: " $1 " to: " ${target} convert -density 900 -trim $1 -quality 100 ${target} fi diff --git a/book/figures/fig-ethanol-oxidation-external.tex b/book/figures/fig-ethanol-oxidation-external.tex new file mode 100644 index 0000000..1992aa3 --- /dev/null +++ b/book/figures/fig-ethanol-oxidation-external.tex @@ -0,0 +1,11 @@ +\documentclass[tikz]{standalone} +\usepackage{chemfig} +\begin{document} +\footnotesize +\schemestart +\chemfig{H-C(-[2]H)(-[6]H)-C(-[2]H)(-[6]H)-O(-[7]H)} \+ +\chemfig{O_2} \arrow +\chemfig{H-C(-[2]H)(-[6]H)-C(=[1]O)-[7]O-H} \+ +\chemfig{H_2O} +\schemestop +\end{document} diff --git a/book/figures/fig-life-planet-sourdough-timeline-external.tex b/book/figures/fig-life-planet-sourdough-timeline-external.tex new file mode 100644 index 0000000..c70f6de --- /dev/null +++ b/book/figures/fig-life-planet-sourdough-timeline-external.tex @@ -0,0 +1,87 @@ +\documentclass[tikz]{standalone} +\usepackage{tikz} + +\definecolor{codeblack}{RGB}{40, 40, 40} + +\definecolor{pinkpic}{RGB}{246, 183, 194} + +\tikzstyle{timeline_event}=[align=center, fill=white, inner sep=2pt] + +\tikzstyle{timeline_timespan} = [rectangle, draw=codeblack, fill=pinkpic, text=black, + text centered, rounded corners, line width=0.4mm] + + + +\begin{document} + +\begin{tikzpicture} + % Draw horizontal line + \draw[line width=1pt] (0,0) -- (\textwidth,0); + + % Define the width of each segment + \pgfmathsetlengthmacro{\segmentwidth}{\textwidth/12} + + % Draw lines for the events, higher up so that they don't overflow the text + % Placing the lines has been a bit manual work of trying different values + % Maritime bacteria. + + \draw[line width=1pt] (2.8*\segmentwidth,1) -- (2.8*\segmentwidth,0.2); + % Eukaryotes + \draw[line width=1pt] (5.8*\segmentwidth,1.5) -- (5.8*\segmentwidth,0.2); + % First bacteria on land + \draw[line width=1pt] (9.1*\segmentwidth,-1.25) -- (9.1*\segmentwidth,-0.2); + % Maritime fungi ancestors + \draw[line width=1pt] (9.5*\segmentwidth,-2) -- (9.5*\segmentwidth,-0.2); + % Fungi on land + \draw[line width=1pt] (10.8*\segmentwidth,-2.75) -- (10.8*\segmentwidth,-0.2); + % Yeasts on land + \draw[line width=1pt] (11.1*\segmentwidth,-3.0) -- (11.1*\segmentwidth,-0.2); + % First dinosaurs + \draw[line width=1pt] (11.4*\segmentwidth,0.5) -- (11.4*\segmentwidth,0.2); + % Pangea begins to rift apart + \draw[line width=1pt] (11.6*\segmentwidth,1) -- (11.6*\segmentwidth,0.2); + % Dinosaur extinction + \draw[line width=1pt] (11.9*\segmentwidth,1.5) -- (11.9*\segmentwidth,0.2); + + % Special lines for december events since they are so close togehter + \draw[line width=1pt] (12.0*\segmentwidth,3.0) -- (12.0*\segmentwidth,0.2); % Main branch + \draw[line width=1pt] (12.0*\segmentwidth,3.0) -- (11.75*\segmentwidth,2.5); % Branch to first humans + \draw[line width=1pt] (12.0*\segmentwidth,3.0) -- (11.75*\segmentwidth,3.0); % Branch to Jordan + \draw[line width=1pt] (12.0*\segmentwidth,3.0) -- (11.75*\segmentwidth,3.5); % Branch to Pasteur + + % Draw months and month separators + \foreach \i/\month in {0/Jan, 1/Feb, 2/Mar, 3/Apr, 4/May, 5/Jun, 6/Jul, 7/Aug, 8/Sep, 9/Oct, 10/Nov, 11/Dec} { + % Separators + \draw[line width=1pt] (\i*\segmentwidth,0.1) -- (\i*\segmentwidth,-0.1); + % Month names + \node[timeline_event, below] at ({(\i+0.5)*\segmentwidth},-0.1) {\month}; + } + \draw[line width=1pt] (\textwidth,0.1) -- (\textwidth,-0.1); + + % Full timeline width for billion years + \draw[line width=1pt] (0,-3.8) -- node[midway, timeline_timespan] {5.45 billion years} (\textwidth,-3.8); + \draw[line width=1pt] (0,-3.7) -- (0,-3.9); + \draw[line width=1pt] (\textwidth,-3.7) -- (\textwidth,-3.9); + + % Indicator for the period of 3 months = 1.1 billion years + \draw[line width=1pt] (0,-1.0) -- node[midway, timeline_timespan] {1.11 billion years} ({\segmentwidth * 3},-1.0); + \draw[line width=1pt] (0,-0.9) -- (0,-1.1); + \draw[line width=1pt] ({\segmentwidth * 3},-0.9) -- ({\segmentwidth * 3},-1.1); + + % Place events on the timeline with dates using the timeline_event style + % As a calculation I used (4.54 billion years / 12 months = 0.3785 billion years/month. + \node[timeline_event, above] at (2.0*\segmentwidth,1) {Mar 25 - First maritime bacteria and archae}; + \node[timeline_event, above] at (4.50*\segmentwidth,1.5) {June 25 - First organisms with nuklei (eukaryotes)}; + \node[timeline_event, above] at (7.8*\segmentwidth,-1.5) {Oct 4 - First bacteria on land}; + \node[timeline_event, above] at (8.0*\segmentwidth,-2.25) {Oct 15 - First maritime ancestors of fungi}; + \node[timeline_event, above] at (9.7*\segmentwidth,-2.75) {Nov 24 - Fungi on land}; + \node[timeline_event, above] at (10.5*\segmentwidth,-3.25) {Dec 3 - Yeasts on land}; + \node[timeline_event, above] at (10.2*\segmentwidth,0.5) {Dec 14 - First dinosaurs}; + \node[timeline_event, above] at (9.8*\segmentwidth,1) {Dec 17 - Pangea begins to rift apart}; + \node[timeline_event, above] at (10.33*\segmentwidth,1.5) {Dec 29 - Dinosaurs go extinct}; + \node[timeline_event, above, anchor=east, align=right] at (11.75*\segmentwidth,2.5) {Dec 31 - First humans}; + \node[timeline_event, above, anchor=east, align=right] at (11.75*\segmentwidth,3.0) {Dec 31 - Sourdough in Jordan (23:59:55)}; + \node[timeline_event, above, anchor=east, align=right] at (11.75*\segmentwidth,3.5) {Dec 31 - Louis Pasteur isolated yeast (23:59:59)}; + +\end{tikzpicture} +\end{document} diff --git a/book/makefile b/book/makefile index b51ec50..4e6552a 100644 --- a/book/makefile +++ b/book/makefile @@ -74,12 +74,19 @@ tgt_figures := $(patsubst %.tex, %.png,$(src_figures)) %.png: %.tex @echo "\input{./vars.tex}" > $@.in # \b is backspace.. - @echo "\\\begin{document}" >> $@.in + @echo "\\begin{document}" >> $@.in @cat $< >> $@.in - @echo "\\\end{document}" >> $@.in + @echo "\\end{document}" >> $@.in $(LATEX) $@.in figures/export_figures.sh $@.pdf + +figures/fig-ethanol-oxidation-external.pdf: figures/fig-ethanol-oxidation-external.tex + $(LATEX) $< + +figures/fig-life-planet-sourdough-timeline-external.pdf: figures/fig-life-planet-sourdough-timeline-external.tex + $(LATEX) $< + %.xbb: %.jpg ebb -x $< @@ -91,7 +98,10 @@ book_sans_serif/book_sans_serif.pdf: $(src_all) .PHONY: copy_ebook_files -epub/%.epub: %.tex $(ebook_src) cover/cover-page.xbb +epub/%.epub: %.tex $(src_all) cover/cover-page.xbb\ + figures/fig-life-planet-sourdough-timeline-external.pdf\ + figures/fig-ethanol-oxidation-external.pdf + $(EBOOK) $< copy_ebook_files: build_ebook