### Bug description

In LaTeX, it's common to define display equations that are within one paragraph and do not create a new paragraph. For example, if I write

```latex
The conditional intensity function can be written as 
$$\lambda(t) = \lim_{\Delta t \to 0} \mathbb{E}\left[\frac{N(t + \Delta t) - N(t)}{\Delta t}\right],$$
where $N(t)$ is the counting measure.
```
this is all one paragraph, and "where" is not indented. (If we're using blank spaces between paragraphs instead of indentation, there'd be no extra space here.) That's great for treating equations as part of text. The same applies for HTML, although since HTML documents typically aren't indented, the effect isn't as noticeable since it just changes vertical spacing slightly.

In an Rmd file with Knitr, this works fine:

```
---
title: "Test"
output: pdf_document
indent: true
---

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam tempus iaculis interdum. Fusce ac pretium orci. The conditional intensity function can be written as
$$
\lambda(t) = \lim_{\Delta t \to 0} \mathbb{E}\left[\frac{N(t + \Delta t) - N(t)}{\Delta t}\right],
$$
where $N(t)$ is the counting measure.

New paragraph. Aliquam sit amet feugiat arcu, sit amet posuere justo. Maecenas maximus ex nec nibh maximus, a mattis nibh convallis. Donec hendrerit tortor at ex ultricies posuere. Vestibulum facilisis maximus eleifend. 
```

This knits to the following:

<img width="635" alt="Screen Shot 2022-09-08 at 7 19 16 PM" src="https://user-images.githubusercontent.com/711629/189242202-4b5c55bd-19b7-4add-aeed-926e6a407132.png">

On the other hand, consider this Qmd:

```
---
title: "Test"
format:
  pdf:
    indent: true
---

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam tempus iaculis interdum. Fusce ac pretium orci. The conditional intensity function can be written as 
$$\lambda(t) = \lim_{\Delta t \to 0} \mathbb{E}\left[\frac{N(t + \Delta t) - N(t)}{\Delta t}\right],$$
where $N(t)$ is the counting measure.

New paragraph. Aliquam sit amet feugiat arcu, sit amet posuere justo. Maecenas maximus ex nec nibh maximus, a mattis nibh convallis. Donec hendrerit tortor at ex ultricies posuere. Vestibulum facilisis maximus eleifend. 
```

This renders to

<img width="586" alt="Screen Shot 2022-09-08 at 7 20 00 PM" src="https://user-images.githubusercontent.com/711629/189242258-b7e638a0-cd0b-4df1-8cae-643bfff75769.png">

In a math-heavy text where you introduce lots of equations, this is a problem, particularly if you have pages with plots and figures and LaTeX messes with the vertical spacing to get the page to fill up; you can get unsightly gaps before and after equations.

Ideally, when exported to Markdown for Pandoc to render, there should be no blank lines before and after `$$`, so that the equation is treated as part of the paragraph.

Oddly, if I use `\begin{equation*}` and `\end{equation*}` (or other math environments) instead of `$$`, this works correctly, and the equation is part of the same paragraph.

Versions: Quarto 1.1.189, TeX Live 2021, macOS 12.5.1; happens from CLI or RStudio, so not an RStudio thing

### 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.
cscheid
2022-09-08T23:29:04Z
capnrefsmmat
bug needs-repro
v1.2
closed
Display equations should not automatically create new paragraphs
https://github.com/quarto-dev/quarto-cli/issues/2373