1

I wish to add a logo using \includegraphics in case a certain information is available.

I use the article class with the package authblk and put in the preamble:

\author[affiliation logo]{first lastName}

where logo should be an image. Ultimately, the logo will be wrapped in a \href command (but that part does not seem to create problem).

When I replace logo with

\includegraphics[width=0.4cm]{L-orcid}

I get the error message

! Use of \\author doesn't match its definition.
\new@ifnextchar ...served@d = #1\def \reserved@a      {
#2}\def \reserved@b {#3}\f...

Here is a complete example showing the problem:

\documentclass{article}

\usepackage{graphicx}
\usepackage{authblk}
\renewcommand\Affilfont{\fontsize{9}{10.8}\selectfont}

\title{adf}
\author[a, \includegraphics[width=0.4cm]{L-orcid}]{denis cousineau}
\affil[a]{my place}

\begin{document}

\maketitle

Some text...

\end{document}
0
2

For one thing, you can't use an optional argument within an optional argument, unless it is group-isolated. For another thing, \includegraphics must be protected in this context.

\documentclass[landscape]{article}

\usepackage{graphicx}
\usepackage{authblk}
\renewcommand\Affilfont{\fontsize{9}{10.8}\selectfont}

\title{adf}
\author[{a, \protect\includegraphics[width=0.4cm]{example-image}}]{denis cousineau}
\affil[a]{my place}

\begin{document}

\maketitle

Some text...

\end{document}

enter image description here

4
  • 1
    @segletes Thank you very much: I learned one major thing today: no optional arguments within optional arguments! Feb 7 '20 at 21:33
  • Uh?! @steven-b-segletes I just note that the left margin is now moved about 1 inch to the left? Any idea what is going on? If you remove the "landscape" option, the text is out of the page... Feb 7 '20 at 21:58
  • @DenisCousineau I don't use \authblk, so I just assumed that was strange, but predictable behavior. I'll give it some more thought, when I have a chance. Feb 7 '20 at 22:05
  • 1
    I can't explain why it worked, but the lag was based on the width of the logo, so I "scaled" it by adding \includegraphics[width=0.3cm,height=0.3cm,scale=0.0000125]{L-orcid} Feb 7 '20 at 22:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.