I'm trying to include the source citation everytime I use an image in my thesis. I have a self-written command to ease that process (code at the end of the post):

\bild[citation]{label for refs}{file}{name of the image}{size in cm}

When I try to include citation as a \cite-command (using the harvard-package), latex throws following error:

<argument> \cite 
\equal #1#2#3->\TE@throw \def \@tempa {#1
                                         }\def \@tempb {#2}\noexpand \ifx \@...

\NROrg@ifthenelse ...eval \the \toks@ \TE@endeval 
                                                  }\endgroup \@gtempa \expan...

\\bild ...-0.3cm\ifthenelse {\equal {#1}{\empty }}
                                                   {\caption [{#4}]{#4}} {\c...
l.12 ...en/aufgabenstruktur}{Aufgabenstruktur}{12}


The command I used was following:


I think this is a problem of the harvard implementation of \cite, as I recently used this piece of code with the bibgerm-package, where it worked like a charm. What am I doing wrong here? Is there any easy way to fix this problem?

Thanks in advance,


EDIT: Code of the \bild-macro:

      \vskip -0.3cm%
            {\caption[{#4} \newline \small{\textit{Quelle: #1}}]{#4}}%
      \vskip -0,2cm%

Used packages & document class:

\documentclass[a4paper, 12pt]{article}
  • Welcome to TeX.SE! Please edit your question to show (at a minimum) the actual definition of the \bild macro as well as the document class and any citation-relevant packages.
    – Mico
    Commented Jul 31, 2012 at 10:14
  • Thanks for your response. I added all of the information as i didn't really know what to leave out. Sorry. I also have to say that I used the same template when citing with bibgerm. I just added the geometry-package.
    – Uli
    Commented Jul 31, 2012 at 10:57
  • Welcome to TeX.sx! Please add a minimal working example (MWE) that illustrates your problem. And trim down your included packages, please - or add the kitchen sink. And please include the complete error message. Commented Jul 31, 2012 at 16:46

1 Answer 1


(Answer updated with full MWE)

Not having access to your image files or the bib file that sets up the entry with key ferstl_grundlagen_2008, I can't be entirely sure what's going on. Here's a suggested solution:

\usepackage[demo]{graphicx} % get rid of 'demo' option in real document
        {\small\emph{Quelle: #1}}

\bild[Ferstl (2008)]{fig:1}{FeSi-Aufgaben/aufgabenstruktur}%
\bild{fig:2}{FeSi-Aufgaben/aufgabenstruktur}{Neue Aufgabenstruktur}{10}

enter image description here

Incidentally, given that you use the harvard citation management package, you should probably be using the command \citeasnoun rather than \cite in the first, optional argument of \bild.

In addition, since it appears that you use the hyperref package as well, you may want to load the natbib and har2nat packages instead of the harvard package. The reason for this recommendation is that while hyperref works sort of OK with several citation management packages, it really does work best with the natbib package. As you can probably tell from its name, the har2nat package "translates" harvard-style citation commands (such as \citeasnoun) to equivalent natbib-style citation commands. That way, you can keep using the harvard-style citation commands while getting all the benefits of the good interplay between the natbib and hyperref packages

  • Thank you for your quick answer. Unfortunately, your solution for the \bild-macro throws the same error with both the \cite- and the \citeasnoun-command. Also, usage of the both packages you suggested throws another error: Undefined control sequence (\harvardcite). There is nothing I would love more than to replace the harvard-package with any other, but my prof demands a certain citation style which forces me to use makebst. The custom bst-file produces \harvarditem-bibliographies, so I think I'm stuck with this.
    – Uli
    Commented Jul 31, 2012 at 12:03
  • @Uli - Sorry, I should have mentioned that you will need to delete all aux files ahead of the first time you run the new setup (without harvard being loaded), in order to clear away all \harvardcite instances. I've also modified the example code to a full MWE.
    – Mico
    Commented Jul 31, 2012 at 12:24
  • 1
    Thank you very much! Works great! EDIT: what I recognized: I copied the source of the \bild-macro from my previous document and forgot to use the ifthen-package. This also most certainly was a problem.
    – Uli
    Commented Jul 31, 2012 at 12:43

You must log in to answer this question.

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