 # RMarkdown uneven distance

Hi
I have four equations below each other. When I generate the HTML the vertical distance of the last equation is bigger than the previous ones.

Here is the code

---
title: "Untitled"
author: "Renger"
date: "8 3 2021"
output: html_document
---

{r setup, include=FALSE}
knitr::opts_chunk\$set(echo = TRUE)


## R Markdown

$$\theta_{NS} = \frac{U_{S}}{BPW} \frac{U_{NS}}{U_{NS}+ U_{RS}+U_{SS}}$$
$$\theta_{RS} = \frac{U_{S}}{BPW} \frac{U_{RS}}{U_{NS}+ U_{RS}+ U_{SS}}$$
$$\theta_{SS} = \frac{U_{S}}{BPW} \frac{U_{SS}}{U_{NS}+ U_{RS} +U_{SS}}$$
$$\theta_{UB} = 1 - \theta_{NS} - \theta_{RS} - \theta_{SS}$$
Besser wäre vielleicht der folgende Ansatz:
$$\theta_{EB} = \frac{BPW-U_{S}}{BPW}$$
$$\theta_{NS} = \frac{U_{NS}}{U_{NS}+U_{RS} + U_{SS}} (1 - \theta_{UB})$$
$$\theta_{RS} = \frac{U_{RS}}{U_{NS}+U_{RS} + U_{SS}} (1 - \theta_{UB})$$
$$\theta_{SS} = \frac{U_{SS}}{U_{NS}+U_{RS} + U_{SS}} (1 - \theta_{UB})$$


Any idea why this is the case? I uploaded a screenshot.

Cheers
Renger

Two spaces at the end of a line in Markdown means to add a line break between the lines. Like a new paragraph.
It seems you have two spaces after the 3rd equation, which cause the spacing with the 4th. Just remove them in the code above and there will be no spacing anymore.

You can also benefit the use of the new Markdown visual editor in RStudio 1.4 to help with page layout.

I had completely forgotten about that. Thanks!
Renger

1 Like

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

If you have a query related to it or one of the replies, start a new topic and refer back with a link.