Show the code
params$regionMarkdown is a great tool for formatting text. Below, we describe common notation and examples, many of which you may use when writing an asar-based stock assessment report.
| Element | Markdown Syntax |
|---|---|
| Heading | # H1 ## H2 ### H3 |
| Bold | **bold text** |
| Italic | *italic* |
| Bold & italic | *** bold italic*** |
| Blockquote | > blockquote |
| Ordered list | 1. Item #1 2. Item #2 3. Item #3 |
| Unordered list | - Item #1 - Item #2 - Item #3 |
| Code | `code` |
| R code chunk | ```{r} <br> ``` |
| Horizontal rule | — |
| Link | [Text](https://www.example.com) |
| Image |  |
| Image in code chunk | `knitr::include_graphics(“path/image.png”) |
| Element | Markdown Syntax |
|---|---|
| Markdown table | | Syntax | Description | |———-|——-| | entry 1 | description | | entry 2 | description | |
| Footnote | Sentence with a footnote. [^1] [^1]: This is a footnote. |
| Heading Labels | ### Heading A {#sec-nameA} |
| Reference heading label | @sec-nameA |
| Strikethrough | ~~Strikethrough~~ |
| Task list | - [x] Task a - [ ] task b - [ ] task c |
| Subscript | F~msy~ |
| Superscript | X^2^ |
| Comment out text | <!--- text here --- |
| in-text email or URLs |
<www.example.com> ````example@noaa.gov````` |
Two helpful things to know about writing mathematical expressions with R markdown:
$$1 + 1 = 2$$ is rendered as:
To write a superscript, use a caret (^) before a value. For instance, $b^2$ renders as .
To write a subscript, use an underscore (_) before a value. For instance, $b_2$ renders as . For longer subscripts, enclose the text in curly brackets ($b_{12345}$ renders as )
Many symbols can be written by adding a backslash (\) before a symbol name. For instance:
Generalized notation - $\alpha$
| Greek Letter Spelling | Lowercase | Capital |
|---|---|---|
| alpha | A | |
| beta | B | |
| gamma | ||
| delta | ||
| epsilon | E | |
| zeta | Z | |
| eta | H | |
| theta | ||
| kappa | K | |
| lambda | ||
| mu | M | |
| nu | N | |
| omicron | O | |
| rho | P | |
| sigma | ||
| tau | T | |
| upsilon | ||
| chi | X | |
| psi | ||
| iota | I | |
| xi | ||
| pi | ||
| phi | ||
| omega |
To make a fraction, write \frac before your numerator and denominator, both of which are enclosed in curly brackets ({ }). For instance, $\frac{7}{8}$ renders as .
Lots of these special symbols can be combined into complex terms and equations. For instance:
$R^2_{adj}$ renders as
$y = ax^2 + bx + c$ renders as
$\frac{\theta^{10}}{2a} \le \frac{5c^4}{b_{min}}$ renders as
$SBPR_f = \sum_{a} N_a m_a w_a$ renders as
Check out Overleaf’s LaTeX reference guide to mathematical expressions for more guidance writing mathematical text.
To add a piece of code into the text directly, encase R code within a pair of back ticks (`). For example, `params$region` will render like this:
params$regionThe above example shows how one would incorporate the region parameter into a sentence in a markdown or quarto file. In google docs, this notation formatted to green and the font roboto mono.
If we define the parameter of region as NWFSC, the phrase “my region is `params$region` would render as”my region is NWFSC”.
Other ways to incorporate markdown notation include:
\r 2+2\ would render as 4.The following are some of the ways you can tell quarto to evaluate code:
| Execute options | Actions |
|---|---|
| echo | true, false |
| warning | true, false |
| eval | true, false, […] |
| output | true, false, asis |
| warning | true, false |
| error | true, false |
| include | true, false |
| cache | true, false, refresh |
| freeze | true, false, auto |
asar comes with a default .bib file which contains example references, but users are encouraged to replace it or expand upon it with their own .bib files for references in their report. To references an article or other references from the file within the test use the following notation:
“The dynasty fell within the year 1206, leaving the Vikings in a state of unrest (
@Biddle_1992).”
renders as
“The dynasty fell within the year 1206, leaving the Vikings in a state of unrest (Biddle and Kjølbye-Biddle (1992)).”
The citation will format according to Canadian Journal of Fisheries and Aquatic Sciences standards and include the citation in 07_references.qmd. This default citation style is set in the skeleton file’s YAML (csl: support_files/cjfas.csl). You can change the citation style by substituting the “cjfas.csl” file.
A good rule of thumb to follow is that references are cited use the @ symbol followed by the first author’s last name then the publication year. This is not always the case, so it is advised that users check their bib file for the proper citation or use the Visual editor that provides a convenient drop down with a list of suggested citations base on author name, year, or keyword from the title.
A lot of the notation in this document can be combined for a highly customizable document. For example, you can bold or italicize a link by surrounding the notation to insert a link by asterisks (*):
*[NOAA Fisheries](https://www.fisheries.noaa.gov)* renders as NOAA Fisheries
**[NOAA Fisheries](https://www.fisheries.noaa.gov)** renders as NOAA Fisheries
This content was sourced and adapted from the Markdown Guide Markdown Cheat Sheet, a helpful resource for the markdown language.