Skip to content

Commit cba607b

Browse files
committed
feat(quarto_features): change cross-ref to tables and write includes section
1 parent ca757e2 commit cba607b

File tree

1 file changed

+46
-8
lines changed

1 file changed

+46
-8
lines changed

pages/quarto_features.qmd

Lines changed: 46 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,7 @@ By default, columns share the space equally. You can control their width by addi
306306

307307
:::
308308

309-
## Footnotes
309+
## Footnotes {#sec-footnotes}
310310

311311
```markdown
312312
Here is some text with a footnote.[^1]
@@ -416,17 +416,42 @@ By default, a list of works cited will be placed at the end of the document. You
416416

417417
## Cross-references
418418

419-
TODO: explain this better... how to do with figures, tables and equation...
420-
421419
Quarto can automatically number and cross‑reference figures, tables, sections, and equations.
422420

423-
To make something cross‑referenceable, you give it an identifier, then refer to it with `@id`. For example, a section:
421+
To make something cross‑referenceable, you give it an identifier, then refer to it with `@id`.
422+
423+
For example, you can refer to tables by adding a caption and then including a `#tbl-` label in braces at the end of the caption
424424

425+
:::: {.columns}
426+
::: {.column width=45%}
425427
```markdown
426-
## Results {#sec-results}
428+
| Letter | Number |
429+
| - | - |
430+
| A | 1 |
431+
| B | 2 |
432+
| C | 3 |
433+
434+
: Table with ABC and 123 {#tbl-letters}
427435

428-
As shown in @sec-results, we found that ...
436+
See @tbl-letters
429437
```
438+
:::
439+
::: {.column width=10%}
440+
:::
441+
::: {.column width=45%}
442+
| Letter | Number |
443+
| - | - |
444+
| A | 1 |
445+
| B | 2 |
446+
| C | 3 |
447+
448+
: Table with ABC and 123 {#tbl-letters}
449+
450+
See @tbl-letters
451+
:::
452+
::::
453+
454+
See the page on [Cross-references](https://quarto.org/docs/authoring/cross-references.html) from the Quarto documentation for instructions on how to reference other things (e.g., lists, figures, code listings, callouts, sections).
430455

431456
::: {.pale-blue}
432457

@@ -579,8 +604,21 @@ Line block:
579604

580605
## Includes
581606

582-
reuse... import...
607+
Sometimes you want to **reuse** the same content in more than one page (e.g., a short disclaimer, a project description, or a list of learning outcomes). Quarto lets you "include" another file so that its contents are pulled in when you render.
608+
609+
For example, if you have a file called `snippet.md` in the same folder:
583610

584611
```markdown
585-
{{{< include file.md >}}}
612+
{{{< include snippet.md >}}}
586613
```
614+
615+
When you render, the text from `snippet.md` will appear at that point in the page
616+
617+
::: {.pale-blue}
618+
619+
**Task:** In `quarto_features.qmd`:
620+
621+
* [ ] Create a small file called `snippet.md` with one or two lines of text.
622+
* [ ] Include it in `quarto_features.qmd` using `{{< include snippet.md >}}` and render the page.
623+
624+
:::

0 commit comments

Comments
 (0)