\[
\colvec[1.7]{(-(1+\mathbf{J_{ee}})) & \mathbf{J_{ep}}& \mathbf{J_{es}}\\
\mathbf{J_{pe}} & -(1 + \mathbf{J_{pp}}) & -\mathbf{J_{ps}}\\
\mathbf{J_{se}} & -\mathbf{J_{sp}} & -(1 + \mathbf{J_{ss}})}\\
\colvec[1.7]{\hat{\bm{r_{e}}}\\
\hat{\bm{r_{p}}}\\
\hat{\bm{r_{s}}}}\\
\]
keeping getting an error: undefined control sequence and idk why
\documentclass{article}
\usepackage{graphicx,amsmath}
\newcommand{\colvec}[2][.8]{%
\scalebox{#1}{%
\renewcommand{\arraystretch}{.8}%
$\begin{bmatrix}#2\end{bmatrix}$%
}
}
\begin{document}
\title{Summer Project}
\author{Author}
\date{\today}
\maketitle
[
\colvec[1.7]{(-(1+\mathbf{J_{ee}})) & \mathbf{J_{ep}}& \mathbf{J_{es}}\
\mathbf{J_{pe}} & -(1 + \mathbf{J_{pp}}) & -\mathbf{J_{ps}}\
\mathbf{J_{se}} & -\mathbf{J_{sp}} & -(1 + \mathbf{J_{ss}})}\
\colvec[1.7]{\hat{\bm{r_{e}}}\
\hat{\bm{r_{p}}}\
\hat{\bm{r_{s}}}}\
]
\end{document}



\colvecis not a command I recognise from any package so getting an undefined command error for that would not be unexpected. – David Carlisle Jul 02 '21 at 14:31bmthen\bmwill be undefined. – David Carlisle Jul 02 '21 at 14:32\\at the top level inside\[...\]but\[is a single line math display, you can't use\\– David Carlisle Jul 02 '21 at 14:34\bmthe answer is loadbmpackage, if it is\colvecyou need to say what you want it to do, then someone can suggest a definition. You can use\\inside matrices but not at the top level of\[– David Carlisle Jul 02 '21 at 14:57\begin{document} \title{Summer Project} \author{Robert Csete} \date{\today}
\maketitle
[ \colvec[1.7]{(-(1+\mathbf{J_{ee}})) & \mathbf{J_{ep}}& \mathbf{J_{es}}\ \mathbf{J_{pe}} & -(1 + \mathbf{J_{pp}}) & -\mathbf{J_{ps}}\ \mathbf{J_{se}} & -\mathbf{J_{sp}} & -(1 + \mathbf{J_{ss}})}\ \colvec[1.7]{\hat{\bm{r_{e}}}\ \hat{\bm{r_{p}}}\ \hat{\bm{r_{s}}}}\ ]
– Robert Csete Jul 02 '21 at 15:09bmpackage you want to use the macro\bm. – campa Jul 02 '21 at 15:18