Skip to content

Commit 5134bdf

Browse files
committed
Positron authoring based on VS Code docs
1 parent 4fda1a3 commit 5134bdf

File tree

5 files changed

+61
-7
lines changed

5 files changed

+61
-7
lines changed
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
::: {.callout-caution}
2+
3+
## LaTeX Required for `format: pdf`
4+
5+
In order to create PDFs you will need to install a recent distribution of [LaTeX](https://www.latex-project.org/).
6+
We recommend the use of TinyTeX (which is based on TexLive), which you can install with the following command:
7+
8+
``` {.bash filename="Terminal"}
9+
quarto install tinytex
10+
```
11+
12+
:::
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
When you preview a document with the **Quarto: Preview** command, the Preview button in the toolbar, or the keyboard shortcut {{< kbd mac=Command-Shift-K win=Ctrl+Shift+K linux=Ctrl+Shift+K >}}
2+
the first format specified in the document header is rendered and previewed.
3+
In this case, the file `authoring.html` will be created, and opened in the Viewer pane.
4+
5+
To preview a specific format use the **Quarto: Preview Format...** command and select a different format.
6+
The selected format will then be used whenever you preview.
7+
To return to the default format, or a different format, run **Quarto: Preview Format...** again.
8+
9+
To render all formats specified in the document header, run the command **Quarto: Render Document**.
10+
Then the following files would be created.
11+
12+
- `authoring.html`
13+
- `authoring.pdf`
14+
- `authoring.docx`

docs/get-started/authoring/_text-editor.md

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,17 @@ Quarto supports rendering notebooks to dozens of different [output formats](/doc
88

99
### Format Options
1010

11-
Let's create a new file (`authoring.qmd`) and define various formats for it to be rendered to, adding some options to each of the formats. As a reminder, document options are specified in YAML at the beginning of the source file.
11+
::: {.content-visible when-meta="tool.is_positron"}
12+
Let's create a new file (`authoring.qmd`) and define various formats for it to be rendered to, adding some options to each of the formats.
13+
To create a new Quarto document, run the **Quarto: New Document** command, or use the **File > New File ...** menu and select **Quarto Document**.
14+
15+
Save the file as `authoring.qmd` and edit the YAML header to:
16+
:::
17+
18+
::: {.content-visible unless-meta="tool.is_positron"}
19+
Let's create a new file (`authoring.qmd`) and define various formats for it to be rendered to, adding some options to each of the formats.
20+
As a reminder, document options are specified in YAML at the beginning of the source file.
21+
:::
1222

1323
``` yaml
1424
---
@@ -33,6 +43,8 @@ format:
3343
---
3444
```
3545

46+
{{< include _install-tinytex.md >}}
47+
3648
### Multiple Formats
3749

3850
Some documents you create will have only a single output format, however in many cases it will be desirable to support multiple formats. Let's add the `html` and `docx` formats to our document.
@@ -89,6 +101,11 @@ The `html` and `pdf` formats each provide an option or two. For example, for the
89101

90102
## Rendering
91103

104+
::: {.content-visible when-meta="tool.is_positron"}
105+
{{< include _positron-render.md >}}
106+
:::
107+
108+
::: {.content-visible unless-meta="tool.is_positron"}
92109
The formats specified within document options define what is rendered by default. If we render the document with all the options given above using the following.
93110

94111
``` {.bash filename="Terminal"}
@@ -117,6 +134,7 @@ quarto render authoring.qmd --to odt
117134
```
118135

119136
Since the `odt` format isn't included within document options, the default options for the format will be used.
137+
:::
120138

121139
## Sections
122140

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
---
2+
title: "Tutorial: Authoring"
3+
css: ../positron.css
4+
tool:
5+
is_positron: true
6+
---
7+
8+
{{< include ../_tool-chooser.md >}}
9+
10+
{{< include ../_language-chooser.md >}}
11+
12+
{{< include _text-editor.md >}}
13+
14+
15+
Additionally, if you are interested in seeing how to use Quarto from within `.ipynb` notebooks, check out the documentation on using the Positron [Notebook Editor](/docs/tools/positron/notebook.qmd) with Quarto.

docs/get-started/authoring/rstudio.qmd

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -61,12 +61,7 @@ If you would like to follow along step-by-step in your own environment, download
6161
<i class="bi bi-download"></i> [Download authoring.qmd](_authoring.qmd){download="authoring.qmd"}
6262
:::
6363

64-
In order to create PDFs you will need to install a recent distribution of [LaTeX](https://www.latex-project.org/).
65-
We recommend the use of TinyTeX (which is based on TexLive), which you can install with the following command:
66-
67-
``` {.bash filename="Terminal"}
68-
quarto install tinytex
69-
```
64+
{{< include _install-tinytex.md >}}
7065

7166
See the article on [PDF Engines](/docs/output-formats/pdf-engine.qmd) for details on using other LaTeX distributions and PDF compilation engines.
7267

0 commit comments

Comments
 (0)