### Bug description

From https://github.com/quarto-dev/quarto-cli/discussions/1182

````markdown
---
format: pdf
keep-md: true
keep-tex: true
---

```{r}
#| label: tbl-md
#| tbl-cap: "$\\beta$~1~"
knitr::kable(data.frame(x = rnorm(5)))
  
```

```{r}
#| label: tbl-latex
#| tbl-cap: "$\\beta$~1~"
knitr::kable(data.frame(x = rnorm(5)), format = "latex")
```
````

![image](https://user-images.githubusercontent.com/6791940/174641745-ddc6ff1a-56d4-48d1-8e76-a91ddc62462d.png)


In the first case `kable()` will produce Markdown table, and we will process the code in there, setting the table caption as a Caption element in the AST which will preserve the `$ $` math syntax. 
https://github.com/quarto-dev/quarto-cli/blob/0501d0708794a5030fc3b3f64dfca23e93200c0a/src/resources/filters/quarto-pre/table-captions.lua#L136-L140

In the second case, the table produced will be LaTeX, and in this case, we'll process there: 
https://github.com/quarto-dev/quarto-cli/blob/0501d0708794a5030fc3b3f64dfca23e93200c0a/src/resources/filters/quarto-pre/table-captions.lua#L201-L205

We are loosing the `$ $` math syntax when calling `stringify` I believe, so when calling `stringEscape()` the `\beta` will not be correctly parsed as Math. 

If we want to support Markdown syntax for table caption, we should probably align the two treatment. 

Using Dev version of Quarto, on Windows 11.

### Checklist

- [X] [formatted your issue](https://yihui.org/issue/#please-format-your-issue-correctly) so it is easier for us to read?
- [X] included a minimal, self-contained, and reproducible example?
- [X] documented the quarto version you're running, by providing the output produced by `quarto check` in a terminal in your issue?
- [ ] documented the RStudio IDE version you're running (if applicable), by providing the value displayed in the "About RStudio" main menu dialog?
- [X] documented which operating system you're running? If on Linux, please provide the specific distribution as well.
- [X] upgraded to the latest version, including your versions of R, the RStudio IDE, and relevant R packages?
2022-06-20T16:10:08Z
cderv
bug
Future
open
Table caption is not parsed the same when using Markdown table or LaTeX table.
https://github.com/quarto-dev/quarto-cli/issues/1185