Search code examples
pdfurllatexhrefpdflatex

LaTeX link error using href inside of tabular block


I have this LaTeX code:

\begin{tabular}[t]{@{}l} \small MY ADDRESS\\
\href{http://www.github.com}{github} \end{tabular}

Which is giving me this error and no other details...

Undefined control sequence.
<recently read> \href 

l.27 \href
         {http://www.github.com}{github} \end{tabular}

does anyone know why??


Solution

  • You need to load the hyperref package in order to use \href{<url>}{<stuff>}:

    enter image description here

    \documentclass{article}
    
    \usepackage{hyperref}
    
    \begin{document}
    
    \begin{tabular}[t]{@{}l}
      \small MY ADDRESS \\
      \href{http://www.github.com}{github}
    \end{tabular}
    
    \end{document}