[Tex/LaTex] “File ended while scanning use of \math@egroup” error

compilingerrors

The error mentioned above is preventing me from compiling my code. Here's what I think is the related code:

    \begin{enumerate}

    \item[\textbf{5.9}]``To every pair $A, B$  of vector spaces one can assign the vector space $Hom(A,B)$ consisting for all homomorphisms from $A$ to $B$. If $f: A_1 \rightarrow A_2$ and $g: B_1 \rightarrow B_2$ are morphisms in $\mathbf{Vec_{\mathbb{R}}$, then the vector space homomorphism $Hom(f,g): Hom(A_2, B_1) \rightarrow Hom(A_1, B_2)$ is given by $\phi \mapsto g \circ \phi \circ f$." \vspace{11pt}\\

    \end{enumerate}

Any help would be appreciated. I tried moving the code to a different .tex file but the same error occurred, so I don't think the error is specific to the file.

Best Answer

$\mathbf{Vec_{\mathbb{R}}$

is missing a }

Note the full error message which you did not show highlights the mis-matched brace:

Runaway argument?
{Vec_{\mathbb {R}}$, then the vector space homomorphism $Hom(f,g): Ho\ETC.
! File ended while scanning use of \math@egroup.
<inserted text> 
                \par 
<*> pp565

? 

The runaway argument messages shows you that the brace { before Vec doesn't have a matching } and tex ran off the end of the file looking for it.

unrelated but Vec and Hom will be typeset in math italic designed to make them look like V * e * c not as a word. use

\DeclareMathOperator\Vec{Vec}

then use \Vec to get much better spacing.