You want the variable denoting a vector to be boldface, not its subscript. For making bold a letter in math mode the best way is to use \mathbf
; however it's even better to hide this in a personal command:
\newcommand{\vect}[1]{\mathbf{#1}}
so that your document becomes
\documentclass{article}
\usepackage{amsmath} % necessary for math intensive documents
\newcommand{\vect}[1]{\mathbf{#1}}
\begin{document}
\title{Project 1}
\author{[email protected]}
\maketitle
\section{Tools}
Text.
\section{Algorithm}
Text. Text:
\[
\min_{\vect{w}} \sum_{i=1}^n (y_i - \vect{w}^T \vect{x}_i)^2 +
\lambda \lVert\vect{w}\rVert_2^2
\]
Text.
\end{document}
Why doing it indirectly? There are several reasons to. Let's see the two main ones:
You're marking up your document; when you want to find vectors in the typescript, you'll look for \vect
rather than \mathbf
that might have been used also for other purposes.
If you decide that, after all, boldface italic is better (the ISO regulations prescribe this for vectors, for instance), you can simply change one line in your document (and add the call to a package):
\usepackage{bm}
\newcommand{\vect}[1]{\bm{#1}}
Notes on the typing style.
Don't use \newline
; paragraphs should be simply separated by a blank line in the typescript.
Never leave blank lines before a displayed equation in the typescript.
The most common operators have already a definition: use \min
for the “minimum” operator.
Note that it's \vect{x}_i
and not \vect{x_i}
, because the subscript is appended to the variable name and it shouldn't be specially formatted.
With amsmath
(that's recommended for documents using mathematics), instead of \|
for representing a double bar, it's better to use the specific delimiters \lVert
and \rVert
. Look at the documentation of mathtools
for even better ways to mark up a document (a \norm
command is explained).
@
should be a problem. I have never escaped it. (It's catcode is other anyways, it cannot cause any problems and it surely doesn't belong in mathmode).\textbf
inside math-mode, that's okay. But that turns its argument into text-mode, yet you havex_i
which requires math-mode to set the subscript. For this it seems like you could be after something like\mathbf{x}_i
instead.