The python library sympy uses latex as one of its output formats.  It would be lovely if there was a way to integrate this with Quarto such that sympy spits out raw latex and Quarto passes it onto pandoc as latex.

For example, consider this `.qmd` document:

````markdown
---
title: "Test Document"
author: "Me"
format:
  pdf:
    documentclass: article
    papersize: a4
    code-background: true
    geometry:
      - margin=20mm
---

# Section 1

Just some basic text to start it off.  A beautifully rendered equation:

$$
a = \frac{2 \pi f_c}{\lambda_r} \sin(\theta - \alpha)
$$

Now we load sympy...

```{python}
#| output: false
from sympy import *
init_printing()
var('a, f_c, lambda_r, theta, alpha')
```

Then we can use sympy to create the equation and work with it.

```{python}
a_eq = (2 * pi * f_c) * sin(theta - alpha) / lambda_r
Eq(a, a_eq)
```

but it looks horrible!

It's useful because we can do integration etc all in the document:

```{python}
integrate(a_eq, theta)
```

We can change printing style, but it doesn't really help:

```{python}
print(latex(Eq(a, a_eq)))
```

It would be great if I could add `#| output=latex` or something so that it gets put in the document and processed by latex.
````

This is what it looks like:

![image](https://user-images.githubusercontent.com/670607/138085797-9b8dfa3d-9e88-4ec8-b0ff-9769c6e60491.png)

2021-10-20T11:39:26Z
abudden
closed
Feature request: sympy output support
https://github.com/quarto-dev/quarto-cli/issues/141