Skip to content

Commit

Permalink
Add instructions for defining your own colors
Browse files Browse the repository at this point in the history
  • Loading branch information
eeholmes committed Nov 1, 2022
1 parent 335fe27 commit 3bf49e2
Show file tree
Hide file tree
Showing 4 changed files with 78 additions and 6 deletions.
30 changes: 28 additions & 2 deletions documentation/01-how-to-use-extension.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ quarto use template nmfs-opensci/quarto_titlepages

This will install the extension in the `_extension` folder plus all the demo files. Essentially, you will be cloning the repo into a new folder and you will be asked at installation for the name of the (empty) folder/directory that you want to install into.

### Install for an existing directory
### Install or update for an existing directory

You may also use this format with an existing Quarto project or document. This will install only the files in the `_extension` folder and will not install the files above that (the demo files).
You may also use this format with an existing Quarto project or document. This will install only the files in the `_extension` folder and will not install the files above that (the demo files). Use the same command to update an existing extension.

From the quarto project or document directory, run the following command:

Expand Down Expand Up @@ -114,5 +114,31 @@ format:
lot: true
```

## Colors

The `xcolor` LaTeX package is used so you can define any color you want with a `xcolor` command. Then you can refer to this color where you want to specify a color.

```
format:
titlepage-pdf:
documentclass: scrbook
classoption: ["oneside", "open=any"]
number-sections: true
titlepage: "academic"
titlepage-footer: |
NOAA Fisheries OpenSci\
Tools for Open Science\
[https://github.com/nmfs-opensci](https://github.com/nmfs-opensci)\
coverpage: "great-wave"
coverpage-theme:
title-node-spec: "fill=mygreen, inner sep=10mm, minimum height=4cm"
title-width: "8cm"
titlepage-theme:
footer-color: mygreen
keep-tex: true
include-in-header:
text: |
\definecolor{mygreen}{HTML}{808000}
```
27 changes: 26 additions & 1 deletion documentation/02-titlepages.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,15 @@ Available for page, title, subtitle, author, affiliation, header, footer, date.

Do not use both `page-html-color` and `page-color`. Choose one. `page-color` will use names. What names are available? Google `latex xcolor`. Standard color names.

The `xcolor` LaTeX package is used so you can define any color you want with a `xcolor` command. Then you can refer to this color where you want to specify a color. You define the color in your LaTeX header. For example, define the color `mygreen` by including this in your format yaml and then you can use `mygreen` as a color name.

```
include-in-header:
text: |
\definecolor{mygreen}{HTML}{808000}
```


### `-fontfamily`

Available for page, title, subtitle, author, affiliation, header, footer, date.
Expand Down Expand Up @@ -188,6 +197,14 @@ If `-style` is `colorbox`, you can specify the colorbox features:
* `-colorbox-borderwidth` width of the border (in, cm, mm, pt)
* `-colorbox-bordercolor` border color

The `xcolor` LaTeX package is used so you can define any color you want in your LaTeX header. For example, define the color `mygreen` include this in your format yaml. Then you can use `mygreen` as a color name.

```
include-in-header:
text: |
\definecolor{mygreen}{HTML}{808000}
```

### `bg-image-size`

The background image size. Specify this with units like in, cm, mm, pt or as a fraction of the paper or text like `0.5\\paperwidth`.
Expand Down Expand Up @@ -217,13 +234,21 @@ Add a fade to the image. Can be
The vertical rule specifications are

* `vrule-width` the width as in, cm, mm, pt (e.g. "1cm") or a fraction of the paper or text like `"0.1\\textwidth"`.
* `vrule-color` names of colors. It's the xcolors.
* `vrule-color` names of colors. It's the xcolors and you can define colors.
* `vrule-align` left, right, leftright. The latter makes a rule on both sides.
* `vrule-space-after` the gap between the vertical rule and the text
* `vrule-text` text to put in the vertical rule
* `vrule-text-color` color of the text
* `vrule-text-style` text styles. See above on what styles are possible.

The `xcolor` LaTeX package is used so you can define any color you want in your LaTeX header. For example, define the color `mygreen` include this in your format yaml. Then you can use `mygreen` as a color name.

```
include-in-header:
text: |
\definecolor{mygreen}{HTML}{808000}
```

## All possible `titlepage-theme` values

These are features that you can customize. If you leave it out, it will either not set the value (so use whatever defaults LaTeX has) or will choose a theme specific default. See the themes.
Expand Down
25 changes: 23 additions & 2 deletions documentation/04-coverpages.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ Some text for the footer. Note "footer" doesn't mean it has to be at the bottom.

## Cover page element customization

The cover page has the following elements: page, title, author, header, footer, bg-image. Each of these can be customized via the `coverpage-theme`.
The cover page has the following elements: page, title, author, header, footer, date, bg-image. Each of these can be customized via the `coverpage-theme`.

Example:
```
Expand Down Expand Up @@ -90,7 +90,15 @@ For title, author, header, footer, date, these can be

Available for page, title, author, header, footer, date.

Do not use both `page-html-color` and `page-color`. Choose one. `page-color` will use names. What names are available? Google `latex xcolor`. Standard color names.
Do not use both `page-html-color` and `page-color`. Choose one. `page-color` will use names.

The `xcolor` LaTeX package is used so you can define any color you want in your LaTeX header. For example, define the color `mygreen` include this in your format yaml. Then you can use `mygreen` as a color name.

```
include-in-header:
text: |
\definecolor{mygreen}{HTML}{808000}
```

### `-fontfamily`

Expand Down Expand Up @@ -152,6 +160,19 @@ Width of the box that holds the text. Smaller will mean that the text is wrapped

*If you pass in `-left` for an element, you must also pass in `-width` for that element. Since you can pass in widths in any units, there is no way to compute a width for you.

### `-node-spec`

Available for title, author, header, footer, date.

These elements appear in the LaTeX file in tikz node. You can pass many different specifications to nodes. There are so many options. See https://tikz.dev/ or just try Googling tikz and what you want.

Here is an example of putting the title in a red 4 cm high box with 10mm padding. Sadly, the width needs to be set by `title-width`. The other elements (footer, header, date) use the same format and will behave similarly.
```
title-node-spec: "fill=red, inner sep=10mm, minimum height=4cm"
title-width: "8cm"
```


### `bg-image-left`

Distance from the left side of page to the left side of image. Measurement is in any units that LaTeX knows (in, cm, mm, pt) or something like `"0.5\\paperwidth"` or `"0.9\\textwidth"`.
Expand Down
2 changes: 1 addition & 1 deletion documentation/05-coverpage-themes.qmd
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
## Cover page themes

Cover pages can have title, author, header, and footer in any place on the page. You specify the location on the page. Title, author, header and footer blocks can be customized: font, font size, color, text rotation and style (bold, italic, etc). Cover pages can have a background image and the location, size and transparency can be specified. In addition, image fading at the top, bottom or sides can be specified. The page color can also be specified.
Cover pages can have title, author, header, and footer in any place on the page. You specify the location on the page. Title, author, header and footer blocks can be customized: font, font size, color, fill, text rotation and style (bold, italic, etc). Cover pages can have a background image and the location, size and transparency can be specified. In addition, image fading at the top, bottom or sides can be specified. The page color can also be specified.

The following cover page demos are included.

Expand Down

0 comments on commit 3bf49e2

Please sign in to comment.