Dave Jarvis' Repositories

git clone https://repo.autonoma.ca/repo/recipe-books.git
# Introduction #

The database contains fragments of LaTeX code. The relationship between a book's theme and LaTeX code is illustrated in the following diagram:

![Theme to LaTeX](http://i.imgur.com/Wer4L1r.png)

Each fragment of LaTeX code is assigned to a *snippet*. Multiple snippets can be associated with an *aspect*. In effect, aspects can be thought of as *snippet categories*. Each theme consists of a unique set of aspects.

# Book Creation #

When the user creates a book, a basic theme is automatically assigned. At any time, the user may change the book's theme. Changing a book's theme wipes out any other customizations that the user may have applied to the book.

After selecting a theme, the user may opt to tweak any aspect of that theme. For example, the user might want to apply a different set of colours to an existing theme.

# Example Scenario #

The following LaTeX code is named Čiurlionis, which has a corresponding snippet code of CIURLIONIS:

```
#!latex

% http://www.colourlovers.com/palette/2634294/APC393_%C4%8Ciurlionis
\definecolor[named]{skin}{HTML}{F2B166}
\definecolor[named]{nectar}{HTML}{EDE2C2}
\definecolor[named]{ifiwerestronger}{HTML}{D2B490}
\definecolor[named]{p}{HTML}{AB8369}
\definecolor[named]{suspect}{HTML}{755348}

\renewcommand{\primarycolor}{p}
\renewcommand{\secondarycolor}{ifiwerestronger}
\renewcommand{\tertiarycolor}{nectar}
\renewcommand{\darkhighlight}{suspect}
\renewcommand{\brighthighlight}{skin}
\renewcommand{\primarycolorcomplement}{black}
\renewcommand{\secondarycolorcomplement}{black}
\renewcommand{\tertiarycolorcomplement}{black}

```

The system includes an aspect of COLOUR_SCHEME, having a label of "Colour Scheme". The label is presented to the user, but the code is used by the system.

The system also includes a theme of MODERN_SQUARE, having a label of "Modern Square".

The theme table could have an entry of **MODERN_SQUARE**, **COLOUR_SCHEME**, **CIURLIONIS**. When the user selects the MODERN_SQUARE theme, the CIURLIONIS colour scheme is automatically set as a preference for the book's theme.