I am using \iffieldequals{pubstate}{str} to test the pubstate of two different .bib entries. But even pubstate={foo}, it still behaves as if pubstate={str}. This is in response to the answer to the question:

Biblatex replace title with alternate field




\newbibmacro{ur}{under review}
\newbibmacro{ta}{to appear}

    {\iffieldequals{pubstate}{ur}{\printtext{Under review at\intitlepunct}}{}\clearfield{pubstate}}
    % {\iffieldequals{pubstate}{ur}{\printtext{Under review at\intitlepunct}}{\iffieldequals{pubstate}{ta}{\printtext{To appear in\intitlepunct}}{}}\clearfield{pubstate}}

  author = {Name AA and Name BB},
  title = {Article title name one},
  Year = {2016},
  journal = {Journal Name One},
  pubstate = {under review},

  author = {Name CC and Name DD},
  title = {Article title name two},
  Year = {2016},
  journal = {Journal Name Two},
  pubstate = {to appear},




incorrect_image The output should not have "Under review" for key2 because it has pubstate={to appear}.

Thank you for your help.


Short answer: Use

\iffieldequalstr{pubstate}{under review}


\newcommand*\ur{under review}


\newcommand*\ur{under review}

Where the first option is the preferred here I think.

Accoring to the documentation (p. 182)

\iffieldequals{<field>}{<macro>}{<true>}{<false>} Expands to true if the value of the <field> is equal to the definition of macro, and to false otherwise.

The value of the field in your case is under review.

If you issue \iffieldequals{pubstate}{ur} ur isn't even a macro and it evaluates to false (indeed I even got an error in one case).

What you need is a macro that expands to exactly under review, the easiest way is \def{\ur}{under review}, but \newcommand*\ur{under review} also works; on the other hand \newcommand\ur{under review} doesn't work because it defines a long macro. In that case you use


What's more

\newbibmacro{ur}{under review}

does not actually define a macro called \ur, but a long macro called \abx@macro@ur. \newbibmacro*{ur}{under review} defines a "normal" macro called \abx@macro@ur

Alternatively, you can use \iffieldequalcs where you don't give a macro, but a control sequence name (the macro without the backslash)


This has the advantage of not creating the overhead of additional macros. And it makes the condition slightly easier to understand and read in the code. The best solution here seems to be to use \iffieldequalstr to check if the field is equal to the string given in the second argument

\iffieldequalstr{pubstate}{under review}

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.