5
\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{amssymb}
\usepackage{indentfirst}
\usepackage{algorithm}
\usepackage{algpseudocode}
\usepackage{graphicx}
\graphicspath{ {Desktop/} }

\title{Improvement of the Cascadic Multigrid Algorithm with a Gauss Seidel Smoother to Efficiently Compute the Fiedler Vector of a Graph Laplacian}
\author{Shivam Gandhi \href{email: [email]}
\and \href{Tufts University Department of Mathematics}}
\date{November 2015}

I am writing a paper and the above code is causing problems when I compile in TeXworks through pdfTeX. It returns this issue:

Undefined control sequence.
\@author ->Shivam Gandhi \href 
                           {email: shivam.jgandhi@gmail.com} \and \href ...
l.20 \maketitle

I am not sure why this error is happening. I wrote the paper in ShareLaTeX and it compiled fine, but now there are problems.

Werner
  • 603,163
sjgandhi2312
  • 71
  • 1
  • 1
  • 3
  • \href is part of the hyperref package, and usually has the syntax \href{URL}{text}. If you try adding \usepackage{hyperref} and use that syntax, does it help? – Arun Debray Feb 05 '16 at 20:27
  • I added that line and it caused a new error: Undefined control sequence. l.1 \usepackage [utf8]{inputenc} – sjgandhi2312 Feb 05 '16 at 20:34

2 Answers2

4

\href refers to a hyper reference that you want to include. In order to do so, you need to include

\usepackage{hyperref}

in your preamble. Note that there may be conflicts when using that package. If this occurs, load order may be important. Additionally, \href[<options>]{<URL>}{<text>} takes two mandatory arguments. The first would be a URL, while the second is what's displayed in the text.

enter image description here

\documentclass{article}

\usepackage{hyperref}

\title{Here is a title}
\author{A Author \href{abc}{abc}
  \and B Author \href{def}{def}}

\date{November 2015}
\begin{document}
\maketitle
\end{document}
Werner
  • 603,163
  • +1. Minor nit: The first argument of \href need not be URL. It could also be (especially in the case of an email address) something like mailto:somebodys.userid@someplace.com. Clicking on such a link won't load a website but, rather, invoke an email program and open a page with the recipient's address inserted in the "To" line. – Mico Feb 05 '16 at 20:28
  • @Mico: True. One can include any hyperlink directive, including mailto: or otherwise. – Werner Feb 05 '16 at 20:29
  • @Mico mailto:somebodys.userid@someplace.com is also an URL – just with a different scheme. Have a look at https://en.wikipedia.org/wiki/Uniform_Resource_Locator for more information. – Benjamin Feb 06 '16 at 14:24
  • @Benjamin - Thanks for this. I didn't know that the term URL was so general. – Mico Feb 07 '16 at 23:57
1

I would use it this way:

\documentclass{article}
\usepackage[a6paper]{geometry}%% only for demo
\usepackage{hyperref}
\title{Here is a title}
\author{A Author\thanks{\url{abc@de}}
    \and B Author\thanks{\url{def.de}}}
\date{November 2015}
\begin{document}
    \maketitle
\end{document}

enter image description here