關於格式化作者的問題

關於格式化作者的問題
\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}

我正在寫一篇論文,當我透過 pdfTeX 在 TeXworks 中編譯時,上述程式碼會導致問題。它會傳回這個問題:

Undefined control sequence.
\@author ->Shivam Gandhi \href 
                           {email: [email protected]} \and \href ...
l.20 \maketitle

我不確定為什麼會發生這個錯誤。我用 ShareLaTeX 寫了這篇論文,編譯得很好,但現在出現了問題。

答案1

\href指的是您想要包含的內容href為此,您需要包括

\usepackage{hyperref}

在你的序言中。請注意,使用該包時可能會出現衝突。如果發生這種情況,載入順序可能很重要。另外,\href[<options>]{<URL>}{<text>}需要強制性參數。第一個是 URL,第二個是文字中顯示的內容。

在此輸入影像描述

\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}

答案2

我會這樣使用它:

\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}

在此輸入影像描述

相關內容