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

1 Answer 1

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! Commented Feb 7, 2020 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... Commented Feb 7, 2020 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. Commented Feb 7, 2020 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} Commented Feb 7, 2020 at 22:36

You must log in to answer this question.

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