Reputation: 357
I am trying to write my first markdown document. Unfortunately, I have two smaller problems with markdown.
In the general running text (aside of code phrases) I would like to embed subtexts and mathematical fraction terms. I am aware that I could use pandoc or LaTex to circumvent these issues but for the purpose of the documentation it would be unwise to use too much outside material and with LaTex the format would loose its uniformity.
Is there an option to use subtexts and fractions simply with R?
Best and many thanks :).
For clarification - I would like to end up with something like that but of course not in Word but a Markdown output file:
Upvotes: 0
Views: 5084
Reputation: 686
This may not be the most concise way to do this, but it should do what you want.
Based on your question I am assuming that you are using Rstudio and have created an R Markdown document and saved it. (If you are doing markdown in another context this code will still probably work, but I tested it under these conditions.)
Try this:
This is text with <sub>subscript</sub> and <sup>superscript</sup> and <math><mfrac><mi>frac-</mi><mi>tions</mi></mfrac></math>.
<sub></sub>
tags for subscript
<sup></sup>
for superscript
Fractions were harder, but using <math></math>
then you can use <mfract><mfract>
to specify the fraction and <mi></mi>
to identify the text you want as the numerator and denominator.
Upvotes: 3