I have a latex equation as part of an RMarkdown document that I'm knitting to an HTML file using knitr. I would like to use the LaTeX eqnarray
to align the equality signs. However, I would also like to change font sizes from the first equation to the next.
This works, but equality signs are not lined up:
---
title: "Test"
author: "Eric"
date: "5/14/2020"
output: html_document
---
\[
\large a = b \times (c + d)\\
{\small\begin{eqnarray}
a &=& \mathrm{var ~a}\\
b &=& \mathrm{var ~b}\\
c &=& \mathrm{var ~c}
\end{eqnarray}}
\]
The result:
I tried many different arrangements of brackets and terms. Here is an example that does not work:
---
title: "Test"
author: "Eric"
date: "5/14/2020"
output: html_document
---
#### Try to line up equal signs AND change font sizes (doesn't work)
\[
\begin{eqnarray}
\large a &=& b \times (c + d)\\
{\small
a &=& \mathrm{var ~a}\\
b &=& \mathrm{var ~b}\\
c &=& \mathrm{var ~c}}
\end{eqnarray}
\]
#### Try again (doesn't work):
\[
\begin{eqnarray}
{\large a &=& b \times (c + d)}
{\small
\\a &=& \mathrm{var ~a}\\
b &=& \mathrm{var ~b}\\
c &=& \mathrm{var ~c}}
\end{eqnarray}
\]
How do I line up the equal signs using eqnarray
while changing font sizes?