From 7f6fde9e42646dc3a93bbda84e9b2fc7051f8c98 Mon Sep 17 00:00:00 2001 From: Cedric Date: Fri, 3 Jan 2025 08:25:12 +0000 Subject: [PATCH 01/25] Fix makefile standalone flowchart png generation --- book/figures/vars.tex | 1 + book/makefile | 7 +++---- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/book/figures/vars.tex b/book/figures/vars.tex index b4bc120..d87e959 100644 --- a/book/figures/vars.tex +++ b/book/figures/vars.tex @@ -1,5 +1,6 @@ \documentclass[tikz]{standalone} \usepackage{tikz} +\usepackage{pgfplots} \usepackage[mode=match, reset-text-family=false]{siunitx} \DeclareSIUnit\degF{\text{°}F} \input{flowcharts_tikz.tex} diff --git a/book/makefile b/book/makefile index 788fa6f..57bfa2a 100644 --- a/book/makefile +++ b/book/makefile @@ -90,11 +90,10 @@ tgt_figures := $(patsubst %.tex, %.png,$(src_figures)) # TODO: check if it works on github CI %.png: %.tex - @echo "\input{./vars.tex}" > $@.in - # \b is backspace.. - @echo "\\\begin{document}" >> $@.in + @printf '%s\n' "\input{./vars.tex}" > $@.in + @printf '%s\n' "\begin{document}" >> $@.in @cat $< >> $@.in - @echo "\\\end{document}" >> $@.in + @printf '%s\n' "\end{document}" >> $@.in $(LATEX) $@.in figures/export_figures.sh $@.pdf From 194511d5cf32d6bdc654c50065febcfee80578a8 Mon Sep 17 00:00:00 2001 From: Cedric Date: Thu, 9 Jan 2025 21:04:40 +0000 Subject: [PATCH 02/25] Enable standalone chemical figures generation --- book/figures/vars.tex | 1 + 1 file changed, 1 insertion(+) diff --git a/book/figures/vars.tex b/book/figures/vars.tex index d87e959..e9555ff 100644 --- a/book/figures/vars.tex +++ b/book/figures/vars.tex @@ -1,6 +1,7 @@ \documentclass[tikz]{standalone} \usepackage{tikz} \usepackage{pgfplots} +\usepackage{chemfig} \usepackage[mode=match, reset-text-family=false]{siunitx} \DeclareSIUnit\degF{\text{°}F} \input{flowcharts_tikz.tex} From ad94b9fabcaf3fe17eca7eca683ebc9ad64b1990 Mon Sep 17 00:00:00 2001 From: Cedric Date: Thu, 9 Jan 2025 21:18:02 +0000 Subject: [PATCH 03/25] Enable abbreviations in standalone flowcharts Spun the file out for inclusion basically... we want to be able to use \eg in flowcharts even when built standalone. Fixed dependencies in makefile as well --- book/abbreviations.tex | 4 ++++ book/figures/vars.tex | 1 + book/makefile | 4 ++-- book/sourdough.sty | 4 +--- 4 files changed, 8 insertions(+), 5 deletions(-) create mode 100644 book/abbreviations.tex diff --git a/book/abbreviations.tex b/book/abbreviations.tex new file mode 100644 index 0000000..0cf5d34 --- /dev/null +++ b/book/abbreviations.tex @@ -0,0 +1,4 @@ +% Common abbreviations +\newcommand{\ie}{\emph{i.e.}\@ifnextchar.{\!\@gobble}{}} +\newcommand{\eg}{\emph{e.g.}\@ifnextchar.{\!\@gobble}{}} +\newcommand{\etc}{etc\@ifnextchar.{}{.\@}} diff --git a/book/figures/vars.tex b/book/figures/vars.tex index e9555ff..1f9c012 100644 --- a/book/figures/vars.tex +++ b/book/figures/vars.tex @@ -6,3 +6,4 @@ \DeclareSIUnit\degF{\text{°}F} \input{flowcharts_tikz.tex} \input{../colors.tex} +\input{../abbreviations.tex} diff --git a/book/makefile b/book/makefile index 57bfa2a..80ef205 100644 --- a/book/makefile +++ b/book/makefile @@ -35,13 +35,13 @@ chapters = baking basics bread-types cover flour-types history intro mix-ins\ src_tables := $(wildcard tables/table-*.tex) src_figures := $(wildcard figures/fig-*.tex) figures/flowcharts_tikz.tex -src_figures += $(wildcard plots/fig-*.tex) +src_figures += $(wildcard plots/fig-*.tex) abbreviations.tex colors.tex src_recipes := $(wildcard recipes/*.tex) src_plots := $(wildcard plots/*.table) src_tex := $(foreach directory, $(chapters), $(wildcard $(directory)/*.tex)) src_tex += book.tex book_sans_serif.tex references.bib figures/vars.tex -src_tex += supporters.csv sourdough.sty colors.tex +src_tex += supporters.csv sourdough.sty colors.tex abbreviations.tex src_tex += $(src_recipes) images := $(wildcard images/*/*.jpg) diff --git a/book/sourdough.sty b/book/sourdough.sty index 370e706..fe2f1ca 100644 --- a/book/sourdough.sty +++ b/book/sourdough.sty @@ -34,9 +34,7 @@ \DeclareTOCStyleEntry[numwidth=3em]{tocline}{table} % Common abbreviations -\newcommand{\ie}{\emph{i.e.}\@ifnextchar.{\!\@gobble}{}} -\newcommand{\eg}{\emph{e.g.}\@ifnextchar.{\!\@gobble}{}} -\newcommand{\etc}{etc\@ifnextchar.{}{.\@}} +\input{abbreviations.tex} % Consistent pH values \newcommand{\pHvalue}[1]{pH~\SI{#1}{}} From b57089b777ca898f69586215c925a85d88e3ddba Mon Sep 17 00:00:00 2001 From: Ramin Kamal <21167874+ramink@users.noreply.github.com> Date: Sat, 4 Jan 2025 14:08:56 -0800 Subject: [PATCH 04/25] Chang arrowheads to be cleaner LaTex style. Update flowcharts_tikz.tex to use arrows.meta instead of arrows, which is not nice and deprecated. --- book/figures/flowcharts_tikz.tex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/book/figures/flowcharts_tikz.tex b/book/figures/flowcharts_tikz.tex index b452217..54540ea 100644 --- a/book/figures/flowcharts_tikz.tex +++ b/book/figures/flowcharts_tikz.tex @@ -1,5 +1,5 @@ \tikzstyle{every picture}+=[font=\footnotesize\sffamily] -\usetikzlibrary{calc, shapes, arrows, decorations.pathreplacing, calligraphy, +\usetikzlibrary{calc, shapes, arrows.meta, decorations.pathreplacing, calligraphy, positioning} \tikzstyle{decision} = [diamond, draw=codeblack, fill=codeblack, text=white, text width=4.5em, text badly centered, node distance=3cm, inner sep=0pt, From 311bd55a7fc44a8b9acc7f6b9b47bc535c9024a0 Mon Sep 17 00:00:00 2001 From: Ramin Kamal <21167874+ramink@users.noreply.github.com> Date: Mon, 6 Jan 2025 21:28:49 -0800 Subject: [PATCH 05/25] Update all flowchart arrows to LaTeX arrows - Change tikzstyle definition for "line" so that all flowchart arrows have the "Latex" styling. --- book/figures/fig-stiff-starter-conversion.tex | 2 +- book/figures/flowcharts_tikz.tex | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/book/figures/fig-stiff-starter-conversion.tex b/book/figures/fig-stiff-starter-conversion.tex index 6e4f549..c8d54a0 100644 --- a/book/figures/fig-stiff-starter-conversion.tex +++ b/book/figures/fig-stiff-starter-conversion.tex @@ -11,7 +11,7 @@ \path [line] (init) -- (feed_new_ratio); \path [line] (feed_again) -- (feed_new_ratio); \path [line] (next_day) -- (ready_signs); - \path [line] (ready_signs) -- node{no} (feed_again |- last_feed) |- (feed_again.south); + \path [line] (ready_signs) -- node{no} (feed_again |- last_feed) -| (feed_again.south); \path [line] (ready_signs) -- node{yes} (last_feed); \path [line] (last_feed) -- node{after \qtyrange{6}{12}{\hour}} (bread_dough); \path [line] (feed_new_ratio) -- (too_dry); diff --git a/book/figures/flowcharts_tikz.tex b/book/figures/flowcharts_tikz.tex index 54540ea..c68219f 100644 --- a/book/figures/flowcharts_tikz.tex +++ b/book/figures/flowcharts_tikz.tex @@ -19,7 +19,8 @@ \tikzstyle{fail} = [rectangle, draw=codeblack, fill=redpic, text=black, text width=5em, text centered, rounded corners, minimum height=4em, line width=0.4mm] -\tikzstyle{line} = [draw, -latex', thick, ->,>=to] +% The arrowed connector line between nodes +\tikzstyle{line} = [draw, thick, ->, >={Latex}] \tikzstyle{BC} = [decorate, % Brace Calligraphic decoration={calligraphic brace, amplitude=3mm, raise=1mm}, From d5ae1315cee5d5eb1141206320f04df4b2e5169f Mon Sep 17 00:00:00 2001 From: Ramin Kamal <21167874+ramink@users.noreply.github.com> Date: Fri, 3 Jan 2025 08:26:06 +0000 Subject: [PATCH 06/25] Rearrange starter process flowchart - Added an extra state for clarity - Made it more compact - Added details section --- book/figures/fig-starter-process.tex | 28 ++++++++++++++++ book/mwe.tex | 49 ++++++++++++++++++++++++++++ 2 files changed, 77 insertions(+) create mode 100644 book/mwe.tex diff --git a/book/figures/fig-starter-process.tex b/book/figures/fig-starter-process.tex index 3eb529b..3fe0d6b 100644 --- a/book/figures/fig-starter-process.tex +++ b/book/figures/fig-starter-process.tex @@ -16,4 +16,32 @@ \path [line] (decide) -- node{no} (timeout); \path [line] (wait2) -- (feed); \path [line] (decide) -- node{yes} (use); + + \node [start, below of=discard, left of=discard] (start_n) { Start with Initial Mixture }; + \node [block, right of=start_n, node distance = 3.2cm] (wait_n) { Wait\\ \qty{24}{\hour} }; + \node [decision, right of=wait_n, node distance = 3.2cm] (readycheck_n) { Ready? }; + \node [block, below of=wait_n, node distance = 3cm] (feed_n) { Feed the Mixture }; + \node [decision, right of=feed_n, node distance = 3.2cm] (limitcheck_n) { Failed? }; + \node [fail, right of=limitcheck_n, node distance = 3.2cm] (abort_n) { Discard All, Start Over }; + \node [success, right of=readycheck_n, node distance = 3.2cm] (final_n) { Done }; + + \draw [line] (start_n) -- (wait_n); + \draw [line] (wait_n) -- (readycheck_n); + \draw [line] (feed_n) -- (wait_n); + \draw [line] (readycheck_n) -- node { No } (limitcheck_n); + \draw [line] (limitcheck_n) -- node (feedok_n) { No } (feed_n) ; + \draw [line] (limitcheck_n) -- node { Yes } (abort_n); + \draw [line] (readycheck_n) -- node { Yes } (final_n); + + \node [below of=feedok_n, node distance=2cm, align=left] (details2) [shape=rectangle,draw,fill=maingray]{ + For the \emph{Initial Mixture}, mix \qty{50}{\gram} flour/\qty{50}{\gram} water.\\ + The Mixture is \emph{Ready} when it has + \emph{grown}, has \emph{bubbles}, and \emph{smells} + vinegary/yoghurty. \\ + + The Mixture has \emph{Failed} when you + have fed it too many (\eg~10) times without success.\\ + + To \emph{Feed the Mixture}, discard all but \qty{10}{\gram}, mix in \qty{50}{\gram} flour and \qty{50}{\gram} water. + }; \end{tikzpicture} diff --git a/book/mwe.tex b/book/mwe.tex new file mode 100644 index 0000000..df44c1a --- /dev/null +++ b/book/mwe.tex @@ -0,0 +1,49 @@ +\documentclass[paper=a4, twoside=false, fontsize=12pt, parskip=half, + bibliography=totoc, listof=totoc]{scrbook} + +% General packages +\usepackage{pgfplots} +\usepackage{fontspec} +\usepackage[mode=match, reset-text-family=false]{siunitx} +\usepackage{fontspec} +\usepackage{calc} +\input{colors.tex} +% Define flowcharts macros independently so we can build them as png files +% for the website or something. This is supported in the makefile +\input{figures/flowcharts_tikz.tex} +% Fonts +\defaultfontfeatures{Scale=MatchLowercase, Ligatures=TeX} +% Define Semi-bold +\DeclareRobustCommand\sbseries{\fontseries{sb}\selectfont} +% Fonts for accessibility +\ifdefined\isaccessible + \setmainfont{Open Sans}[ + Scale=MatchLowercase] +\else + \setmainfont{TeX Gyre Pagella}[Scale=1.0] % Or Palatino Linotype, etc. + % TODO not available on github CI + % \setmonofont{Andale Mono}[Scale=MatchLowercase] +\fi +% Opens Sans in both case.. +\setsansfont{Open Sans}[ + Scale=MatchLowercase, + FontFace = {sb}{it}{* Semibold Italic}, + FontFace = {sb}{n}{*-semibold}] +\usepackage{layouts} + +\newcommand{\printsizes}{ + Width: \printinunitsof{in}\prntlen{\textwidth}in \\ + Height: \printinunitsof{in}\prntlen{\textheight}in +} + +\begin{document} +\begin{figure}[!htb] + \centering + \input{figures/fig-starter-process.tex} + \caption[Dough strength over time with kneading]{A schematic visualization + of gluten development in sourdoughs with different kneading techniques. + A combination of techniques can be utilized to achieve maximum dough + strength.}% + \label{fig:dough-strength-sourdough} +\end{figure} +\end{document} From 42c9f316731024fa3fb453b10e846a847c424bc0 Mon Sep 17 00:00:00 2001 From: Ramin Kamal <21167874+ramink@users.noreply.github.com> Date: Thu, 9 Jan 2025 15:45:54 -0800 Subject: [PATCH 07/25] Change "Repeat 3 times" elements to use "Latex" arrows --- book/figures/fig-liquid-starter-conversion.tex | 6 +++--- book/figures/fig-stiff-starter-conversion.tex | 5 +++-- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/book/figures/fig-liquid-starter-conversion.tex b/book/figures/fig-liquid-starter-conversion.tex index 2954897..37fff5a 100644 --- a/book/figures/fig-liquid-starter-conversion.tex +++ b/book/figures/fig-liquid-starter-conversion.tex @@ -11,7 +11,7 @@ \path [line] (ready_signs) -- node{no} (feed_again); \path [line] (ready_signs) -- node[above=2pt]{~yes} (last_feed); \path [line] (last_feed) -- node{after \qtyrange{6}{12}{\hour}} (bread_dough); - \draw [thick, ->] ($ (feed_again.north) +(0.7cm, 1cm)$) arc (-45:220:1cm); - \node [anchor=north, text width=5em] at ($(feed_again.north west)+(1.8cm, 2.3cm)$) {Repeat 3~times}; - + % TODO: find a better way to position the Repeat 3 times text and arrow. Hard-coded values are finicky and don't work well across media. + \draw [line] ($ (feed_again.north) +(0.7cm, 1cm)$) arc (-45:220:1cm); + \node [anchor=north, text width=5em] at ($(feed_again.north west)+(1.55cm, 2.2cm)$) {Repeat 3~times}; \end{tikzpicture} diff --git a/book/figures/fig-stiff-starter-conversion.tex b/book/figures/fig-stiff-starter-conversion.tex index c8d54a0..1a6d9ab 100644 --- a/book/figures/fig-stiff-starter-conversion.tex +++ b/book/figures/fig-stiff-starter-conversion.tex @@ -19,6 +19,7 @@ \path [line] (too_dry) -- node{no} (next_day); \path [line] (too_dry) -- node{yes} (add_water); \path [line] (ready_signs) -- node{yes} (last_feed); - \draw [thick, <-] ($ (feed_again.east) +(2.1cm, 0.7cm)$) arc (-45:220:1cm); - \node [anchor=north, text width=5em] at ($(feed_again.east)+(2cm, 2cm)$) {Repeat 3~times}; + % TODO: find a better way to position the Repeat 3 times text and arrow. Hard-coded values are finicky and don't work well across media. + \draw [line] ($ (feed_again.east) +(0.7cm, 0.9cm)$) arc (220:-45:1cm); + \node [anchor=north, text width=5em] at ($(feed_again.east)+(1.9cm, 2cm)$) {Repeat 3~times}; \end{tikzpicture} From d884d588d6dbedd5c99e4a74c18f83ca0a904f81 Mon Sep 17 00:00:00 2001 From: Ramin Kamal <21167874+ramink@users.noreply.github.com> Date: Thu, 9 Jan 2025 15:46:48 -0800 Subject: [PATCH 08/25] Change plots to use "Latex" arrows for the axes --- book/plots/fig-temperature-ambient.tex | 1 + book/plots/fig-temperature-surface.tex | 1 + book/plots/fig-yeast-sourdough-strength.tex | 1 + 3 files changed, 3 insertions(+) diff --git a/book/plots/fig-temperature-ambient.tex b/book/plots/fig-temperature-ambient.tex index c3d876f..9ca4351 100644 --- a/book/plots/fig-temperature-ambient.tex +++ b/book/plots/fig-temperature-ambient.tex @@ -6,6 +6,7 @@ major grid style={line width=.2pt,draw=gray!30}, axis x line=middle, axis y line=middle, + axis line style={-Latex}, width=\textwidth, height=0.5\textwidth, xmax=35, xmin=-0.1, diff --git a/book/plots/fig-temperature-surface.tex b/book/plots/fig-temperature-surface.tex index 8ddaf9e..a0a2090 100644 --- a/book/plots/fig-temperature-surface.tex +++ b/book/plots/fig-temperature-surface.tex @@ -6,6 +6,7 @@ major grid style={line width=.2pt,draw=gray!30}, axis x line=middle, axis y line=middle, + axis line style={-Latex}, width=\textwidth, height=0.5\textwidth, xmax=35, xmin=-0.1, diff --git a/book/plots/fig-yeast-sourdough-strength.tex b/book/plots/fig-yeast-sourdough-strength.tex index defaa62..77c34a5 100644 --- a/book/plots/fig-yeast-sourdough-strength.tex +++ b/book/plots/fig-yeast-sourdough-strength.tex @@ -7,6 +7,7 @@ \qty{60}{\percent}~hydration}, axis x line=middle, axis y line=middle, + axis line style={-Latex}, width=\textwidth, height=0.5\textwidth, xmax=44, xmin=-0.1, From 864127e5713d56ed0eeb58b1623d64df5d3cf18c Mon Sep 17 00:00:00 2001 From: Ced Date: Sat, 11 Jan 2025 10:23:22 +0000 Subject: [PATCH 09/25] Reworked flowchart as per discussions --- book/figures/fig-starter-process.tex | 53 ++++++++-------------------- 1 file changed, 14 insertions(+), 39 deletions(-) diff --git a/book/figures/fig-starter-process.tex b/book/figures/fig-starter-process.tex index 3fe0d6b..7a5312b 100644 --- a/book/figures/fig-starter-process.tex +++ b/book/figures/fig-starter-process.tex @@ -1,47 +1,22 @@ \begin{tikzpicture}[node distance = 3.5cm, auto] - \node [start] (init) {Mix \qty{50}{\gram} flour + \qty{50}{\gram} water, stir}; - \node [block, right of=init] (wait2) {Wait\\ \qty{24}{\hour}}; - \path [line] (init) -- (wait2); - \node [block, below of=wait2, node distance=3.5cm] (feed) {\qty{10}{\gram} of previous day + \qty{50}{\gram} water + \qty{50}{\gram} flour, stir}; - \path [line] (wait2) -- (feed); - \node [block, below of=feed] (discard) {Discard the rest}; - \path [line] (feed) -- (discard); - \node [decision, right of=feed, node distance=3.5cm] (decide) {Is good?}; - \node [decision, above of=decide, node distance=3.5cm] (timeout) {Less than 10 feeds?}; - \node [fail, right of=timeout, node distance=3.5cm] (discard2) {Batch failed}; - \path [line] (timeout) -- node{no} (discard2); - \path [line] (timeout) -- node{yes} (wait2); - \path [line] (feed) -- (decide); - \node [success, right of=decide, node distance=3.5cm] (use) {Ready to use}; - \path [line] (decide) -- node{no} (timeout); - \path [line] (wait2) -- (feed); - \path [line] (decide) -- node{yes} (use); - - \node [start, below of=discard, left of=discard] (start_n) { Start with Initial Mixture }; - \node [block, right of=start_n, node distance = 3.2cm] (wait_n) { Wait\\ \qty{24}{\hour} }; - \node [decision, right of=wait_n, node distance = 3.2cm] (readycheck_n) { Ready? }; - \node [block, below of=wait_n, node distance = 3cm] (feed_n) { Feed the Mixture }; - \node [decision, right of=feed_n, node distance = 3.2cm] (limitcheck_n) { Failed? }; - \node [fail, right of=limitcheck_n, node distance = 3.2cm] (abort_n) { Discard All, Start Over }; - \node [success, right of=readycheck_n, node distance = 3.2cm] (final_n) { Done }; + \node [start, below of=discard, left of=discard] (start_n) {Mix \qty{50}{\gram} flour + \qty{50}{\gram} water, stir}; + \node [block, right of=start_n, node distance = 3.5cm] (wait_n) {Wait\\ \qty{24}{\hour}}; + \node [decision, right of=wait_n, node distance = 3.5cm] (readycheck_n) {Ready?}; + \node [block, below of=wait_n, node distance = 3.2cm] (feed_n) {Feed the mixture }; + \node [decision, right of=feed_n, node distance = 3.5cm] (limitcheck_n) {>10 feeds?}; + \node [fail, right of=limitcheck_n, node distance = 3.5cm] (abort_n) {Discard all. Start over}; + \node [success, right of=readycheck_n, node distance = 3.5cm] (final_n) {Ready to use}; \draw [line] (start_n) -- (wait_n); \draw [line] (wait_n) -- (readycheck_n); \draw [line] (feed_n) -- (wait_n); - \draw [line] (readycheck_n) -- node { No } (limitcheck_n); - \draw [line] (limitcheck_n) -- node (feedok_n) { No } (feed_n) ; - \draw [line] (limitcheck_n) -- node { Yes } (abort_n); - \draw [line] (readycheck_n) -- node { Yes } (final_n); + \draw [line] (readycheck_n) -- node {No} (limitcheck_n); + \draw [line] (limitcheck_n) -- node (feedok_n) {No} (feed_n) ; + \draw [line] (limitcheck_n) -- node {Yes} (abort_n); + \draw [line] (readycheck_n) -- node {Yes} (final_n); - \node [below of=feedok_n, node distance=2cm, align=left] (details2) [shape=rectangle,draw,fill=maingray]{ - For the \emph{Initial Mixture}, mix \qty{50}{\gram} flour/\qty{50}{\gram} water.\\ - The Mixture is \emph{Ready} when it has - \emph{grown}, has \emph{bubbles}, and \emph{smells} - vinegary/yoghurty. \\ - - The Mixture has \emph{Failed} when you - have fed it too many (\eg~10) times without success.\\ - - To \emph{Feed the Mixture}, discard all but \qty{10}{\gram}, mix in \qty{50}{\gram} flour and \qty{50}{\gram} water. + \node [below of=feedok_n, node distance=2cm, align=left] (details2) [shape=rectangle, draw, fill=maingray]{% + \textbf{Ready}: Mixture has \emph{grown}, has \emph{bubbles}, and \emph{smells} vinegary/yoghurty. \\ + \textbf{Feed the mixture}: Discard all but \qty{10}{\gram}, mix in \qty{50}{\gram} flour and \qty{50}{\gram} water. }; \end{tikzpicture} From f6cf15156a5c908831a70af7f8b68110254d14d5 Mon Sep 17 00:00:00 2001 From: Ced Date: Sat, 11 Jan 2025 10:24:41 +0000 Subject: [PATCH 10/25] Remove the MWE from git was added for the debug branches but shall not go to main. --- book/mwe.tex | 49 ------------------------------------ website/_bundle_install_done | 0 2 files changed, 49 deletions(-) delete mode 100644 book/mwe.tex delete mode 100644 website/_bundle_install_done diff --git a/book/mwe.tex b/book/mwe.tex deleted file mode 100644 index df44c1a..0000000 --- a/book/mwe.tex +++ /dev/null @@ -1,49 +0,0 @@ -\documentclass[paper=a4, twoside=false, fontsize=12pt, parskip=half, - bibliography=totoc, listof=totoc]{scrbook} - -% General packages -\usepackage{pgfplots} -\usepackage{fontspec} -\usepackage[mode=match, reset-text-family=false]{siunitx} -\usepackage{fontspec} -\usepackage{calc} -\input{colors.tex} -% Define flowcharts macros independently so we can build them as png files -% for the website or something. This is supported in the makefile -\input{figures/flowcharts_tikz.tex} -% Fonts -\defaultfontfeatures{Scale=MatchLowercase, Ligatures=TeX} -% Define Semi-bold -\DeclareRobustCommand\sbseries{\fontseries{sb}\selectfont} -% Fonts for accessibility -\ifdefined\isaccessible - \setmainfont{Open Sans}[ - Scale=MatchLowercase] -\else - \setmainfont{TeX Gyre Pagella}[Scale=1.0] % Or Palatino Linotype, etc. - % TODO not available on github CI - % \setmonofont{Andale Mono}[Scale=MatchLowercase] -\fi -% Opens Sans in both case.. -\setsansfont{Open Sans}[ - Scale=MatchLowercase, - FontFace = {sb}{it}{* Semibold Italic}, - FontFace = {sb}{n}{*-semibold}] -\usepackage{layouts} - -\newcommand{\printsizes}{ - Width: \printinunitsof{in}\prntlen{\textwidth}in \\ - Height: \printinunitsof{in}\prntlen{\textheight}in -} - -\begin{document} -\begin{figure}[!htb] - \centering - \input{figures/fig-starter-process.tex} - \caption[Dough strength over time with kneading]{A schematic visualization - of gluten development in sourdoughs with different kneading techniques. - A combination of techniques can be utilized to achieve maximum dough - strength.}% - \label{fig:dough-strength-sourdough} -\end{figure} -\end{document} diff --git a/website/_bundle_install_done b/website/_bundle_install_done deleted file mode 100644 index e69de29..0000000 From 8b581f3bc49e3d86def82efe273e35d68e520356 Mon Sep 17 00:00:00 2001 From: Ced Date: Sat, 11 Jan 2025 10:29:13 +0000 Subject: [PATCH 11/25] Use uppercase in flowcharts conditions --- book/figures/fig-bulk-fermentation.tex | 4 +- book/figures/fig-compet.tex | 54 +++++++++++++++++++ book/figures/fig-dutch-oven-process.tex | 8 +-- book/figures/fig-kneading-process.tex | 12 ++--- .../figures/fig-liquid-starter-conversion.tex | 2 +- book/figures/fig-proofing-process.tex | 12 ++--- book/figures/fig-shaping-process.tex | 4 +- book/figures/fig-starter-maintenance.tex | 16 +++--- book/figures/fig-starter-readiness.tex | 10 ++-- book/figures/fig-stiff-starter-conversion.tex | 10 ++-- book/figures/fig-wheat-sourdough-process.tex | 4 +- 11 files changed, 95 insertions(+), 41 deletions(-) create mode 100644 book/figures/fig-compet.tex diff --git a/book/figures/fig-bulk-fermentation.tex b/book/figures/fig-bulk-fermentation.tex index 5eb0a45..b46dc73 100644 --- a/book/figures/fig-bulk-fermentation.tex +++ b/book/figures/fig-bulk-fermentation.tex @@ -20,10 +20,10 @@ % Same tricks not to get double lines and also we do _not_ want arrows \path [draw, thick] (ph_value) -- node{} ++(2, 0); \path [draw, thick] (smell) -| node{} ++(2, 4); - \path [line] (dough_ready) -- node{yes} (divide_preshape); + \path [line] (dough_ready) -- node{Yes} (divide_preshape); \path [line] (dough_ready) |- node[right=3pt]{no} (dough_flattened); \path [line] (dough_flattened) |- node[right=3pt]{yes} (stretch_fold); - \path [line] (dough_flattened) -- node{no} (wait_60_minutes); + \path [line] (dough_flattened) -- node{No} (wait_60_minutes); \path [line] (stretch_fold) -- (wait_60_minutes); \path [line] (wait_60_minutes) -- (check_dough); \end{tikzpicture} diff --git a/book/figures/fig-compet.tex b/book/figures/fig-compet.tex new file mode 100644 index 0000000..244a5c1 --- /dev/null +++ b/book/figures/fig-compet.tex @@ -0,0 +1,54 @@ +\begin{tikzpicture}[node distance=1cm] + +% Left Side: Antifungal metabolites +% Bacteria +\draw[thick, fill=gray!20] (-2, 2.5) ellipse (1.2cm and 0.5cm); +\node at (-2, 3.2) {Antifungal metabolites}; + +% Arrows for antifungal metabolites +\foreach \x in {-2.5, -2, -1.5} + \draw[thick, ->] (\x, 2) -- (\x, 1.2); + +% Antifungal metabolites (triangles) +\foreach \x in {-2.5, -2, -1.5} + \node[fill=red!80!black, regular polygon, regular polygon sides=3, draw, scale=0.7] at (\x, 1.2) {}; + +% Fungi (left) +\draw[thick, fill=gray!50] (-2, 0.5) circle (0.5cm); +\node at (-2, -0.2) {Fungi}; + +% Right Side: Nutrient Competition +% Bacteria +\draw[thick, fill=gray!20] (3, 2.5) ellipse (1.2cm and 0.5cm); +\node at (3, 3.2) {Competition for nutrients}; + +% Arrows for nutrients +\foreach \x in {2.5, 3, 3.5} + \draw[thick, <-] (\x, 2) -- (\x, 1.2); + +% Available nutrients (triangles) +\foreach \x in {2.5, 3, 3.5} + \node[fill=green!80!black, regular polygon, regular polygon sides=3, draw, scale=0.7, rotate=180] at (\x, 1.2) {}; + +% Fungi (right) +\draw[thick, fill=gray!50] (3, 0.5) circle (0.5cm); +\node at (3, -0.2) {Fungi}; + +% Legends +% Bacteria legend +\draw[thick, fill=gray!20] (-5.5, -2) ellipse (0.8cm and 0.3cm); +\node[anchor=west] at (-5, -2) {Bacteria}; + +% Fungi legend +\draw[thick, fill=gray!50] (-5.5, -3) circle (0.3cm); +\node[anchor=west] at (-5, -3) {Fungi}; + +% Antifungal metabolites legend +\node[fill=red!80!black, regular polygon, regular polygon sides=3, draw, scale=0.7] at (-5.5, -4) {}; +\node[anchor=west] at (-5, -4) {Antifungal metabolites}; + +% Available nutrients legend +\node[fill=green!80!black, regular polygon, regular polygon sides=3, draw, scale=0.7, rotate=180] at (-5.5, -5) {}; +\node[anchor=west] at (-5, -5) {Available nutrients}; + +\end{tikzpicture} diff --git a/book/figures/fig-dutch-oven-process.tex b/book/figures/fig-dutch-oven-process.tex index d4f0fff..1230fc9 100644 --- a/book/figures/fig-dutch-oven-process.tex +++ b/book/figures/fig-dutch-oven-process.tex @@ -22,11 +22,11 @@ \path [line] (close) -- (back_oven); \path [line] (back_oven) -- (bake); \path [line] (bake.west) -- node{} ++(-2, 0) -| (is_ready_check.north); - \path [line] (is_ready_check) -- node{yes} (remove_do_lid); - \path [line] (is_ready_check) -- node{no} (wait_5_minutes); + \path [line] (is_ready_check) -- node{Yes} (remove_do_lid); + \path [line] (is_ready_check) -- node{No} (wait_5_minutes); \path [line] (wait_5_minutes.west) -- node{} ++(-1.5, 0) |- (is_ready_check.west); \path [line] (remove_do_lid) -- (dark_enough_decision); - \path [line] (dark_enough_decision) -- node{yes} (finish_baking); - \path [line] (dark_enough_decision) -- node{no} (bake_5_more_minutes); + \path [line] (dark_enough_decision) -- node{Yes} (finish_baking); + \path [line] (dark_enough_decision) -- node{No} (bake_5_more_minutes); \path [line] (bake_5_more_minutes.east) -- node{} ++(1, 0) -- node{} ++(0, 2.3) -| (dark_enough_decision.north); \end{tikzpicture} diff --git a/book/figures/fig-kneading-process.tex b/book/figures/fig-kneading-process.tex index 4a48db3..9c768bb 100644 --- a/book/figures/fig-kneading-process.tex +++ b/book/figures/fig-kneading-process.tex @@ -8,18 +8,18 @@ \path [line] (knead) -- (wait2); \node [decision, below of=wait2, node distance=4cm] (windowpane_test) {Window-pane?}; \path [line] (wait2) -- (windowpane_test); - \path [line] (windowpane_test.east) -- node{no} ++(1, 0) -- node{} ++(0, 5.7) -| (knead.north); + \path [line] (windowpane_test.east) -- node{No} ++(1, 0) -- node{} ++(0, 5.7) -| (knead.north); \node [decision] at (windowpane_test -| knead) (more_water) {Bassinage for more water?}; - \path [line] (windowpane_test) -- node{yes} (more_water); + \path [line] (windowpane_test) -- node{Yes} (more_water); \node [block] at (wait1 |- more_water) (add_water) {Add water}; - \path [line] (more_water) -- node{yes} (add_water); + \path [line] (more_water) -- node{Yes} (add_water); \path [line] (add_water.north east) -- (knead.south west); \node [decision, below of=more_water, node distance=4.5cm] (dough_sample) {Aliquot sample?}; - \path [line] (more_water) -- node{no} (dough_sample); + \path [line] (more_water) -- node{No} (dough_sample); \node [block] at (dough_sample -| wait2) (dough_ball) {Make round dough ball}; - \path [line] (dough_sample) -- node{no} (dough_ball); + \path [line] (dough_sample) -- node{No} (dough_ball); \node [block, below of=dough_sample] (extract_sample) {Extract sample}; - \path [line] (dough_sample) -- node{yes} (extract_sample); + \path [line] (dough_sample) -- node{Yes} (extract_sample); \path [line] (extract_sample.north east) -- (dough_ball.south west); \node [success, below of=dough_ball] (begin_bulk) {Begin bulk fermentation}; \path [line] (dough_ball) -- (begin_bulk); diff --git a/book/figures/fig-liquid-starter-conversion.tex b/book/figures/fig-liquid-starter-conversion.tex index 37fff5a..d4ffb16 100644 --- a/book/figures/fig-liquid-starter-conversion.tex +++ b/book/figures/fig-liquid-starter-conversion.tex @@ -8,7 +8,7 @@ \path [line] (init) -- (feed_new_ratio); \path [line] (feed_new_ratio) -- node{Wait \qty{24}{\hour}} (ready_signs); \path [line] (feed_again) -- node[anchor=east] {} ++(2.2,0) |- (feed_new_ratio); - \path [line] (ready_signs) -- node{no} (feed_again); + \path [line] (ready_signs) -- node{No} (feed_again); \path [line] (ready_signs) -- node[above=2pt]{~yes} (last_feed); \path [line] (last_feed) -- node{after \qtyrange{6}{12}{\hour}} (bread_dough); % TODO: find a better way to position the Repeat 3 times text and arrow. Hard-coded values are finicky and don't work well across media. diff --git a/book/figures/fig-proofing-process.tex b/book/figures/fig-proofing-process.tex index 7303ab4..bca52a4 100644 --- a/book/figures/fig-proofing-process.tex +++ b/book/figures/fig-proofing-process.tex @@ -7,14 +7,14 @@ \node [success, right of=dent_visible_decision, node distance=4cm] (bake) {Score and bake}; \node [block] at (retard_bake_decision |- poke) (wait_retard) {Wait\\ 15~minutes}; \node [block] at (wait_retard |- bake) (retard) {Proof in fridge at \qty{4}{\degreeCelsius} (\qty{40}{\degF})}; - \path [line] (init) -- node{yes} (poke); - \path [line] (init) -- node{no} (retard_bake_decision); + \path [line] (init) -- node{Yes} (poke); + \path [line] (init) -- node{No} (retard_bake_decision); \path [line] (poke) -- (dent_visible_decision); - \path [line] (dent_visible_decision) -- node{yes} (bake); - \path [line] (dent_visible_decision.west) -- node{no} ++(-1.4, 0) -- node{} (wait_poke.south); + \path [line] (dent_visible_decision) -- node{Yes} (bake); + \path [line] (dent_visible_decision.west) -- node{No} ++(-1.4, 0) -- node{} (wait_poke.south); \path [line] (wait_poke) -- (poke); - \path [line] (retard_bake_decision) -- node{yes} (wait_retard); - \path [line] (retard_bake_decision.east) -- node{no} ++(1, 0) |- node{} (retard.east); + \path [line] (retard_bake_decision) -- node{Yes} (wait_retard); + \path [line] (retard_bake_decision.east) -- node{No} ++(1, 0) |- node{} (retard.east); \path [line] (wait_retard) -- (retard); \path [line] (retard) -- (bake); \end{tikzpicture} diff --git a/book/figures/fig-shaping-process.tex b/book/figures/fig-shaping-process.tex index 65f9658..4f88d30 100644 --- a/book/figures/fig-shaping-process.tex +++ b/book/figures/fig-shaping-process.tex @@ -8,8 +8,8 @@ \node [block, right of=flour] (banneton) {Place upside down in banneton}; \node [success, right of=banneton] (proof) {Begin proofing}; \path [line] (init) -- (overfermented_decision); - \path [line] (overfermented_decision) -- node{yes} (overfermented); - \path [line] (overfermented_decision) -- node{no} (shaping_technique); + \path [line] (overfermented_decision) -- node{Yes} (overfermented); + \path [line] (overfermented_decision) -- node{No} (shaping_technique); \path [line] (shaping_technique) -- (flour); \path [line] (flour) -- (banneton); \path [line] (banneton) -- (proof); diff --git a/book/figures/fig-starter-maintenance.tex b/book/figures/fig-starter-maintenance.tex index ac5eb4c..8f856fc 100644 --- a/book/figures/fig-starter-maintenance.tex +++ b/book/figures/fig-starter-maintenance.tex @@ -4,8 +4,8 @@ \path [line] (init) -- (all_starter_used); \node [block, right of=init, node distance=3cm] (use_dough) {Take \qty{10}{\gram} of your bread dough}; \node [block, right of=all_starter_used, node distance=3cm] (use_starter) {Take all but not more than \qty{10}{\gram} of your starter}; - \path [line] (all_starter_used) -- node{yes} (use_dough); - \path [line] (all_starter_used) -- node{no} (use_starter); + \path [line] (all_starter_used) -- node{Yes} (use_dough); + \path [line] (all_starter_used) -- node{No} (use_starter); \node [block, right of=use_dough, node distance=3cm] (feed_starter) {Feed using 1:5:5 ratio}; \path [line] (use_dough) -- (feed_starter); \path [line] (use_starter) -- (feed_starter); @@ -13,20 +13,20 @@ \path [line] (feed_starter) -- (bake_next_day_check); \node [success, right of=bake_next_day_check, node distance=3.5cm] (make_bread_dough) {Make bread dough again after \qtyrange{8}{12}{\hour}}; - \path [line] (bake_next_day_check) -- node{yes} (make_bread_dough); + \path [line] (bake_next_day_check) -- node{Yes} (make_bread_dough); \node [decision, right of=use_starter, node distance=3cm] (bake_next_week_check) {Baking in next 2 weeks?}; \node [block, right of=bake_next_week_check, node distance=3.5cm] (store_fridge) {Store starter in fridge at \qty{4}{\degreeCelsius} (\qty{40}{\degF})}; - \path [line] (bake_next_week_check) -- node{yes} (store_fridge); + \path [line] (bake_next_week_check) -- node{Yes} (store_fridge); \node [success, right of=store_fridge, node distance=3cm] (feed_after_fridge) {Feed again using 1:5:5 ratio \qtyrange{8}{12}{\hour} before making dough}; \path [line] (store_fridge) -- (feed_after_fridge); - \path [line] (bake_next_day_check) -- node{no} (bake_next_week_check); + \path [line] (bake_next_day_check) -- node{No} (bake_next_week_check); \node [decision, below of=use_starter, node distance=3cm] (freezer_check) {Have a freezer?}; \path [line] (bake_next_week_check) -- (store_fridge); - \path [line] (bake_next_week_check) -- node{no} (freezer_check); + \path [line] (bake_next_week_check) -- node{No} (freezer_check); \node [block, right of=freezer_check, node distance=3cm] (dry_starter) {Dry your starter}; \node [block, below of=dry_starter, node distance=3cm] (freeze_starter) {Freeze your starter}; - \path [line] (freezer_check) -- node{no} (dry_starter); - \path [line] (freezer_check) -- node{yes} (freeze_starter); + \path [line] (freezer_check) -- node{No} (dry_starter); + \path [line] (freezer_check) -- node{Yes} (freeze_starter); \node [success, right of=dry_starter, node distance=3.5cm] (reactivate_freezer) {Reactivate starter for 3 days with daily 1:5:5 feedings}; \path [line] (dry_starter) -- (reactivate_freezer); \path [line] (freeze_starter) -- (reactivate_freezer); diff --git a/book/figures/fig-starter-readiness.tex b/book/figures/fig-starter-readiness.tex index 50a6212..fa874fa 100644 --- a/book/figures/fig-starter-readiness.tex +++ b/book/figures/fig-starter-readiness.tex @@ -23,16 +23,16 @@ {Prepare dough}; \path [line] (init) -- (decision_start); - \path [line] (decision_start) -- node{no} (feed_no_branch); + \path [line] (decision_start) -- node{No} (feed_no_branch); \path [line] (decision_start) -- node[below=2pt]{yes} (feed_yes_branch.north west); \path [line] (feed_yes_branch) -- (low_ratio); \path [line] (feed_no_branch) -- (high_ratio); \path [line] (high_ratio) -- node[anchor=east, above=2pt] {} ++(2.2,0) |-(size_check); \path [line] (low_ratio) -- (size_check); - \path [line] (size_check) -- node{no} (feed_yes_branch.south east); - \path [line] (size_check) -- node{yes} (smell_check); - \path [line] (smell_check) -- node{no} (feed_yes_branch.south west); - \path [line] (smell_check) -- node{yes} (make_dough); + \path [line] (size_check) -- node{No} (feed_yes_branch.south east); + \path [line] (size_check) -- node{Yes} (smell_check); + \path [line] (smell_check) -- node{No} (feed_yes_branch.south west); + \path [line] (smell_check) -- node{Yes} (make_dough); % braces \draw[BC] (size_check.south) -- diff --git a/book/figures/fig-stiff-starter-conversion.tex b/book/figures/fig-stiff-starter-conversion.tex index 1a6d9ab..b37928d 100644 --- a/book/figures/fig-stiff-starter-conversion.tex +++ b/book/figures/fig-stiff-starter-conversion.tex @@ -11,14 +11,14 @@ \path [line] (init) -- (feed_new_ratio); \path [line] (feed_again) -- (feed_new_ratio); \path [line] (next_day) -- (ready_signs); - \path [line] (ready_signs) -- node{no} (feed_again |- last_feed) -| (feed_again.south); - \path [line] (ready_signs) -- node{yes} (last_feed); + \path [line] (ready_signs) -- node{No} (feed_again |- last_feed) -| (feed_again.south); + \path [line] (ready_signs) -- node{Yes} (last_feed); \path [line] (last_feed) -- node{after \qtyrange{6}{12}{\hour}} (bread_dough); \path [line] (feed_new_ratio) -- (too_dry); \path [line] (add_water.north) -- node{} ++(0, 1.3) -| (too_dry.north); - \path [line] (too_dry) -- node{no} (next_day); - \path [line] (too_dry) -- node{yes} (add_water); - \path [line] (ready_signs) -- node{yes} (last_feed); + \path [line] (too_dry) -- node{No} (next_day); + \path [line] (too_dry) -- node{Yes} (add_water); + \path [line] (ready_signs) -- node{Yes} (last_feed); % TODO: find a better way to position the Repeat 3 times text and arrow. Hard-coded values are finicky and don't work well across media. \draw [line] ($ (feed_again.east) +(0.7cm, 0.9cm)$) arc (220:-45:1cm); \node [anchor=north, text width=5em] at ($(feed_again.east)+(1.9cm, 2cm)$) {Repeat 3~times}; diff --git a/book/figures/fig-wheat-sourdough-process.tex b/book/figures/fig-wheat-sourdough-process.tex index a549d83..660ae8b 100644 --- a/book/figures/fig-wheat-sourdough-process.tex +++ b/book/figures/fig-wheat-sourdough-process.tex @@ -13,8 +13,8 @@ \path [line] (mix_ingredients) -- (dough_strength); \path [line] (dough_strength) -- (bulk); \path [line] (bulk) -- (divide_test); - \path [line] (divide_test) -- node{yes} (shape); - \path [line] (divide_test) -- node{no} (divide); + \path [line] (divide_test) -- node{Yes} (shape); + \path [line] (divide_test) -- node{No} (divide); \path [line] (divide) -- (preshape); \path [line] (preshape) -- (shape); \path [line] (shape) -- (proof); From bcdaf794798460999d558358d225b82854b1bdd2 Mon Sep 17 00:00:00 2001 From: Ced Date: Sat, 11 Jan 2025 11:01:49 +0000 Subject: [PATCH 12/25] Fix merge error in starter-process flowchart --- book/figures/fig-starter-process.tex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/book/figures/fig-starter-process.tex b/book/figures/fig-starter-process.tex index 7a5312b..fc6be06 100644 --- a/book/figures/fig-starter-process.tex +++ b/book/figures/fig-starter-process.tex @@ -1,5 +1,5 @@ \begin{tikzpicture}[node distance = 3.5cm, auto] - \node [start, below of=discard, left of=discard] (start_n) {Mix \qty{50}{\gram} flour + \qty{50}{\gram} water, stir}; + \node [start] (start_n) {Mix \qty{50}{\gram} flour + \qty{50}{\gram} water, stir}; \node [block, right of=start_n, node distance = 3.5cm] (wait_n) {Wait\\ \qty{24}{\hour}}; \node [decision, right of=wait_n, node distance = 3.5cm] (readycheck_n) {Ready?}; \node [block, below of=wait_n, node distance = 3.2cm] (feed_n) {Feed the mixture }; From d1e3390360f0323b475d378a694677dbd809dd77 Mon Sep 17 00:00:00 2001 From: Ced Date: Sat, 11 Jan 2025 11:09:16 +0000 Subject: [PATCH 13/25] Fix more uppercase in flowcharts --- book/figures/fig-bulk-fermentation.tex | 4 ++-- book/figures/fig-liquid-starter-conversion.tex | 2 +- book/figures/fig-starter-readiness.tex | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/book/figures/fig-bulk-fermentation.tex b/book/figures/fig-bulk-fermentation.tex index b46dc73..3531320 100644 --- a/book/figures/fig-bulk-fermentation.tex +++ b/book/figures/fig-bulk-fermentation.tex @@ -21,8 +21,8 @@ \path [draw, thick] (ph_value) -- node{} ++(2, 0); \path [draw, thick] (smell) -| node{} ++(2, 4); \path [line] (dough_ready) -- node{Yes} (divide_preshape); - \path [line] (dough_ready) |- node[right=3pt]{no} (dough_flattened); - \path [line] (dough_flattened) |- node[right=3pt]{yes} (stretch_fold); + \path [line] (dough_ready) |- node[right=3pt]{No} (dough_flattened); + \path [line] (dough_flattened) |- node[right=3pt]{Yes} (stretch_fold); \path [line] (dough_flattened) -- node{No} (wait_60_minutes); \path [line] (stretch_fold) -- (wait_60_minutes); \path [line] (wait_60_minutes) -- (check_dough); diff --git a/book/figures/fig-liquid-starter-conversion.tex b/book/figures/fig-liquid-starter-conversion.tex index d4ffb16..bd8811c 100644 --- a/book/figures/fig-liquid-starter-conversion.tex +++ b/book/figures/fig-liquid-starter-conversion.tex @@ -9,7 +9,7 @@ \path [line] (feed_new_ratio) -- node{Wait \qty{24}{\hour}} (ready_signs); \path [line] (feed_again) -- node[anchor=east] {} ++(2.2,0) |- (feed_new_ratio); \path [line] (ready_signs) -- node{No} (feed_again); - \path [line] (ready_signs) -- node[above=2pt]{~yes} (last_feed); + \path [line] (ready_signs) -- node[above=2pt]{~Yes} (last_feed); \path [line] (last_feed) -- node{after \qtyrange{6}{12}{\hour}} (bread_dough); % TODO: find a better way to position the Repeat 3 times text and arrow. Hard-coded values are finicky and don't work well across media. \draw [line] ($ (feed_again.north) +(0.7cm, 1cm)$) arc (-45:220:1cm); diff --git a/book/figures/fig-starter-readiness.tex b/book/figures/fig-starter-readiness.tex index fa874fa..499485c 100644 --- a/book/figures/fig-starter-readiness.tex +++ b/book/figures/fig-starter-readiness.tex @@ -24,7 +24,7 @@ \path [line] (init) -- (decision_start); \path [line] (decision_start) -- node{No} (feed_no_branch); - \path [line] (decision_start) -- node[below=2pt]{yes} (feed_yes_branch.north west); + \path [line] (decision_start) -- node[below=2pt]{Yes} (feed_yes_branch.north west); \path [line] (feed_yes_branch) -- (low_ratio); \path [line] (feed_no_branch) -- (high_ratio); \path [line] (high_ratio) -- node[anchor=east, above=2pt] {} ++(2.2,0) |-(size_check); From 374fb7adfacb7310965846b9fbfbb0833d003c21 Mon Sep 17 00:00:00 2001 From: Ced Date: Sun, 12 Jan 2025 12:16:58 +0000 Subject: [PATCH 14/25] Delete rogue draft file --- book/figures/fig-compet.tex | 54 ------------------------------------- 1 file changed, 54 deletions(-) delete mode 100644 book/figures/fig-compet.tex diff --git a/book/figures/fig-compet.tex b/book/figures/fig-compet.tex deleted file mode 100644 index 244a5c1..0000000 --- a/book/figures/fig-compet.tex +++ /dev/null @@ -1,54 +0,0 @@ -\begin{tikzpicture}[node distance=1cm] - -% Left Side: Antifungal metabolites -% Bacteria -\draw[thick, fill=gray!20] (-2, 2.5) ellipse (1.2cm and 0.5cm); -\node at (-2, 3.2) {Antifungal metabolites}; - -% Arrows for antifungal metabolites -\foreach \x in {-2.5, -2, -1.5} - \draw[thick, ->] (\x, 2) -- (\x, 1.2); - -% Antifungal metabolites (triangles) -\foreach \x in {-2.5, -2, -1.5} - \node[fill=red!80!black, regular polygon, regular polygon sides=3, draw, scale=0.7] at (\x, 1.2) {}; - -% Fungi (left) -\draw[thick, fill=gray!50] (-2, 0.5) circle (0.5cm); -\node at (-2, -0.2) {Fungi}; - -% Right Side: Nutrient Competition -% Bacteria -\draw[thick, fill=gray!20] (3, 2.5) ellipse (1.2cm and 0.5cm); -\node at (3, 3.2) {Competition for nutrients}; - -% Arrows for nutrients -\foreach \x in {2.5, 3, 3.5} - \draw[thick, <-] (\x, 2) -- (\x, 1.2); - -% Available nutrients (triangles) -\foreach \x in {2.5, 3, 3.5} - \node[fill=green!80!black, regular polygon, regular polygon sides=3, draw, scale=0.7, rotate=180] at (\x, 1.2) {}; - -% Fungi (right) -\draw[thick, fill=gray!50] (3, 0.5) circle (0.5cm); -\node at (3, -0.2) {Fungi}; - -% Legends -% Bacteria legend -\draw[thick, fill=gray!20] (-5.5, -2) ellipse (0.8cm and 0.3cm); -\node[anchor=west] at (-5, -2) {Bacteria}; - -% Fungi legend -\draw[thick, fill=gray!50] (-5.5, -3) circle (0.3cm); -\node[anchor=west] at (-5, -3) {Fungi}; - -% Antifungal metabolites legend -\node[fill=red!80!black, regular polygon, regular polygon sides=3, draw, scale=0.7] at (-5.5, -4) {}; -\node[anchor=west] at (-5, -4) {Antifungal metabolites}; - -% Available nutrients legend -\node[fill=green!80!black, regular polygon, regular polygon sides=3, draw, scale=0.7, rotate=180] at (-5.5, -5) {}; -\node[anchor=west] at (-5, -5) {Available nutrients}; - -\end{tikzpicture} From 3b8dfd8d81eb1bcc52fca76af089633d41387cee Mon Sep 17 00:00:00 2001 From: Ramin Kamal <21167874+ramink@users.noreply.github.com> Date: Mon, 13 Jan 2025 09:35:40 -0800 Subject: [PATCH 15/25] Layout "Repeat 3 Times" loops in better way. --- book/figures/fig-liquid-starter-conversion.tex | 6 +++--- book/figures/fig-stiff-starter-conversion.tex | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/book/figures/fig-liquid-starter-conversion.tex b/book/figures/fig-liquid-starter-conversion.tex index bd8811c..c758ad8 100644 --- a/book/figures/fig-liquid-starter-conversion.tex +++ b/book/figures/fig-liquid-starter-conversion.tex @@ -11,7 +11,7 @@ \path [line] (ready_signs) -- node{No} (feed_again); \path [line] (ready_signs) -- node[above=2pt]{~Yes} (last_feed); \path [line] (last_feed) -- node{after \qtyrange{6}{12}{\hour}} (bread_dough); - % TODO: find a better way to position the Repeat 3 times text and arrow. Hard-coded values are finicky and don't work well across media. - \draw [line] ($ (feed_again.north) +(0.7cm, 1cm)$) arc (-45:220:1cm); - \node [anchor=north, text width=5em] at ($(feed_again.north west)+(1.55cm, 2.2cm)$) {Repeat 3~times}; + + \node [above of=feed_again, text width=5em, align=center, node distance=3cm] (repeat_text) {Repeat 3~times}; + \draw [line] ($(repeat_text) +(0, 1 cm)$) arc (90:420:1cm); \end{tikzpicture} diff --git a/book/figures/fig-stiff-starter-conversion.tex b/book/figures/fig-stiff-starter-conversion.tex index b37928d..fe8d3d9 100644 --- a/book/figures/fig-stiff-starter-conversion.tex +++ b/book/figures/fig-stiff-starter-conversion.tex @@ -19,7 +19,7 @@ \path [line] (too_dry) -- node{No} (next_day); \path [line] (too_dry) -- node{Yes} (add_water); \path [line] (ready_signs) -- node{Yes} (last_feed); - % TODO: find a better way to position the Repeat 3 times text and arrow. Hard-coded values are finicky and don't work well across media. - \draw [line] ($ (feed_again.east) +(0.7cm, 0.9cm)$) arc (220:-45:1cm); - \node [anchor=north, text width=5em] at ($(feed_again.east)+(1.9cm, 2cm)$) {Repeat 3~times}; + + \node [text width=5em, align=center] (repeat_text) at ($(feed_new_ratio)!0.5!(next_day)$) {Repeat 3~times}; + \draw [line] ($(repeat_text) +(0, 1 cm)$) arc (90:-210:1cm); \end{tikzpicture} From e73b0f331a2164aadc3c9f287e913a44a9ce0e9c Mon Sep 17 00:00:00 2001 From: Cedric Date: Sun, 12 Jan 2025 15:17:12 +0000 Subject: [PATCH 16/25] Use a sans-serif math font for pgfplots pgfplots uses math fonts for graphs ticks... and it looks weird when building sans serif. Not sure Fira is necessarily a great choice with open-sans but we have very little math so that should do... --- book/sourdough.sty | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/book/sourdough.sty b/book/sourdough.sty index fe2f1ca..d38a7cd 100644 --- a/book/sourdough.sty +++ b/book/sourdough.sty @@ -52,8 +52,9 @@ \DeclareRobustCommand\sbseries{\fontseries{sb}\selectfont} % Fonts for accessibility \ifdefined\isaccessible - \setmainfont{Open Sans}[ - Scale=MatchLowercase] + \usepackage[mathrm=sym]{unicode-math} + \setmathfont{Fira Math}[Scale=MatchLowercase] + \setmainfont{Open Sans}[Scale=MatchLowercase] \else \setmainfont{TeX Gyre Pagella}[Scale=1.0] % Or Palatino Linotype, etc. % TODO not available on github CI From 2c865299810ba8c453bc3bd05671e983a3fd47ec Mon Sep 17 00:00:00 2001 From: Cedric Date: Sat, 18 Jan 2025 15:14:34 +0000 Subject: [PATCH 17/25] Use sans-serif fonts with tex4ht This has to be done in the config file..: All fonts are suppressed in the --lua mode of TeX4ht, because we need to prevent the loading of OpenType fonts, which causes a fatal error.: https://tex.stackexchange.com/questions/705948/change-font-of-tikz-diagrams-in-html-produced-by-make4ht --- book/tex4ebook.cfg | 8 ++++++++ book/website.cfg | 8 ++++++++ 2 files changed, 16 insertions(+) diff --git a/book/tex4ebook.cfg b/book/tex4ebook.cfg index 43adcf5..dffea80 100644 --- a/book/tex4ebook.cfg +++ b/book/tex4ebook.cfg @@ -11,4 +11,12 @@ \Configure{AddCss}{book-ebook.css} \Configure{CoverMimeType}{image/jpeg} \CoverMetadata{cover/cover-page.jpg} +\AddToHook{env/tikzpicture/begin}{\fontfamily{opensans-TLF}\selectfont} +\Configure{@HEAD}{\HCode{ +}} \EndPreamble diff --git a/book/website.cfg b/book/website.cfg index aa15921..f236b6e 100644 --- a/book/website.cfg +++ b/book/website.cfg @@ -9,6 +9,14 @@ }} \Configure{AddCss}{style.css} +\AddToHook{env/tikzpicture/begin}{\fontfamily{opensans-TLF}\selectfont} +\Configure{@HEAD}{\HCode{ +}} \ConfigureEnv{titlepage}{\ifvmode\IgnorePar\fi\EndP\HCode{
}}{\ifvmode\IgnorePar\fi\EndP\HCode{
}}{}{} % Mini TOC From d0a5d6d37e7fb4fc741932b68d3934c83abf2791 Mon Sep 17 00:00:00 2001 From: Hendrik Kleinwaechter Date: Mon, 20 Jan 2025 11:23:55 +0100 Subject: [PATCH 18/25] Fix duplicate font loading --- book/style.css | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/book/style.css b/book/style.css index b0ee324..ad0a49e 100644 --- a/book/style.css +++ b/book/style.css @@ -1,5 +1,3 @@ -@import url('https://fonts.googleapis.com/css2?family=Open+Sans:wght@400;800&display=swap'); - :root{ --ff-sans: 'Open Sans', sans-serif; --fw-regular: 400; @@ -147,7 +145,6 @@ nav.TOC a, nav.TOC a:visited{ /* *** Colors *** */ /* ************** */ - body{ background-color: var(--c-beige); } @@ -254,6 +251,10 @@ figcaption.caption { display: block; } +.chapterToc a, .chapterToc, .likechapterToc a, .likechapterToc, .appendixToc a, .appendixToc, .addchapToc a { + font-weight: var(--fw-bold); +} + @media (max-width: 768px) { .toggle-menu-label { display: block; @@ -317,7 +318,7 @@ figcaption.caption { display: block; color: #000; font-size: 20px; - font-weight: bold; + font-weight: var(--fw-bold); } .chapterToc a, .sectionToc a, .subsectionToc a, .likechapterToc a { @@ -498,7 +499,7 @@ blockquote { border: 2px solid var(--c-black); color: var(--c-black); padding: 4px; - font-weight: bold; + font-weight: var(--fw-bold); text-decoration: none; } .crosslinks-bottom a.prev { From 75b015cda6aa36cc7194d6a02306fc60c0d44663 Mon Sep 17 00:00:00 2001 From: Ced Date: Sat, 11 Jan 2025 18:57:34 +0000 Subject: [PATCH 19/25] Remove debug flag on default website build --- book/makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/book/makefile b/book/makefile index 80ef205..8d55d1e 100644 --- a/book/makefile +++ b/book/makefile @@ -1,7 +1,7 @@ # Macros for commands LATEX := latexmk -cd -pdflua -lualatex="lualatex -interaction=nonstopmode" -synctex=1 -use-make EBOOK := tex4ebook --lua -d epub -f epub -c tex4ebook.cfg -B epub_build -WEBSITE := make4ht --lua -c website.cfg -a debug -uf html5+tidy+common_domfilters -B website_build +WEBSITE := make4ht --lua -c website.cfg -uf html5+tidy+common_domfilters -B website_build CLEAN := latexmk -cd -lualatex -c -use-make CHECK_1 := lacheck CHECK_2 := chktex From 7f2f010571f0babe746452914435bbbd9813af9c Mon Sep 17 00:00:00 2001 From: Ced Date: Sat, 11 Jan 2025 19:02:27 +0000 Subject: [PATCH 20/25] Simplify the epub size check --- book/makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/book/makefile b/book/makefile index 8d55d1e..70faccb 100644 --- a/book/makefile +++ b/book/makefile @@ -13,7 +13,6 @@ REDUCE_PIC_COLOR := -quality 80\% RSYNC := rsync -au --exclude 'book.epub' --exclude '*.jpg' GIT := git --no-pager SPELL_CHECK := hunspell -t -l -d en_US -EPUBSIZE := `du -sb epub/low_res_book.epub | cut -f1` # We want bash as shell SHELL := $(shell if [ -x "$$BASH" ]; then echo $$BASH; \ @@ -304,7 +303,8 @@ release_serif: build_serif_pdf build_ebook build_bw_ebook build_low_res_ebook | cp book_serif/book.pdf release/TheBreadCode-The-Sourdough-Framework.pdf cp epub/bw_book.epub release/TheBreadCode-The-Sourdough-Framework-black-and-white.epub cp epub/low_res_book.epub release/TheBreadCode-The-Sourdough-Framework.epub - @if [ $(EPUBSIZE) -gt 49500000 ]; then \ + # Kindle does not allow files larger than 50 MB... so let's check + @if [ `du -sb epub/low_res_book.epub | cut -f1` -gt 49500000 ]; then \ echo "ERROR: epub File too big"; \ exit 1; \ fi From a93a19d40dd123f0b33b87fd9849f6fb838e102b Mon Sep 17 00:00:00 2001 From: Ced Date: Sat, 11 Jan 2025 20:05:34 +0000 Subject: [PATCH 21/25] Reorder and add comments in makefile Also added markers {{{ for folding --- book/makefile | 354 ++++++++++++++++++++++++++++---------------------- 1 file changed, 198 insertions(+), 156 deletions(-) diff --git a/book/makefile b/book/makefile index 70faccb..ed3dce6 100644 --- a/book/makefile +++ b/book/makefile @@ -1,4 +1,4 @@ -# Macros for commands +# Macros for commands {{{ LATEX := latexmk -cd -pdflua -lualatex="lualatex -interaction=nonstopmode" -synctex=1 -use-make EBOOK := tex4ebook --lua -d epub -f epub -c tex4ebook.cfg -B epub_build WEBSITE := make4ht --lua -c website.cfg -uf html5+tidy+common_domfilters -B website_build @@ -24,25 +24,35 @@ LATEX += -diagnostics EBOOK += -a debug WEBSITE += -a debug endif +# }}} -website_dir := static_website_html +# Default target is not all because most of the time we just want a pdf... +# and building everything take a long time. +.DEFAULT_GOAL := build_serif_pdf -# List all files that are dependencies +# List all files that are dependencies {{{ chapters = baking basics bread-types cover flour-types history intro mix-ins\ non-wheat-sourdough sourdough-starter storing-bread troubleshooting\ wheat-sourdough glossary +# Actual book text and LaTeX code {{{ +src_tex := $(foreach directory, $(chapters), $(wildcard $(directory)/*.tex)) +src_tex += book.tex book_sans_serif.tex references.bib figures/vars.tex +src_tex += supporters.csv sourdough.sty colors.tex abbreviations.tex +src_tex += $(src_recipes) +# }}} + +# Tables and TikZ flowcharts/plots/drawings... {{{ src_tables := $(wildcard tables/table-*.tex) src_figures := $(wildcard figures/fig-*.tex) figures/flowcharts_tikz.tex src_figures += $(wildcard plots/fig-*.tex) abbreviations.tex colors.tex src_recipes := $(wildcard recipes/*.tex) src_plots := $(wildcard plots/*.table) +# }}} -src_tex := $(foreach directory, $(chapters), $(wildcard $(directory)/*.tex)) -src_tex += book.tex book_sans_serif.tex references.bib figures/vars.tex -src_tex += supporters.csv sourdough.sty colors.tex abbreviations.tex -src_tex += $(src_recipes) +tgt_figures := $(patsubst %.tex, %.png,$(src_figures)) +# Photos {{{ images := $(wildcard images/*/*.jpg) images += $(wildcard images/*.jpg) images += $(wildcard images/*.png) @@ -56,37 +66,30 @@ images += $(foreach directory, $(chapters), $(wildcard $(directory)/*/*.png)) # images to lower resolution and greyscale bw_images := $(addprefix bw-book-epub/OEBPS/, $(images)) -# For lower res colour ebook we would not convert png as it only get worst -# we will copy them instead... so remove them as a dependency. +# For lower resolution colour ebook (see below) we will not convert png as it +# only get worst we will copy them instead... so remove them as a dependency. low_res_images := $(addprefix low-res-book-epub/OEBPS/, $(images)) low_res_images := $(filter-out %.png, $(low_res_images)) +# }}} +# All together. src_all := $(src_tex) $(src_figures) $(src_tables) $(images) $(src_plots) +# And format specific configurations ebook_src := $(src_all) tex4ebook.cfg book.mk4 book-ebook.css website_src := $(src_all) website.cfg style.css - -# This is more than what is actually needed but keeps the makefile simple -# and latexmk will handle the rest -booklet_src := $(src_figures) $(src_tables) $(src_recipes) $(images) -booklet_src += booklet.tex - +website_dir := static_website_html website_assets := $(wildcard ../website/assets/*) ruby_src := ../website/modify_build.rb $(website_assets) ruby_pkg := ../website/Gemfile ../website/Gemfile.lock -tgt_figures := $(patsubst %.tex, %.png,$(src_figures)) - -# Default target is not all because most of the time we just want a pdf... -# and ebook take a long time to build. -.DEFAULT_GOAL := build_serif_pdf - -# Default rules for pdf and ebooks, getting overwritten when built in a -# sub-directory -%.pdf: %.tex - $(LATEX) $< +# This is more than what is actually needed but keeps the makefile simple +booklet_src := $(src_figures) $(src_tables) $(src_recipes) $(images) +booklet_src += booklet.tex +# }}} +# Flowcharts {{{ # TODO: check if it works on github CI %.png: %.tex @printf '%s\n' "\input{./vars.tex}" > $@.in @@ -98,12 +101,12 @@ tgt_figures := $(patsubst %.tex, %.png,$(src_figures)) %.xbb: %.jpg ebb -x $< +# }}} -# We don't want to use latexmk as there is no biber nor references and it -# seems to make it somehow unhappy -booklet/booklet.pdf: $(booklet_src) - mkdir -p booklet - lualatex --output-directory=booklet booklet.tex +# pdf {{{ +# Default rules for pdf, getting overwritten when built in a sub-directory +%.pdf: %.tex + $(LATEX) $< book_serif/book.pdf: $(src_all) $(LATEX) -output-directory=book_serif book.tex @@ -111,16 +114,25 @@ book_serif/book.pdf: $(src_all) book_sans_serif/book_sans_serif.pdf: $(src_all) $(LATEX) -output-directory=book_sans_serif book_sans_serif.tex -.PHONY: copy_ebook_files copy_ebook_files_low_res +# We don't want to use latexmk as there is no biber nor references and it +# seems to make it somehow unhappy +booklet/booklet.pdf: $(booklet_src) + mkdir -p booklet + lualatex --output-directory=booklet booklet.tex +# }}} +# Ebook {{{ +################################### +.PHONY: copy_ebook_files copy_ebook_files_low_res epub/%.epub: %.tex $(ebook_src) cover/cover-page.xbb $(EBOOK) $< -copy_ebook_files: build_ebook - $(RSYNC) --exclude '*.png' epub_build/book-epub/ bw-book-epub/ - -copy_ebook_files_low_res: build_ebook - $(RSYNC) epub_build/book-epub/ low-res-book-epub/ +# Now that we have built the ebook we will generate 2 more versions +# +# 1) With kindle app on phone we want a colour version with size < 50 MB +# 2) A black-white version for actual eink readers +# +# In both cases we just convert images and repack the ebpub # We do not convert SVG to B&W or lower res for now as they are super small # anyway @@ -132,23 +144,158 @@ bw-book-epub/OEBPS/%.png: %.png mkdir -p $(dir $@) $(CONVERT_PIC) $< $(REDUCE_PIC) $@ -low-res-book-epub/OEBPS/%.jpg: %.jpg - mkdir -p $(dir $@) - $(CONVERT_PIC) $< $(REDUCE_PIC_COLOR) $@ - epub/bw_book.epub: copy_ebook_files $(bw_images) cd bw-book-epub; zip -q0X ../epub/bw_book.epub mimetype cd bw-book-epub; zip -q9XrD ../epub/bw_book.epub ./ +# Now the low res +copy_ebook_files: build_ebook + $(RSYNC) --exclude '*.png' epub_build/book-epub/ bw-book-epub/ + +low-res-book-epub/OEBPS/%.jpg: %.jpg + mkdir -p $(dir $@) + $(CONVERT_PIC) $< $(REDUCE_PIC_COLOR) $@ + epub/low_res_book.epub: copy_ebook_files_low_res $(low_res_images) cd low-res-book-epub; zip -q0X ../epub/low_res_book.epub mimetype cd low-res-book-epub; zip -q9XrD ../epub/low_res_book.epub ./ +#}}} -# Now with the rules +# Website {{{ +################################### +.PHONY: html website +$(website_dir)/book_sans_serif.html: $(website_src) cover/cover-page.xbb + $(WEBSITE) -d $(website_dir) book_sans_serif.tex + +html: $(website_dir)/book_sans_serif.html + cp $< $(website_dir)/index.html + +# Because packages will be installed in hard to predict places use a file as +# marker.. +../website/_bundle_install_done: $(ruby_pkg) + -rm ../website/$@ + cd ../website && bundle install + touch ../website/$@ + +# TODO: this will run every single time, but is so fast we don't really care +website: html ../website/_bundle_install_done $(ruby_src) + cd ../website && ruby modify_build.rb +#}}} + +# Figures only {{{ +################################### +.PHONY: export_figures +# Requires that you have docker running on your computer. +export_figures: build_pdf $(tgt_figures) + cd figures/ && bash export_figures.sh +# }}} + +# Now with the rules {{{ # Expected usual rules first .PHONY: all all: bake +# Finally actual project targets (i.e. build pdf and ebooks) +.PHONY: build_pdf build_booklet build_serif_pdf build_sans_serif_pdf build_ebook + +pdf: build_serif_pdf build_sans_serif_pdf +build_pdf: pdf + +booklet: booklet/booklet.pdf +build_booklet: booklet + +serif: book_serif/book.pdf +build_serif_pdf: serif + +sans_serif: book_sans_serif/book_sans_serif.pdf +build_sans_serif_pdf: sans_serif + +ebook: epub/book_sans_serif.epub +build_ebook: ebook + +bw_ebook: epub/bw_book.epub +build_bw_ebook: bw_ebook + +low_res_ebook: epub/low_res_book.epub +build_low_res_ebook: low_res_ebook + +# top level releases rules +.PHONY: bake release_serif release_sans_serif + +bake: release_serif release_sans_serif release_booklet website + +release: + mkdir -p release + +release_serif: build_serif_pdf build_ebook build_bw_ebook build_low_res_ebook | release + cp book_serif/book.pdf release/TheBreadCode-The-Sourdough-Framework.pdf + cp epub/bw_book.epub release/TheBreadCode-The-Sourdough-Framework-black-and-white.epub + cp epub/low_res_book.epub release/TheBreadCode-The-Sourdough-Framework.epub + # Kindle does not allow files larger than 50 MB... so let's check + @if [ `du -sb epub/low_res_book.epub | cut -f1` -gt 49500000 ]; then \ + echo "ERROR: epub File too big"; \ + exit 1; \ + fi + +release_sans_serif: build_sans_serif_pdf | release + cp book_sans_serif/book_sans_serif.pdf release/TheBreadCode-The-Sourdough-Framework-sans-serif.pdf + +release_booklet: build_booklet | release + cp booklet/booklet.pdf release/TheBreadCode-The-Sourdough-Framework-booklet.pdf +# }}} + +# Clean up {{{ +################################### + +# delete generated files +.PHONY: clean_figures clean_ebook_build clean_website_build clean mrproper +clean_figures: + -$(CLEAN) $(patsubst %.tex, %.png.in, $(src_figures)) + -rm $(patsubst %.tex, %.png.pdf, $(src_figures)) + -rm $(patsubst %.tex, %.png.in, $(src_figures)) + -rm $(wildcard figures/*.png.*) + -rm cover/cover-page.xbb + +clean_ebook_build: + -rm epub_build/book*.{4ct,4tc,aux,bbl,bcf,blg,dvi,fdb_latexmk,fls,html} + -rm epub_build/book*.{idv,lg,loc,log,ncx,run.xml,tmp,xref} + -rm epub_build/book*x.svg + -rm epub_build/book.css + -rm epub_build/content.opf + -rm epub_build/book-epub/mimetype + -rm -rf epub_build/book-epub/META-INF + -rm -rf epub_build/book-epub/OEBPS + +clean_website_build: + -rm website_build/book*.{4ct,4tc,aux,bbl,bcf,blg,dvi,fdb_latexmk,fls,html} + -rm website_build/book*.{idv,lg,loc,log,ncx,run.xml,tmp,xref} + -rm website_build/book.{loc,dlog} + +clean: clean_ebook_build clean_figures clean_website_build + $(CLEAN) -output-directory=book_serif book.tex + $(CLEAN) -output-directory=book_sans_serif book_sans_serif.tex + $(CLEAN) -output-directory=booklet booklet.tex + -rm book*/*.{bbl,loc,run.xml} + +mrproper: clean + $(CLEAN) -C $(src_figures) + $(CLEAN) -C -output-directory=book_serif book.tex + $(CLEAN) -C -output-directory=book_sans_serif book_sans_serif.tex + $(CLEAN) -C -output-directory=booklet booklet.tex + -rm figures/*.png + -rm -rf epub/ + -rm -rf release/ + -rm -rf book_serif/ + -rm -rf book_sans_serif/ + -rm -rf booklet/ + -rm -rf *book-epub/ + -rm -rf epub_build/ + -rm -rf website_build/ + -rm -rf $(website_dir) +#}}} + +# Help {{{ +################################### .PHONY: help help: @echo "" @@ -204,30 +351,13 @@ help: @echo " print-X: print makefile variable X" @echo "" @echo "set DEBUG i.e make DEBUG=1 build_ebook to add debug flags to commands" +# }}} +# Debug Stuff from now on {{{ +################################### -# Finally actual project targets (i.e. build pdf and ebooks) -.PHONY: build_pdf build_booklet build_serif_pdf build_sans_serif_pdf build_ebook - -build_pdf: build_serif_pdf build_sans_serif_pdf - -build_booklet: booklet/booklet.pdf - -build_serif_pdf: book_serif/book.pdf - -build_sans_serif_pdf: book_sans_serif/book_sans_serif.pdf - -build_ebook: epub/book.epub - -build_bw_ebook: epub/bw_book.epub - -build_low_res_ebook: epub/low_res_book.epub - -.PHONY: export_figures check tex-check spell-check -# Requires that you have docker running on your computer. -export_figures: build_pdf $(tgt_figures) - cd figures/ && bash export_figures.sh - +# Verify your spelling and TeX warnings {{{ +.PHONY: check tex-check spell-check # Goal is not really to have 0 warning reported but we should check we don't # add many and if we do, we know they are false positive check: spell-check tex-check @@ -239,104 +369,14 @@ tex-check: $(src_tex) @echo "Running: " $(CHECK_2) $(CHECK_2) book.tex +# Should be 0 if not and you are really sure update the exception file spell-check: $(src_tex) spelling_exceptions.txt # Generate exceptions this way to avoid false positives # hunspell -t -l -d en_US **/*.tex *.csv *.sty *.sty | cut -f 2 -d ':' | sort -u > spelling_exceptions.txt $(SPELL_CHECK) -p spelling_exceptions.txt $(src_tex) +#}}} - -# Clean up and delete generated files -.PHONY: clean_figures clean_ebook_build clean_website_build clean mrproper -clean_figures: - -$(CLEAN) $(patsubst %.tex, %.png.in, $(src_figures)) - -rm $(patsubst %.tex, %.png.pdf, $(src_figures)) - -rm $(patsubst %.tex, %.png.in, $(src_figures)) - -rm $(wildcard figures/*.png.*) - -rm cover/cover-page.xbb - -clean_ebook_build: - -rm epub_build/book*.{4ct,4tc,aux,bbl,bcf,blg,dvi,fdb_latexmk,fls,html} - -rm epub_build/book*.{idv,lg,loc,log,ncx,run.xml,tmp,xref} - -rm epub_build/book*x.svg - -rm epub_build/book.css - -rm epub_build/content.opf - -rm epub_build/book-epub/mimetype - -rm -rf epub_build/book-epub/META-INF - -rm -rf epub_build/book-epub/OEBPS - -clean_website_build: - -rm website_build/book*.{4ct,4tc,aux,bbl,bcf,blg,dvi,fdb_latexmk,fls,html} - -rm website_build/book*.{idv,lg,loc,log,ncx,run.xml,tmp,xref} - -rm website_build/book.{loc,dlog} - -clean: clean_ebook_build clean_figures clean_website_build - $(CLEAN) -output-directory=book_serif book.tex - $(CLEAN) -output-directory=book_sans_serif book_sans_serif.tex - $(CLEAN) -output-directory=booklet booklet.tex - -rm book*/*.{bbl,loc,run.xml} - -mrproper: clean - $(CLEAN) -C $(src_figures) - $(CLEAN) -C -output-directory=book_serif book.tex - $(CLEAN) -C -output-directory=book_sans_serif book_sans_serif.tex - $(CLEAN) -C -output-directory=booklet booklet.tex - -rm figures/*.png - -rm -rf epub/ - -rm -rf release/ - -rm -rf book_serif/ - -rm -rf book_sans_serif/ - -rm -rf booklet/ - -rm -rf *book-epub/ - -rm -rf epub_build/ - -rm -rf website_build/ - -rm -rf $(website_dir) - -# top level releases rules -.PHONY: bake release_serif release_sans_serif - -bake: release_serif release_sans_serif release_booklet website - -release: - mkdir -p release - -release_serif: build_serif_pdf build_ebook build_bw_ebook build_low_res_ebook | release - cp book_serif/book.pdf release/TheBreadCode-The-Sourdough-Framework.pdf - cp epub/bw_book.epub release/TheBreadCode-The-Sourdough-Framework-black-and-white.epub - cp epub/low_res_book.epub release/TheBreadCode-The-Sourdough-Framework.epub - # Kindle does not allow files larger than 50 MB... so let's check - @if [ `du -sb epub/low_res_book.epub | cut -f1` -gt 49500000 ]; then \ - echo "ERROR: epub File too big"; \ - exit 1; \ - fi - -release_sans_serif: build_sans_serif_pdf | release - cp book_sans_serif/book_sans_serif.pdf release/TheBreadCode-The-Sourdough-Framework-sans-serif.pdf - -release_booklet: build_booklet | release - cp booklet/booklet.pdf release/TheBreadCode-The-Sourdough-Framework-booklet.pdf - -# Website stuff -.PHONY: html website -$(website_dir)/book.html: $(website_src) cover/cover-page.xbb - $(WEBSITE) -d $(website_dir) book.tex - -html: $(website_dir)/book.html - cp $< $(website_dir)/index.html - -# Because packages will be installed in hard to predict places use a file as -# marker.. -../website/_bundle_install_done: $(ruby_pkg) - -rm ../website/$@ - cd ../website && bundle install - touch ../website/$@ - -# TODO: this will run every single time, but is so fast we don't really care -website: html ../website/_bundle_install_done $(ruby_src) - cd ../website && ruby modify_build.rb - -# Debug Stuff from now on .PHONY: quick quick_ebook show_tools_version printvars - # Those 2 targets allow fast debug cycles but not resolving references etc # They also ignore dependencies and run each time you call them. quick: # run latex only once no biber, no references etc... @@ -348,7 +388,7 @@ quick_booklet: quick_ebook: cover/cover-page.xbb # run latex only once no biber, ref etc... $(EBOOK) --mode draft book.tex -show_tools_version: # Show version of tools used on the build machine +show_tools_version: # Show version of tools used on the build machine {{{ - $(GIT) log -1 --pretty=%B @echo "" - uname -a @@ -383,6 +423,7 @@ show_tools_version: # Show version of tools used on the build machine - $(CONVERT_PIC) --version @echo "" - rsync --version +# }}} # You can find the value of variable X with the following command: # make print-X @@ -392,3 +433,4 @@ printvars: # Print all variables in the makefile @$(foreach V,$(sort $(.VARIABLES)), \ $(if $(filter-out environ% default automatic, \ $(origin $V)),$(info $V=$($V) ($(value $V))))) +# }}} From 9e267a2b4b850b2cb9612503188faf62ab7d9494 Mon Sep 17 00:00:00 2001 From: Ced Date: Sat, 11 Jan 2025 20:56:00 +0000 Subject: [PATCH 22/25] Modernize target names in makefile Names might have made sense at some point... but not so sure anymore build_pdf => pdf build_booklet => booklet build_serif_pdf => serif build_sans_serif_pdf => sans_serif build_ebook => ebook build_bw_ebook => bw_ebook build_low_res_ebook => low_res_ebook Old names kept not to break backward compatibility --- .github/workflows/test-book-website.yml | 2 +- book/makefile | 56 ++++++++++++------------- makefile | 17 +++++--- 3 files changed, 39 insertions(+), 36 deletions(-) diff --git a/.github/workflows/test-book-website.yml b/.github/workflows/test-book-website.yml index bd648d9..0686b29 100644 --- a/.github/workflows/test-book-website.yml +++ b/.github/workflows/test-book-website.yml @@ -40,7 +40,7 @@ jobs: options: -v ${{ github.workspace }}:/app run: | cd /app/book - make -j -O build_serif_pdf build_ebook website + make -j -O serif ebook website - name: Upload book Artifacts uses: actions/upload-artifact@v4 with: diff --git a/book/makefile b/book/makefile index ed3dce6..f770741 100644 --- a/book/makefile +++ b/book/makefile @@ -28,7 +28,7 @@ endif # Default target is not all because most of the time we just want a pdf... # and building everything take a long time. -.DEFAULT_GOAL := build_serif_pdf +.DEFAULT_GOAL := serif # List all files that are dependencies {{{ chapters = baking basics bread-types cover flour-types history intro mix-ins\ @@ -149,8 +149,8 @@ epub/bw_book.epub: copy_ebook_files $(bw_images) cd bw-book-epub; zip -q9XrD ../epub/bw_book.epub ./ # Now the low res -copy_ebook_files: build_ebook - $(RSYNC) --exclude '*.png' epub_build/book-epub/ bw-book-epub/ +copy_ebook_files_low_res: ebook + $(RSYNC) epub_build/book_sans_serif-epub/ low-res-book-epub/ low-res-book-epub/OEBPS/%.jpg: %.jpg mkdir -p $(dir $@) @@ -186,48 +186,45 @@ website: html ../website/_bundle_install_done $(ruby_src) ################################### .PHONY: export_figures # Requires that you have docker running on your computer. -export_figures: build_pdf $(tgt_figures) +export_figures: pdf $(tgt_figures) cd figures/ && bash export_figures.sh # }}} -# Now with the rules {{{ -# Expected usual rules first +# Now with the targets {{{ +# Expected usual targets first .PHONY: all all: bake # Finally actual project targets (i.e. build pdf and ebooks) -.PHONY: build_pdf build_booklet build_serif_pdf build_sans_serif_pdf build_ebook +.PHONY: pdf booklet serif sans_serif ebook -pdf: build_serif_pdf build_sans_serif_pdf -build_pdf: pdf +pdf: serif sans_serif booklet: booklet/booklet.pdf -build_booklet: booklet - serif: book_serif/book.pdf -build_serif_pdf: serif - sans_serif: book_sans_serif/book_sans_serif.pdf -build_sans_serif_pdf: sans_serif ebook: epub/book_sans_serif.epub -build_ebook: ebook - bw_ebook: epub/bw_book.epub -build_bw_ebook: bw_ebook - low_res_ebook: epub/low_res_book.epub + +# We keep the old target names for backward compatibility +build_pdf: pdf +build_booklet: booklet +build_serif_pdf: serif +build_sans_serif_pdf: sans_serif +build_ebook: ebook +build_bw_ebook: bw_ebook build_low_res_ebook: low_res_ebook # top level releases rules .PHONY: bake release_serif release_sans_serif - bake: release_serif release_sans_serif release_booklet website release: mkdir -p release -release_serif: build_serif_pdf build_ebook build_bw_ebook build_low_res_ebook | release +release_serif: serif ebook bw_ebook low_res_ebook | release cp book_serif/book.pdf release/TheBreadCode-The-Sourdough-Framework.pdf cp epub/bw_book.epub release/TheBreadCode-The-Sourdough-Framework-black-and-white.epub cp epub/low_res_book.epub release/TheBreadCode-The-Sourdough-Framework.epub @@ -237,10 +234,10 @@ release_serif: build_serif_pdf build_ebook build_bw_ebook build_low_res_ebook | exit 1; \ fi -release_sans_serif: build_sans_serif_pdf | release +release_sans_serif: sans_serif | release cp book_sans_serif/book_sans_serif.pdf release/TheBreadCode-The-Sourdough-Framework-sans-serif.pdf -release_booklet: build_booklet | release +release_booklet: booklet | release cp booklet/booklet.pdf release/TheBreadCode-The-Sourdough-Framework-booklet.pdf # }}} @@ -303,7 +300,7 @@ help: @echo "" @echo "Releases:" @echo " all: pdf serif and sans-serif accessible version, ebooks in colours" - @echo " and black&white versions and the website" + @echo " and black&white versions as well as the website" @echo "" @echo " bake: same as build all" @echo "" @@ -311,13 +308,14 @@ help: @echo " release_sans_serif: build sans-serif/accessible version of pdf" @echo "" @echo "Portable Document Format (pdf):" - @echo " build_sans_serif_pdf: build accessible pdf only (same as release_sans_serif)" - @echo " build_serif_pdf: build serif pdf only" - @echo " build_pdf: builds both serif and accessible pdf" + @echo " sans_serif: build accessible pdf only (same as release_sans_serif)" + @echo " serif: build serif pdf only" + @echo " pdf: builds both serif and accessible pdf" @echo "" @echo "Ebooks (epub):" - @echo " build_ebook: builds only the colour ebook" - @echo " build_bw_ebook: builds the low res black & white ebook" + @echo " ebook: builds only the colour ebook" + @echo " low_res_ebook: builds the colour ebook in lower resolution" + @echo " bw_ebook: builds the low res black & white ebook" @echo "" @echo "Website:" @echo " website: build the static website from LaTeX sources and post-process it" @@ -350,7 +348,7 @@ help: @echo " printvars: print all variables in the makefile" @echo " print-X: print makefile variable X" @echo "" - @echo "set DEBUG i.e make DEBUG=1 build_ebook to add debug flags to commands" + @echo "set DEBUG i.e make DEBUG=1 ebook to add debug flags to commands" # }}} # Debug Stuff from now on {{{ diff --git a/makefile b/makefile index 154f572..30ad878 100644 --- a/makefile +++ b/makefile @@ -15,13 +15,13 @@ push_docker_image: build_docker_image docker push $(DOCKER_IMAGE):latest # Books/website -build_serif_pdf: - $(DOCKER_CMD) "cd /opt/repo/book && make build_serif_pdf" +serif_pdf: + $(DOCKER_CMD) "cd /opt/repo/book && make serif_pdf" -build_ebook: - $(DOCKER_CMD) "cd /opt/repo/book && make build_ebook" +ebook: + $(DOCKER_CMD) "cd /opt/repo/book && make ebook" -build_pdf: +pdf: $(DOCKER_CMD) "cd /opt/repo/book && make" bake: @@ -31,7 +31,7 @@ website: $(DOCKER_CMD) "cd /opt/repo/book && make website" booklet: - $(DOCKER_CMD) "cd /opt/repo/book && make build_booklet" + $(DOCKER_CMD) "cd /opt/repo/book && make booklet" mrproper: $(DOCKER_CMD) "cd /opt/repo/book && make mrproper" @@ -48,3 +48,8 @@ print_os_version: start_shell: docker run -it -v $(PWD):/opt/repo $(DOCKER_IMAGE) /bin/bash + +# Old names for backward compatibility +build_serif_pdf: serif_pdf +build_ebook: ebook +build_pdf: pdf From d02e99c46ee0ae83e729a58ecf2180509d3636fa Mon Sep 17 00:00:00 2001 From: Ced Date: Sun, 19 Jan 2025 21:28:14 +0000 Subject: [PATCH 23/25] Fix merge errors --- book/makefile | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/book/makefile b/book/makefile index f770741..e99abc3 100644 --- a/book/makefile +++ b/book/makefile @@ -127,6 +127,9 @@ booklet/booklet.pdf: $(booklet_src) epub/%.epub: %.tex $(ebook_src) cover/cover-page.xbb $(EBOOK) $< +copy_ebook_files: build_ebook + $(RSYNC) --exclude '*.png' epub_build/book-epub/ bw-book-epub/ + # Now that we have built the ebook we will generate 2 more versions # # 1) With kindle app on phone we want a colour version with size < 50 MB @@ -150,7 +153,7 @@ epub/bw_book.epub: copy_ebook_files $(bw_images) # Now the low res copy_ebook_files_low_res: ebook - $(RSYNC) epub_build/book_sans_serif-epub/ low-res-book-epub/ + $(RSYNC) epub_build/book-epub/ low-res-book-epub/ low-res-book-epub/OEBPS/%.jpg: %.jpg mkdir -p $(dir $@) @@ -164,10 +167,10 @@ epub/low_res_book.epub: copy_ebook_files_low_res $(low_res_images) # Website {{{ ################################### .PHONY: html website -$(website_dir)/book_sans_serif.html: $(website_src) cover/cover-page.xbb - $(WEBSITE) -d $(website_dir) book_sans_serif.tex +$(website_dir)/book.html: $(website_src) cover/cover-page.xbb + $(WEBSITE) -d $(website_dir) book.tex -html: $(website_dir)/book_sans_serif.html +html: $(website_dir)/book.html cp $< $(website_dir)/index.html # Because packages will be installed in hard to predict places use a file as @@ -204,7 +207,7 @@ booklet: booklet/booklet.pdf serif: book_serif/book.pdf sans_serif: book_sans_serif/book_sans_serif.pdf -ebook: epub/book_sans_serif.epub +ebook: epub/book.epub bw_ebook: epub/bw_book.epub low_res_ebook: epub/low_res_book.epub @@ -232,7 +235,7 @@ release_serif: serif ebook bw_ebook low_res_ebook | release @if [ `du -sb epub/low_res_book.epub | cut -f1` -gt 49500000 ]; then \ echo "ERROR: epub File too big"; \ exit 1; \ - fi + fi release_sans_serif: sans_serif | release cp book_sans_serif/book_sans_serif.pdf release/TheBreadCode-The-Sourdough-Framework-sans-serif.pdf From 70d90781c86d0f72902045ee7dc3c2f3a234d6aa Mon Sep 17 00:00:00 2001 From: Cedric Date: Tue, 21 Jan 2025 20:57:54 +0000 Subject: [PATCH 24/25] Add latest dvisvgm drive for tex4ht commit f1707125de2f058634523b0b3391a7c7be2d6784 Author: Michal Hoftich Date: Tue Oct 29 18:12:59 2024 +0100 use \Picture* instead of \Picture+ from: https://github.com/michal-h21/dvisvgm4ht.git (fetch) --- book/pgfsys-dvisvgm4ht.def | 75 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 75 insertions(+) create mode 100644 book/pgfsys-dvisvgm4ht.def diff --git a/book/pgfsys-dvisvgm4ht.def b/book/pgfsys-dvisvgm4ht.def new file mode 100644 index 0000000..fd3bf78 --- /dev/null +++ b/book/pgfsys-dvisvgm4ht.def @@ -0,0 +1,75 @@ +% Copyright 2021-2024 by Michal Hoftich +% Copyright 2006 by Till Tantau +% +% This file may be distributed and/or modified +% +% 1. under the LaTeX Project Public License and/or +% 2. under the GNU Public License. +% +% See the file doc/generic/pgf/licenses/LICENSE for more details. + +\ProvidesFileRCS{pgfsys-dvisvgm4ht.def} + +% Driver commands for tex4ht + +% +% Load common pdf commands: +% + +% we switched to dvisvgm driver by default. it supports patterns and other features +% dvips driver is available through the tikz+ option. It doesn't support everything, +% but it worked better with nested pictures in the past. +\ifdefined\ifOption +\ifOption{tikz+}{\input pgfsys-dvips.def}{\input pgfsys-dvisvgm.def} +\else +% load the dvips driver by default +\input pgfsys-dvisvgm.def +\fi + + +\catcode`\:=11% + +% we must call most of these redefinitions in \AtBeginDocument, because \HLet is available +% only at that moment +\AtBeginDocument{% + % configure the output picture format to svg, as it will require dvisvgm + % post processing. + \Configure{Picture}{.svg}% + + % insert picture hooks to pgfsys commands + % these redefinitions are usually called only with the \tikz command, + % they are ignored in tikzpicture environment + \def\:tempa#1{% + \texfourht@tikz@begin% + \csname o:pgfsys@typesetpicturebox:\endcsname{#1} + \texfourht@tikz@end% + } + \HLet\pgfsys@typesetpicturebox\:tempa + + % we must remove Picture-alt in \pgfsys@beginpicture, because it can result in alt text included in the image + \def\:tempa{\Configure{Picture-alt}{}\texfourht@tikz@begin\o:pgfsys@beginpicture:} + \HLet\pgfsys@beginpicture\:tempa + \let\o:pgfsys@endpicture:\pgfsys@endpicture + \def\:tempa{\o:pgfsys@endpicture:} + \HLet\pgfsys@endpicture\:tempa + + % start picture around TikZ and PGF environments + \ConfigureEnv{tikzpicture}{\begingroup\texfourht@tikz@begin}{\texfourht@tikz@end\endgroup}{}{}% + \ConfigureEnv{pgfpicture}{\begingroup\texfourht@tikz@begin}{\texfourht@tikz@end\endgroup}{}{}% +} + +\def\texfourht@tikz@begin{ + \protect\csname nested:math\endcsname% support display math + \Picture*[\csname a:Picture-alt\endcsname]{}% +} +\def\texfourht@tikz@end{\EndPicture} + +\catcode`\:=12% + + +\endinput + + +%%% Local Variables: +%%% mode: latex +%%% End: From 8fd1df9d3333122336d6ed7d6deaa52ba19e3940 Mon Sep 17 00:00:00 2001 From: Cedric Date: Mon, 20 Jan 2025 20:47:59 +0000 Subject: [PATCH 25/25] Fix the chemical equation. All credits due to @michal-h21 https://github.com/michal-h21/tex4ebook/issues/137 --- book/tex4ebook.cfg | 14 ++++++++++++++ book/website.cfg | 12 ++++++++++++ 2 files changed, 26 insertions(+) diff --git a/book/tex4ebook.cfg b/book/tex4ebook.cfg index dffea80..35066f6 100644 --- a/book/tex4ebook.cfg +++ b/book/tex4ebook.cfg @@ -19,4 +19,18 @@ font-family: 'Open Sans'; } }} + +% Deal with chemical equations in a single svg +\ExplSyntaxOn +\def\standaloneenv#1{} +\pend:def\schemestart{\Picture+{}} +\append:def\CF_schemestop{\EndPicture} +\ExplSyntaxOff +\makeatletter +\def\texfourht@tikz@begin{ + \protect\csname nested:math\endcsname% support display math + \Picture+[\csname a:Picture-alt\endcsname]{}% +} +\makeatother + \EndPreamble diff --git a/book/website.cfg b/book/website.cfg index f236b6e..b87e680 100644 --- a/book/website.cfg +++ b/book/website.cfg @@ -47,5 +47,17 @@ } \ConfigureToc{loc}{\HCode{}}{\ }{}{\HCode{
}} +\ExplSyntaxOn +\def\standaloneenv#1{} +\pend:def\schemestart{\Picture+{}} +\append:def\CF_schemestop{\EndPicture} +\ExplSyntaxOff +\makeatletter +\def\texfourht@tikz@begin{ + \protect\csname nested:math\endcsname% support display math + \Picture+[\csname a:Picture-alt\endcsname]{}% +} +\makeatother + \begin{document} \EndPreamble