Equations not appearing in word

I used R markdown to produce word file, but the equations are not appearing. Unlike producing pdf the equations are appearing. I got this problem only when I used Mac, so I don’t know were is the problem.
For example , $t_1$ will not appear
Can anyone help

Sorry, I can't reproduce it.

Here's a sample Rmd file:

---
output: word_document
---

Normal text and $LATEX_{text}$ and again normal text

$$
LATEX_{equation}
$$

Normal text

```{r}
sessionInfo()
```

Here's the screenshot of the docx file:

1 Like

I have the same sessionInf output as yours but still the equations didn’t appear

you ran the same example has @Yarnabrina and you don't get the same result ?

Yes , any suggestions to solve my problem

The reprex above is also working for me. Without being able to reproduce, it is difficult to help find the source of the issue.

What would be advice:

  • Update your packages
  • Create and post here a reproductible example of the issue on your computer
  • Post session info run on your computer.
  • For Rmarkdown issue, check also pandoc version

Currently, I can't think of what is wrong.. :thinking:

1 Like

Here is an example
———
Output: word_document
————
When the sample is large enough, the data can be grouped into M fixed intervals, t_i , t_{i-1}

Going to ask something very dumb. How have you opened this file? Using Preview? Or, using MS Word?

I don't know why (I'm pretty new to Mac), but on my device Preview fails to load latex, while MS Word works as it should.

I don’t know if I got your question well, I used knit to produce the file. I am also new to Mac that’s why I didn’t know the problem. I installed texstudio and miktex , since then I could create pdf but that didn’t solve the problem of the equations in Word.
You have to check if you attached the packages : rmarkdown , knitr , tinytex ,

Now I understood your question. The file opens using preview

And, what happens if you use ms word?

1 Like

You solved my problem, so thank you. :slight_smile:
Since I am new to Mac I thought preview is the same as ms word .. when I opened the file in ms word all the equations were there and that was what I needed.
I still wonder why preview word don’t support latex ! :thinking:

To be clear, LaTeX is not involved when the output format is Microsoft Word. Instead, Pandoc is converting the math into Office Math Markup (OMML), part of the Office Open XML standard.

This is understandably confusing :sweat_smile: since the R Markdown source uses LaTeX-style markup for the math, but that’s basically just a convenience (since LaTeX-style math markup is perhaps most familiar to end-users).

But yes, Preview does not display all aspects of docx files with perfect fidelity, and OMML is one of those cases. It’s a good idea to check the document for rendering errors in Microsoft Word itself :grinning:.

2 Likes

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.