I am trying to find out whether two references have the same author with natbib. But I seem to be unable to get basic string comparisons working. Without a deeper understanding, I have tried everything I could find (xstring, \detokenize, \expandafter\relax, ...). Nothing really works. I would be so glad if someone could fix my Test function.

    @article{ArticleX, author = "AuthorA", year = "2000"}
    @article{ArticleY, author = "AuthorA", year = "2010"}
    @article{ArticleZ, author = "AuthorB", year = "2010"}
    Oh, \cite{ArticleX} and \cite{ArticleZ} don't have the same author? \Test{ArticleX}{ArticleZ} Ok!

    But \cite{ArticleX} and \cite{ArticleY} surely have! \Test{ArticleX}{ArticleY} No, either??


This works:

% https://tex.stackexchange.com/questions/8981/

I still welcome more elegant answers, but this solves my problems.

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.