2

Using \href{mailto:[email protected]}{[email protected]} I am able to render my email as a clickable text. Is there a way to add email as a part of \author{} field, and have \maketitle generate a link that will call an email client when clicked? I am using KOMA-Script. MWE:

\documentclass[a4paper,12pt,titlepage=true]{scrartcl}
\usepackage[margin=2cm,footskip=1cm]{geometry}
\usepackage[table]{xcolor}
\usepackage{mathtools,amssymb}
\setlength{\jot}{10pt}
\usepackage{pgfplots}
\usepackage[T1]{fontenc}
\usepackage{lmodern}
\usepackage{textcomp}
\usepackage[utf8]{inputenc}
\usepackage[pdftex]{hyperref}
\hypersetup{
  pdfauthor={x},
  pdftitle={x},
  colorlinks=false,
  urlbordercolor={0.9 0.5 0.1},
  pdfborderstyle={/S/D/W 1}
}

\begin{document}
\titlehead{\centering x\\y\\z}
\subject{my subject}
\title{my title}
\author{author1\\[email protected]}
\date{2017}
\maketitle
\end{document}

Also, any comments on the preamble regarding (improper) use of packages are welcome. Thanks!

6
  • 1
    Welcome, get rid of the pdftex option.
    – Johannes_B
    Commented Mar 26, 2017 at 13:31
  • 1
    Can't you just add that \href stuff into \author?
    – Johannes_B
    Commented Mar 26, 2017 at 13:32
  • Welcome! Have you tried to use your proposed \href command instead of the textual email address in the \author command? When I view the resulting pdf, my viewer tries to open an email client when I click on the email address.
    – gernot
    Commented Mar 26, 2017 at 13:33
  • \author{author1\\ \href{mailto:[email protected]}{[email protected]}} is ugly style but seems to work fine. Can you elaborate what difficulties your are facing? Commented Mar 26, 2017 at 13:36
  • 1
    See Why I shouldn't load pdftex option with hyperref?
    – gernot
    Commented Mar 26, 2017 at 13:55

2 Answers 2

3

As gernot and samcarter suggested \author{author1\\ \href{mailto:[email protected]}{[email protected]}} solves the issue. Thank you!

1

Simpler and more powerful answer is to \usepackage{url} and then just code \author{Name, \url{[email protected]}}.

Re packages: do NOT use geometry to typeset wide lines of body text. It is well established that people have trouble comprehending wide lines of text. The practical maximum is about 14cm, as coded in the standard LaTeX. If you want your work understood, then do NOT typeset with body text wider than 14cm.

Conversely, if you are writing a report with embarrassing information in it than you want to obfuscate, then use body text as wide as you can.

1
  • This doesn't seem to work in the \email{} field though, e.g., \email{\url{[email protected]}}, why is that? I'm getting a ton of errors: "Runaway argument", "Argument of \MT@res@a has an extra }.", followed by several "Undefined control sequence." Why is that?
    – iko79
    Commented Jun 25 at 15:29

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .