I am trying to get on the Quarto bandwagon, but have had trouble converting my R Markdown files to Quarto, so would always give up. Now, however, I see that Quarto is supporting typst, and since most of my documents are made into PDFs, I have decided to finally take the plunge and figure out how to make Quarto work. My first problem: I want to format a string from my YAML params to correctly print in the typst-generated PDF. Here is an example of my qmd:
---
title: "New line - typst"
format:
typst:
papersize: us-letter
margin:
x: 1in
y: 0.5in
numbering: "1"
mainfont: "Calibri"
fontsize: 11pt
params:
UAs: "A:66
B:8,18,35,37,38,39,41,42,54,55,59,64,65,67,73,78
Cw:2,4,5,6,7,8,12,15,17,18
DR:8,11,12,13,14,17,18
DQ:7
DQA:04,05,06"
---
```{r}
#| include: false
library(tidyverse)
# Format the UA string for printing.
(UA_string <- params$UAs %>% str_replace_all(" ", " \\\\ "))
```
## Current NKR UAs (avoids):
`{r} UA_string`
I want my last line to print my string on six lines. Typst documentation here (Line Break Function – Typst Documentation) says placing a backslash and a space will create a new line, which is what I have attempted to do with UA_string <- params$UAs %>% str_replace_all(" ", " \\\\ ")
, but it does not print out with line breaks in the PDF.