This doubts have to do with basic of how TeX (and LaTeX) operates, you should read an introduction.
Now, to your question, this will recreate exactly that output
\documentclass{article}
\begin{document}
\begin{equation} \textstyle
\mathcal{L}_{\mathcal{T}}(\vec{\lambda}) = \sum_{\mathbf{x},\mathbf{s}\in\mathcal{T}} \log P(\mathbf{x}|\mathbf{S}) - \sum_{i=1}^m \frac{\lambda_i^2}{2\sigma^2}
\end{equation}
\end{document}

But there's no reason for that \textstyle
to be there, in centered equations super- or subscripts are usually placed above and below the sumation symbol. So better to leave it out (unless you specifically want to have that exact output).
In any case, I would define semantic commands for \mathcal
, \mathbf
, and even may be \mathcal{L}
or \mathcal{T}
or P
. A few examples
If in one document one wants the vectors to be written with bold fonts, rather than an arrow above (which is not the case in your code, but it's just an example) it's better to use \vec{x}
(rather than \mathbf{x}
) and define \renewcommand*\vec[1]{\mathbf{#1}}
.
If you want to use \mathbb{N}
to denote number sets, may be it's better to use \numberset{N}
or \numberset{K}
in your document, rather than \mathbb{..}
. That way you have a semantic macro which also gives you freedom to redefine the macro whenever you want;
even more, you can, in turn, define \N
or \naturals
to be \numberset{N}
, or \reals
/\R
to be \numberset{R}
. That way you abstract even further. The document would be simpler to write and to read.
And you can use \Pr
for the \Pr(x|y)
in case it's a probability, and may be redefine \Pr
to your taste.
Of course, if you are using something once in a document, there's no need for this, but if you are using something again and again, it's definitely beneficial for your document to have semantic and symbolic macros, at a more higher level, rather than use the “core tools” directly.
\textstyle
just after\begin{equation}
and write your code as\mathcal{L}_{\mathcal{T}}(\vec{\lambda}) = \sum_{\mathbf{x},\mathbf{s}\in T} \log P(\mathbf{x}|\mathbf{S}) - \sum_{i=1}^m \frac{\lambda_i^2}{2\sigma^2}
. But you should define a semantic command rather than use\mathbf
, and also I don't see a reason to use\textstyle
there, it looks better by default (which would equal\displaystyle
). – Manuel Sep 27 '16 at 11:54