Dave Jarvis' Repositories

git clone https://repo.autonoma.ca/repo/keenwrite.git

Adjusts math, fixes R output, shorten phrases

AuthorDaveJarvis <email>
Date2025-09-05 13:42:48 GMT-0700
Commit25b3f273a3a6eb8bbb3c7b63e97e15aa16b74a0b
Parent2a6483f
Delta40 lines added, 39 lines removed, 1-line increase
docs/04-variables.md
A variable's value can reference other variables by enclosing the referenced
-key in double curly braces (`{{ }}`), wrapped in quotation marks:
+key in double curly braces (`{{ }}`)---also known as "moustache"
+syntax---wrapped in quotation marks:
``` yaml
docs/11-math.md
``` tex
\sum_{n=1}^{\infty} \fraction{1}{n^2} = \fraction{\pi^2}{6}
+
+:: Basel problem
```
Produces:
$$\sum_{n=1}^{\infty} \fraction{1}{n^2} = \fraction{\pi^2}{6}$$
-
-:: Equation doohickey {#eqn:matter}
-
-When exported to XHTML, mathematical expressions can be output as:
-* TeX notation for use with KaTeX or MathJax; or
-* SVG images.
+:: Basel problem {#eqn:matter}
-When exported to PDF, the typesetting system renders expressions directly.
+When exported to XHTML, mathematical expressions can be output as TeX notation
+or SVG images. Using TeX notation allows rendering the mathematics using a
+JavaScript library such as KaTeX or MathJax. When exported to PDF, the
+typesetting system renders expressions directly.
## Syntax
``` tex
-The quadratic formula is: $x=\fraction{-b \pm \sqrt{b^2 - 4ac}}{2a}$
+The quadratic formula is $x=\fraction{-b \pm \sqrt{b^2 - 4ac}}{2a}$.
```
+
+Outputs an equation within a sentence:
+
+> The quadratic formula is $x=\fraction{-b \pm \sqrt{b^2 - 4ac}}{2a}$.
## Standalone expressions
Enclose standalone TeX code inside double dollar sign sigils (`$$`):
``` tex
$$\int_{-\infty}^{\infty} e^{-x^2} dx = \sqrt{\pi}$$
```
+
+Outputs a lone paragraph:
+
+> $$\int_{-\infty}^{\infty} e^{-x^2} dx = \sqrt{\pi}$$
+
+The assigned equation reference number will vary, of course.
docs/12-r.md
## Data visualizations
-Data visualizations enrich documents by incorporating statistical analysis and
-plots generated from R code. The application supports R integration for
-creating these elements within R Markdown files.
-
-Follow these steps to run basic R code within the application:
+Data plots can be generated using R. First, create a new file:
1. Start the application.
1. Click **File → New** to create a new file.
1. Click **File → Save As**.
-1. Set **Name** to: `addition.Rmd`
+1. Set **Name** to: `plot.Rmd`
1. Click **Save**.
Setting the file name extension tells the application what processor to use
-when transforming the contents for display in the preview tab. Continue by
-typing in the following text, including the backticks:
-
-``` r
-`r#1 + 1`
-```
-
-The preview tab shows the result of `1` plus `1`:
-
-> 2.0
-
-To insert visual content, such as a plot, use ` ```{r}` and ` ``` ` to
-enclose R snippets, such as:
+when transforming the contents. To insert visual content, such as a plot, use
+the knitr-compatible syntax of ` ```{r}` and ` ``` ` to enclose multi-line R
+snippets:
```{r}
x <- seq( 0, 2 * pi, length.out=100 )
y <- sin( x )
plot( x, y, type="l" )
```
-
-The document shows a plot.
## Variable definitions
1. Create a new file.
-1. Change the contents to (use spaces not tabs):
+1. Change the contents to (use spaces to indent, not tabs):
``` yaml
The preview tab shows:
-> Project Title
+> 25.0
-This is because the application inserts variable reference names based on the type of file being edited. By default, the R engine does not have a function named `x` defined.
+This is because the application inserts variable reference names based on the
+type of file being edited. By default, the R engine does not have a function
+named `x` defined. The `x` function is a fail-safe string conversion function.
Continue as follows:
This means that the variables can also include expressions that R is capable of
evaluating.
+
+Externally defined variables are assigned to the `v` object in R code. This
+allows dereferencing them using a `$`-separated string. The moustache and
+dot-separated notation also works (e.g., `{{project.title}}`), but better to be
+consistent.
## Comma-separated values
-{{app.title}} ships with many R functions, including one to convert
-comma-separated values into a Markdown table. Consider the following travel
-fares saved as `fares.csv` in the same directory as the main document:
+Many R functions are included, like one that converts comma-separated values to
+tables. Consider travel fares saved as `fares.csv` alongside the main document:
``` csv
docs/13-gui.md
## Skins
-A skin defines the visual style of the application. Skins, which are similar to
-cascading style sheet classes, configure the user interface colours, fonts,
+A skin defines the visual style of the application. Skins, which use a syntax
+based on cascading style sheets, configure the user interface colours, fonts,
spacing, highlights, drop-shadows, gradients, and so forth. See the [W3C CSS
-tutorial](https://www.w3.org/Style/Examples/011/firstcss) for details.
+tutorial](https://www.w3.org/Style/Examples/011/firstcss).
### Order
docs/user-manual.pdf
Binary files differ