Open ajfriend opened 2 years ago
I'm not aware of any way to do this. With HTML you can use gladtex to embed images or webtex to embed links to webtex equation URLs. One thing I've seen suggested is to create HTML (possibly with theme: none
or minimal: true
) with one of these options, and then convert that HTML back into docx (using a raw pandoc conversion command).
Do you mean any way to do this currently, or would this be a reasonable feature request?
For example, would it be possible to add a tag to denote a block as something that should be converted to an image and embedded?
Something like:
:::{.math-as-image}
$$
\begin{array}{ll}
\mbox{minimize} & f(x) \\
\mbox{subject to} & x \in C
\end{array}
$$
:::
We don't have an easy way to convert that to an image right now (Pandoc can convert it to "native" math but not an image without an external program like gladtex).
So I think for now there will be various multi-step workarounds possible (e.g. convert to html w/ gladtex or webtex then convert to word, then on to gdocs) but this isn't something we'll be tooling up. If we do decide to create a "Google Docs" format I suspect we'll want to tackle this problem in earnest.
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
Google Docs
MS Word on Mac
PDF
HTML