quarto-dev / quarto-dev/quarto-cli
Option to render display math blocks as images?
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 6k
- Forks
- 458
- Avg merge
- 1d 9h
- Merged PRs (30d)
- 41
Description
I use Quarto (and previously just pandoc) at work to write docs that often include LaTeX math blocks. Unfortunately for me, to get anyone to read them, I have to convert them to Google Docs.
That often works fine by rendering as .docx, uploading the doc, and converting it to a Google Doc. However, I usually have issues with display math blocks not rendering correctly when converting from docx to Google Docs.
I'm thinking about a potential workaround where I could tell Quarto to render those display math blocks as images, so they'd display correctly in Google Docs. Is that already possible? I'd also think a feature like this might be useful in other scenarios outside of just my use case.
My current workflow is to render the doc in a different format, screenshot the correctly-rendered math blocks, and paste them into the Google Doc manually. But it would be really nice to be able to automate that step. :)
Example of the rendering issue
---
title: "Quarto to Google Docs math example"
self-contained: true
format:
html:
toc: true
pdf:
toc: true
docx:
toc: false
---
Inline math often renders OK: $1 = \sum_{i=1}^n \pi_i$.
Math blocks are also sometimes OK:
$$
1 = \sum_{i=1}^n \pi_i.
$$
But more complicated ones usually have issues like:
$$
\begin{array}{ll}
\mbox{minimize} & f(x) \\
\mbox{subject to} & x \in C
\end{array}
$$
or like this:
$$
\begin{aligned}
x \in A \\
y \in B
\end{aligned}
$$
Google Docs

MS Word on Mac

HTML

Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the supplied Quarto example with the HTML, PDF, and DOCX formats, focusing on the display-math blocks that fail after conversion to Google Docs. Define the option and verify that eligible display equations are rendered as images in the DOCX output while inline math and other formats remain appropriately handled.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- latex
- Domain
- documentation
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100