# Equation with \label{} rendering issue within the IDE

Dear all,

I ran into a RStudio IDE case I am not sure how to investigate further.

Here is my Rmarkdown file to reproduce:

---
title: "reprex"
output:
pdf_document: default
html_document: default
---

{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)  # Hello $$y = \alpha \cdot x + \beta \label{eq:mytest}$$  I can produce html and PDF as expected. My issue is that the equation is displayed with RStudio as non valid. I guess, it is rendered with Mathjax without the AMS option. Anyone with idea how to have the equation also render in RStudio IDE? Extra info: Rstudio Version 1.2.1335 R version 3.6 OS: win10 Regards, jm You can use equation: --- title: "Example" author: "Anirban Ray" date: "12/07/2019" output: pdf_document --- Here's the$1^{st}$equation: $$\label{eq. A} \tag{*} x + y = 7$$ And, here's the$2^{nd}$one: $$\label{eq. B} \tag{\#} x - y = -2$$ Solving equations \ref{eq. A} and \ref{eq. B}, we get: $$x = 2, \ y = 5$$ Does it seem alright?  This generates try.pdf (73.2 KB) . Hope this helps. Edit: To use in html_document, use \\ref instead of \ref, and no need to use \ before #. I have no problem with the output content. It is what I expect. My issue is more about the WYSIWYG and user experience while working on the source in the IDE. I am observing the following behaviors: • $$equation$$ are rendered in the editor just bellow the line. •$equation\$ and $equation$ are rendered as tooltips when mousing over.

My understanding is that visual rendering while working on the markdown file within the IDE is not supporting amsmath extension while that's the default when producing the PDF or html.

Having the WYSIWYG matching the output would make the coding experience much easier and less error prone. Now I am kind on relaying on compile to PDF to catch errors.

Let me know if this clarify my question / issue.

Regards,

jm

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