0

Me and my co-author are writing a paper in latex and we want to have the author's names under the title with their email addresses directly under their names and their institutional affiliation (same for both authors) as a footnote. The following code we have does what its supposed to but throws a warning and I don't understand why. Any ideas?

The code is

\documentclass[american,parskip=half]{scrartcl}
\usepackage[utf8]{inputenc}

\usepackage[english,pdfusetitle,colorlinks]{hyperref}

%unnumbered footnote
\newcommand\nnfootnote[1]{%
  \begin{NoHyper}
  \renewcommand\thefootnote{}\footnote{#1}%
  \addtocounter{footnote}{-1}%
  \end{NoHyper}
}

\begin{document}

\title{Title}
\date{}
\author{%
  author1\thanks{affiliated institute address}\\%
  {\footnotesize\href{mailto:[email protected]}{[email protected]}}
  \and 
  author2\footnotemark[1]\\%
  {\footnotesize\href{mailto:[email protected]}{[email protected]}}
}

\maketitle
text
\end{document}

If I remove everything inside of \author{}, then the warning disappears. The warning is

Package hyperref Warning: Token not allowed in a PDF string (PDFDocEncoding):
(hyperref) removing `\@ifnextchar' on input line 29.
[1
{/var/lib/texmf/fonts/map/pdftex/updmap/pdftex.map}] [2])

Thanks in advance.

4
  • 2
    always show a small but complete example so that we can test the issue. Sep 29, 2022 at 13:55
  • Welcome to TeX.SX! Please help us help you and add a minimal working example (MWE) that illustrates your problem. Reproducing the problem and finding out what the issue is will be much easier when we see compilable code, starting with \documentclass{...} and ending with \end{document}.
    – dexteritas
    Sep 29, 2022 at 14:42
  • Remove \footnotemark[1] to make the warning disappear. The metadata will be generated fine. Sep 29, 2022 at 17:37
  • Removing \footnotemark[1] makes the warning dissapear, but also the footnotemark and we want the footnotemark next to both authors names
    – Dasi
    Sep 29, 2022 at 17:42

1 Answer 1

0

Without using pdfusetitle you can produce your custom metadata (and no warning) defining pdftitle and pdfauthor

\documentclass[american,parskip=half]{scrartcl}

\usepackage[english,colorlinks]{hyperref}

%unnumbered footnote
\newcommand\nnfootnote[1]{%
    \begin{NoHyper}
        \renewcommand\thefootnote{}\footnote{#1}%
        \addtocounter{footnote}{-1}%
    \end{NoHyper}
}

\hypersetup{% set title and author of the metadata <<<<<<<<<<<<<<<<<<<
    pdftitle={Title},
    pdfauthor={author1, [email protected] ; author2, [email protected]}
}

\begin{document}
    
    \title{Title}
    \date{}
    \author{%
        author1\thanks{affiliated institute address}\\%
        {\footnotesize\href{mailto:[email protected]}{[email protected]}}
        \and 
        author2\footnotemark[1]\\%
        {\footnotesize\href{mailto:[email protected]}{[email protected]}}
    }
    
    \maketitle
    text
\end{document}

a

The original metadata included a [1] from \footnotemark[1] that shouldn't be there.

c

2
  • This worked, thanks a lot.
    – Dasi
    Sep 29, 2022 at 20:00
  • @Dasi Thank you for your feedback! You might add the subject and the keywords to the pdf metadata for the benefit of the search engines eg pdfsubject={Main subject}, pdfkeywords={One, Two, Three} Sep 29, 2022 at 20:05

You must log in to answer this question.

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