# LaTeX doesn't like my equation… what's up?

It's been awhile since I've used LaTeX to write. I'm trying to write a simple equation into my text, but I cannot seem to get it to work. I'm sure it's quite simple, but even after comparing with other similar texts, I cannot identify what's wrong with the equation, nor whether or not I'm missing something in the preamble.

Please check it out. My LaTeX program keeps giving me a ton of error messages such as missing \$, extra }, etc.

\documentclass[12pt]{article}
\usepackage{geometry}
\geometry{a4paper}
\usepackage[toc,page]{appendix}
\usepackage{tabularx,dcolumn,ragged2e,caption}
\usepackage{booktabs}
\usepackage{siunitx}
\usepackage[inline]{enumitem}
\usepackage{graphicx}
\usepackage{float}
\usepackage{wrapfig}

\usepackage{amsmath}

\begin{document}

\begin{equation*}
y_{ijt} = \alpha_{0} + \textbf{x_{ijt} \varphi} + c_{i} + s_{j} + \tau_{t} + \varepsilon_{ijt}
\end{equation*}

\end{document}

• Why did you write  \textbf{ before x_{ijt}? – CarLaTeX Sep 17 '17 at 15:29
• @CarLaTeX Probably to get a bold math font... – TeXnician Sep 17 '17 at 15:29
• @TeXnician Probable, I saw your answer, but it seems a bit strange to have one variabile bold if the other ones in the equation are not... but I'm not a mathematician :):):) – CarLaTeX Sep 17 '17 at 15:32

You should change \textbf{x_{ijt}} to \mathbf{x}_{ijt} and exclude the phi from the bold part.

\documentclass[12pt]{article}
\usepackage{geometry}
\geometry{a4paper}
\usepackage[toc,page]{appendix}
\usepackage{tabularx,dcolumn,ragged2e,caption}
\usepackage{booktabs}
\usepackage{siunitx}
\usepackage[inline]{enumitem}
\usepackage{graphicx}
\usepackage{float}
\usepackage{wrapfig}

\usepackage{amsmath}

\begin{document}

\begin{equation*}
y_{ijt} = \alpha_{0} + \mathbf{x}_{ijt} \varphi + c_{i} + s_{j} + \tau_{t} + \varepsilon_{ijt}
\end{equation*}

\end{document}


I assume that both x in x_{ijt} and \varphi should be typeset in bold -- but not the ijt index. Moreover, the product of these two variables should be an inner product, right? If so, load the bm ("bold math") package and write

{\bm{x}_{ijt}}'\bm{\varphi}


A full MWE (with a much-simplified preamble):

\documentclass[12pt]{article}
\usepackage{amsmath,bm}
\begin{document}
$y_{ijt} = \alpha_{0} + {\bm{x}_{ijt}}'\bm{\varphi} + c_{i} + s_{j} + \tau_{t} + \varepsilon_{ijt}$
\end{document}


• I prefer \bm{x}'_{ijt}} ;-) – Tarass Sep 17 '17 at 17:11
• @Tarass - Thanks. I guess I'm trying to indicate -- possibly too pedantically -- that ' is being used as the transpose-cum-multiplication operator, between the vectors \bm{x}_{ijt} and \bm{\varphi}. I'll freely admit to the possibility of having misinterpreted the OP's reasons for bold-facing some of the symbols. – Mico Sep 17 '17 at 17:31
• I can't guess what OP wants. But the ' seems to far from x. That's all. Thank you. – Tarass Sep 17 '17 at 17:39