如何在 LaTeX 中對齊線條?

如何在 LaTeX 中對齊線條?

我正在用這個地點編寫我的乳膠方程式並將其作為圖像下載到我的部落格中。我想寫一些看起來像該網站上圖像中的方程式的東西。我怎樣才能做到這一點?

我想要的乳膠方程

這是我嘗試過的,

\\
MSE = \frac{\sum_{i = 1}^{n} (y_i - \hat{y_i})^2}{n}
\\
\\
(OR)$$
\\
\\
MSE = \frac{SSE}{n}

它給了我這個,

輸出

答案1

由於gather環境不行https://latex.codecogs.com/eqneditor/editor.php, 試試這個:

\begin{array}{c}
\mathrm{MSE}=\frac{\sum_{i=1}^{n}(y_i-\hat{y}_{i})^{2}}{n}\\[2mm]
\text{(OR)}\\[2mm]
\mathrm{MSE}=\frac{\mathrm{SSE}}{n}
\end{array}

在此輸入影像描述

答案2

一個簡單的解決方案gather*

\documentclass{article}
\usepackage{amsmath}

\begin{document}

\begin{gather*}
MSE = \frac{\sum_{i = 1}^{n} (y_i - \hat{y_i})^2}{n}
\\[2ex]
\text{(OR)}
\\[2ex]
MSE = \frac{SSE}{n}
\end{gather*}

\結束{文件} 在此輸入影像描述

相關內容