1

I want to add the ORCID badge for the author of an article. I've copied the code exactly from this source: https://gugushvili.github.io/blog/2019/08/09/orcid

\documentclass{acmart}
\usepackage{lipsum}
\usepackage{tikz,xcolor,hyperref}
\definecolor{lime}{HTML}{A6CE39}
\DeclareRobustCommand{\orcidicon}{
    \begin{tikzpicture}
    \draw[lime, fill=lime] (0,0) 
    circle [radius=0.16] 
    node[white] {{\fontfamily{qag}\selectfont \tiny ID}};
    \draw[white, fill=white] (-0.0625,0.095) 
    circle [radius=0.007];
    \end{tikzpicture}
    \hspace{-2mm}
}
\foreach \x in {A, ..., Z}{
    \expandafter\xdef\csname orcid\x\endcsname{
        \noexpand\href{
            https://orcid.org/\csname orcidauthor\x\endcsname
            }
        {\noexpand\orcidicon}
    }
}
\newcommand{\orcidauthorA}{0000-0001-5446-5645}
\begin{document}
\title{OrcidProblem}
\author[Mickey Mouse]{Mickey Mouse\orcidA{}}
\authornote{lead author}
\affiliation{
  \institution{StackExchange}
}
\maketitle
\section{Introduction}
\lipsum
\end{document}

However, I get syntax errors:

  • "Undefined control" at line 24, i.e. \begin{document}
  • "Use of \begin doesn't match its definition" at line 31, i.e. \maketitle These errors can be ignored perhaps, but I'm also getting junk output in the result PDF of this form:
[lime, fill=lime] (0,0) circle [radius=0.16] node[white] ID; [white, fill=white] (-0.0625,0.095) circle [radius=0.007];tikzpicture[lime, fill=lime] (0,0) circle [radius=0.16] node[white] ID; [white, fill=white] (-0.0625,0.095) circle [ra-dius=0.007]; tikzpicture

I'm using Overleaf.

Sam
  • 2,958
Phasmid
  • 111
  • 1
    Hi Phasmid and welcome to TeX.SX. You haven't copied the code exactly. The example by Shota Gugushvili uses the amsart document class, you, however, use the acmart class which is entirely different. I didn't took the time to solve the issue but I can say that the class you are using greatly redefines the \author command which is the culprit of the errors. Shota's example works fine. – Sam Nov 10 '20 at 08:28
  • Since I'm required (I think) to use the acmart class, it sounds like I just won't be able to include the ORCID ids this way. Thanks for the answer. – Phasmid Nov 11 '20 at 15:32

0 Answers0