How to enter the following two equations in Latex?
-
5Please mention that what you tried so far?– MadyYuviJun 24 at 3:35
1 Answer
I guess there are (at least) two ways to interpret your question:
mimic the "look" of the screenshot you posted, with its turgid arrow symbols, needlessly oversized delimiter symbols, and unnecessary other symbols (e.g.,
\times
)give up on mimicing the screenshot's bloated look and, instead, write down some code that results in a streamlined yet easy-to-read look for both equations.
The following answer tries its hand at both looks. I hope you'll agree that the second look is a whole lot more appealing than the first.
\documentclass{article}
\usepackage{mathtools} % for \DeclarePairedDelimiter macro
\usepackage{old-arrows} % to keep arrow heads from becoming too large
\DeclareMathOperator\argmin{argmin}
\DeclareMathOperator\SEMD{SEM\_D}
\DeclarePairedDelimiter\norm{\lVert}{\rVert}
\begin{document}
bad:
\begin{align*}
&\overrightarrow{t} =
\mathit{argmin}\biggl(
\norm[\Big]{\,\overrightarrow{h} +
\overrightarrow{e} -
\overrightarrow{t} }^2\biggr) \\
&\mathit{SEM\_D} \bigl( \,
\overrightarrow{t_1},
\overrightarrow{t_2} \bigr)
=\frac{\overrightarrow{t_1}\bullet
\overrightarrow{t_2}}{%
\norm[\big]{\,\overrightarrow{t_1}}
\norm[\big]{\,\overrightarrow{t_2}}}
=\frac{\sum\limits_{i=1}^n
\overrightarrow{t_{1i}} \times
\overrightarrow{t_{2i}} }{%
\sqrt{\sum\limits_{i=1}^n
\bigl(\overrightarrow{t_{1i}}\bigr)^2} \times
\sqrt{\sum\limits_{i=1}^n
\bigl(\overrightarrow{t_{2i}}\bigr)^2}}
\end{align*}
\bigskip
good:
\begin{align*}
&\vec{t} =
\argmin\bigl(\norm{\vec{h} +\vec{e} -\vec{t}\,}^2\bigr) \\
&\SEMD \bigl( \, \vec{t}_1, \vec{t}_2 \bigr)
=\frac{\vec{t}_1\cdot \vec{t}_2}{%
\norm{\vec{t}_1} \norm{\vec{t}_2}}
=\frac{\sum_{i=1}^n
\vec{t}_{1i} \, \vec{t}_{2i} }{%
\sqrt{\sum_{i=1}^n(\vec{t}_{1i})^2} \,
\sqrt{\sum_{i=1}^n(\vec{t}_{2i})^2}}
\end{align*}
\end{document}