-
-
Notifications
You must be signed in to change notification settings - Fork 975
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[FR] Options for equations #2157
Comments
I suppose you are using this for PDF output ? I think this is related to the idea in rstudio/bookdown#959 Does the bookdown issue cover your idea ? |
Indeed, the idea in that issue is pretty close to what I had in mind. I was thinking maybe standard Rmarkdown could support this, since it already supports options for code, so options for math would be logical to have. But if Bookdown is already working on similar features (like here, I think: rstudio/bookdown#940), I guess my request is pretty much a duplicate |
Duplicate of rstudio/rstudio#5264 |
As Yihui shared I think the underlying issue is a preview support for environment inside the RStudio IDE rstudio/rstudio#5264 Once that will be supported, it will be possible to have the preview. Otherwise, support for numbering equation using a syntax like $$
math
$$ {#eq:label} is followed in rstudio/bookdown#959 I'll close this hear to keep our tracking board simpler. Thanks ! |
This old thread has been automatically locked. If you think you have found something related to this, please open a new issue by following the issue guide (https://yihui.org/issue/), and link to this old issue if necessary. |
I found myself struggling to number equations and stumbled upon this post on Stack Overflow and was led to the corresponding chapter in "Authoring Books with R Markdown", which says that numbering equations can be done by putting them in the LaTeX
equation
environment:The issue
The problem I see with this is that by using raw LaTeX, I seem to forego the very useful preview in RStudio:
I don't get this when using raw LaTeX:
I can't visualize the equation by looking at LaTeX code (which quickly gets messy), so the lack of preview means that I'll be writing LaTeX and recompiling the project all the time to check whether the math is correct.
If I try to surround the equation with the
equation
environment, like this:...it gets compiled to incorrect LaTeX (well, not incorrect, but that's not what I wanted):
I half-expected the
\[\]
environment to be entirely replaced by\begin{equation}\end{equation}
, but I guess it makes sense that it wasn't.A potential solution
You can provide arguments to code blocks:
Theorems use the same syntax.
So maybe it could be useful to introduce similar syntax for equations as well?
For instance, this:
...would generate this LaTeX:
Other options may include:
tag=2
), instead of writing\tag{the_tag}
)label="my_label"
), instead of(\#eq:binom)
), where, according to the book, theeq:
prefix is mandatory, which is weird: why have a mandatory prefix?The text was updated successfully, but these errors were encountered: