The check for cases was not correct. We want to accept the word if either $p is nil, so there was no phrase to worry about, or i.downcase.index($p.downcase) is not nil, so the phrase was matched somewhere in the word. Changed: U trunk/Support/bin/LatexCitekeys.rb