Closed dmurdoch closed 2 years ago
I just noticed that you addressed this in the README in June, suggesting a different invisible addition: \if{html}{\eqn{}}
.
Thanks for raising this issue and the suggested solution! Much better than that manual fix I suggested in the README.
This StackOverflow question shows that R renders HTML incorrectly when an
\mjeqn{}
macro is the first thing in a paragraph. The example there has a paragraph consisting of this line:which renders as
This happens because the
\mjeqn
macro expands into an\out{}
macro, which is not considered to be text by the Rd rendering machinery, so R thinks the paragraph starts after the macro. A workaround mentioned on SO is to put\emph{}
on the line ahead of the\mjeqn
, so that R thinks the\out
appears in the middle of a paragraph.Maybe
mathjaxr
could do that: instead of emitting a naked\out
, it could prefix it with\emph{}
or some other invisible text so that R realizes it is in a paragraph.Another possibility would be to fix the R conversion code, but I think
\out
could be used in situations where you don't want R to see text, so that would likely have worse side effects.