### Bug description

By default, my computer uses the `pdflatex` engine, although `xelatex` also produces this bug.

Removing any line other than `keep-tex: true` prevents the bug, but I need every line for my (more complex) file. Adding `echo: false` does not remove the entire bug, only the R code chunk. Other code chunks and pure latex code works wonderfully, I was proofreading my document when I noticed this problem.

Here is the buggy .qmd file
````md
---
format: pdf
keep-tex: true
---
- A
```B```{=latex}
```{r}
Sys.sleep(1)
```
````
which produces the following (truncated to the buggy part) .tex file
```tex
\begin{document}
\ifdefined\Shaded\renewenvironment{Shaded}{\begin{tcolorbox}[borderline west={3pt}{0pt}{shadecolor}, frame hidden, sharp corners, boxrule=0pt, breakable, interior hidden, enhanced]}{\end{tcolorbox}}\fi

\begin{itemize}
\tightlist
\item
  A
\end{itemize}

\begin{Shaded}
\begin{Highlighting}[]
\NormalTok{::: \{.cell\}}

\NormalTok{\textasciigrave{}\textasciigrave{}\textasciigrave{}\{.r .cell{-}code\}}
\NormalTok{Sys.sleep(1)}
\end{Highlighting}
\end{Shaded}

:::



\end{document}
```
which produces the PDF
![image](https://user-images.githubusercontent.com/63608009/234072254-b3403494-1e20-4176-9f8a-322ad21081dc.png)

## Technical details
RStudio version: 2023.03.0 Build 386
OS: Windows 10
```cmd
$ quarto.exe check

[>] Checking Quarto installation......OK
      Version: 1.2.475
      Path: C:\Users\xxxxx\AppData\Local\Programs\Quarto\bin
      CodePage: 1252

[>] Checking basic markdown render....OK

[>] Checking Python 3 installation....OK
      Version: 3.11.2
      Path: C:/Users/xxxxx/AppData/Local/Programs/Python/Python311/python.exe
      Jupyter: (None)

      Jupyter is not available in this Python installation.
      Install with py -m pip install jupyter

[>] Checking R installation...........OK
      Version: 4.2.2
      Path: C:/PROGRA~1/R/R-42~1.2
      LibPaths:
        - C:/Program Files/R/R-4.2.2/library
      rmarkdown: 2.21

[>] Checking Knitr engine render......OK
```

Is this something I did, or a proper bug?

### Checklist

- [X] Please include a minimal, fully reproducible example in a single .qmd file? Please provide the whole file rather than the snippet you believe is causing the issue.
- [X] Please [format your issue](https://quarto.org/bug-reports.html#formatting-make-githubs-markdown-work-for-us) so it is easier for us to read the bug report.
- [X] Please document the RStudio IDE version you're running (if applicable), by providing the value displayed in the "About RStudio" main menu dialog?
- [X] Please document the operating system you're running. If on Linux, please provide the specific distribution.
- [X] Please provide the output of `quarto check` so we know which version of quarto and its dependencies you're running.
2023-04-24T17:40:34Z
timothee-bacri
bug latex source-code
closed
qmd -> tex: strange code chunk
https://github.com/quarto-dev/quarto-cli/issues/5294