[Tex/LaTex] Getting strange misplaced \noalign error

errorsrules

I'm trying to add a horizontal line to my document, like so:

\documentclass[10pt]{article}
\usepackage{fullpage, graphicx, url}
\usepackage{dsfont}
\begin{document}



$ \mathds{C}$

\hline

\end{document}

however, this seems to generate an error message:

! Misplaced \noalign.
\hline ->\noalign 
                  {\ifnum 0=`}\fi \hrule \@height \arrayrulewidth \futurelet...
l.10 \hline

The error message is not particularly helpful to me – I can see that \hline is mapped to a \noalign, but I don't understand why this makes the \noalign misplaced.

Best Answer

\hline is for use within tabular, perhaps you want \hrule.

\documentclass[10pt]{article}
\usepackage{fullpage, graphicx, url}
\usepackage{dsfont}
\begin{document}

$ \mathds{C}$

\hrule

\end{document}