Komascript (#148)

* Add chemfig package

Somhow forgot it in chemical equation commit 8004497b

* Change links colors to codeblue

Closes https://github.com/hendricius/the-sourdough-framework/issues/142

* Use KOMA-Script and twosided printing

Because it looks better.  Also gets rid of headers/footers on empty
pages

* Fix tex4ebook and komascript clash

See https://github.com/michal-h21/tex4ebook/issues/110

* Factor out packages into a sty file

Separates style details out of the main file, now that we start having
more and more style-related settings.

* Remove parskip

Not needed with Koma-script

* Remove tocloft package

Not needed with koma-script

* Use tocbasics instead of floats

to please kpmascript internal algorithm

* Add a bit more breathing space in ToC

so they are not stuck together at 11.11 onwards...
This commit is contained in:
cedounet
2023-07-13 15:32:00 +01:00
committed by GitHub
parent 672ac79234
commit fa91b6f06f
5 changed files with 77 additions and 77 deletions

View File

@@ -1,80 +1,8 @@
\documentclass[a4paper, 12pt]{book} \documentclass[a4paper, twoside, 12pt]{scrbook}
% General packages % General packages
\usepackage[utf8]{inputenc} \usepackage{sourdough}
\usepackage{blindtext}
\usepackage{graphicx}
\usepackage{booktabs}
\usepackage{longtable}
\usepackage{float}
\usepackage[T1]{fontenc}
\usepackage{tocloft}
% \usepackage{tex4ebook}
\usepackage{chemformula}
\usepackage{chemfig}
\usepackage{booktabs}
\usepackage{makecell}
\usepackage{siunitx}
\renewcommand\theadfont{\bfseries}
\definecolor{codeblue}{RGB}{69, 161, 248}
\definecolor{codegray}{RGB}{40, 40, 40}
\usetikzlibrary{shapes,arrows}
\tikzstyle{decision} = [diamond, draw, fill=codegray, text=white,
text width=4.5em, text badly centered, node distance=3cm, inner sep=0pt]
\tikzstyle{block} = [rectangle, draw, fill=codeblue, text=white,
text width=5em, text centered, rounded corners, minimum height=4em]
\tikzstyle{line} = [draw, -latex']
% Fonts for accessibility
\ifdefined\isaccessible
\usepackage{helvet}
\renewcommand{\familydefault}{\sfdefault}
\fi
% Kerning in footnotes
\usepackage{fnpct}
% References
\usepackage[backend=biber]{biblatex}
\addbibresource{references.bib}
% Clickable links in the table of contents
\usepackage[ocgcolorlinks]{hyperref}
\hypersetup{%
linktoc=all,
allcolors=codeblue
}
% Folders where to search for images
\graphicspath{
{images/}
{troubleshooting/}
{sourdough-starter/}
{troubleshooting/crumb-structures/}
{history/}
{images/external/}
{baking/}
{wheat-sourdough/}
{wheat-sourdough/shaping/}
{non-wheat-sourdough/}
}
% Layout rules
\interfootnotelinepenalty=10000
\advance\cftsecnumwidth 0.5em\relax
\advance\cftsubsecindent 0.5em\relax
\advance\cftsubsecnumwidth 0.5em\relax
% Space between paragraphs
\usepackage[skip=5pt plus1pt, indent=0pt]{parskip}
% Caption and figure size below images
\usepackage{caption}
\captionsetup[figure]{font=footnotesize}
\DeclareSIUnit\degF{\text{°}F}
% Basic attributes % Basic attributes
\author{Hendrik Kleinwächter} \author{Hendrik Kleinwächter}
\title{The Sourdough Framework} \title{The Sourdough Framework}
@@ -91,7 +19,6 @@
\end{center} \end{center}
\end{titlepage} \end{titlepage}
% \tableofcontents % \tableofcontents
\ifdefined\HCode\else\tableofcontents\fi \ifdefined\HCode\else\tableofcontents\fi

View File

@@ -1,2 +1,4 @@
\def\isaccessible{1} \def\isaccessible{1}
\input{book.tex} % We have to use a symlink to book.tex to prevent tex4ebook to load book.ht4
% before loading any other package and create conflicts
\input{sourdough_book.tex}

View File

@@ -21,7 +21,7 @@ src_figures := $(wildcard figures/fig-*.tex)
src_tex := $(foreach directory, $(chapters), $(wildcard $(directory)/*.tex)) src_tex := $(foreach directory, $(chapters), $(wildcard $(directory)/*.tex))
src_tex += book.tex book_sans_serif.tex references.bib figures/vars.tex src_tex += book.tex book_sans_serif.tex references.bib figures/vars.tex
src_tex += supporters.csv src_tex += supporters.csv sourdough.sty
images := $(wildcard images/*/*.jpg) images := $(wildcard images/*/*.jpg)
images += $(wildcard images/*/*.png) images += $(wildcard images/*/*.png)

70
book/sourdough.sty Normal file
View File

@@ -0,0 +1,70 @@
\ProvidesPackage{sourdough}
\usepackage[utf8]{inputenc}
\usepackage{blindtext}
\usepackage{graphicx}
\usepackage{booktabs}
\usepackage{longtable}
\usepackage{tocbasic}
\usepackage[T1]{fontenc}
\usepackage{chemformula}
\usepackage{chemfig}
\usepackage{booktabs}
\usepackage{makecell}
\usepackage{siunitx}
\renewcommand\theadfont{\bfseries}
\definecolor{codeblue}{RGB}{69, 161, 248}
\definecolor{codegray}{RGB}{40, 40, 40}
\usetikzlibrary{shapes,arrows}
\tikzstyle{decision} = [diamond, draw, fill=codegray, text=white,
text width=4.5em, text badly centered, node distance=3cm, inner sep=0pt]
\tikzstyle{block} = [rectangle, draw, fill=codeblue, text=white,
text width=5em, text centered, rounded corners, minimum height=4em]
\tikzstyle{line} = [draw, -latex']
% Fonts for accessibility
\ifdefined\isaccessible
\usepackage{helvet}
\renewcommand{\familydefault}{\sfdefault}
\fi
% Kerning in footnotes
\usepackage{fnpct}
% References
\usepackage[backend=biber]{biblatex}
\addbibresource{references.bib}
% Clickable links in the table of contents
\usepackage[ocgcolorlinks]{hyperref}
\hypersetup{%
linktoc=all,
allcolors=codeblue
}
% Folders where to search for images
\graphicspath{
{images/}
{troubleshooting/}
{sourdough-starter/}
{troubleshooting/crumb-structures/}
{history/}
{images/external/}
{baking/}
{wheat-sourdough/}
{wheat-sourdough/shaping/}
{non-wheat-sourdough/}
}
% Caption and figure size below images
\usepackage{caption}
\captionsetup[figure]{font=footnotesize}
\DeclareSIUnit\degF{\text{°}F}
\RedeclareSectionCommand[
tocindent=0pt,
tocnumwidth=35pt,
]{section}

1
book/sourdough_book.tex Symbolic link
View File

@@ -0,0 +1 @@
book.tex