Fivedia Da Lemon
Fivedia Da Lemon

Reputation: 15

R shiny MathJax Alignment issue

I have a number of rows of equations in my shiny app which I want to align by their equal sign but can't seem to get the align function to work properly. The code I have is as follows.

p("$$\\begin{align}
     \\ x^2 &=  \\text{Chi-Squared}
      \\ sum &= \\text{summation}
      \\ o &=  \\text{the observed values}
      \\ e &=  \\text{the expected values}
      \\end{align}$$")

This doesn't work though and I can't figure out how to align them properly. Any help would be greatly appreciated

Upvotes: 1

Views: 659

Answers (1)

Davide Cervone
Davide Cervone

Reputation: 12260

You have not terminated alignment rows. You need to add \\\\ at the end of each row (except the last):

p("$$\\begin{align}
     \\ x^2 &=  \\text{Chi-Squared} \\\\
     \\ sum &= \\text{summation} \\\\
     \\ o &=  \\text{the observed values} \\\\
     \\ e &=  \\text{the expected values}
     \\end{align}$$")

Upvotes: 3

Related Questions