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
\begindoesn't match its definition" at line 31, i.e.\maketitleThese 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.
amsartdocument class, you, however, use theacmartclass 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\authorcommand which is the culprit of the errors. Shota's example works fine. – Sam Nov 10 '20 at 08:28