The fourth book in Jasper fford's Thursday Next
series, which I am reading now, is called "Something Rotten."
Hamlet himself has a major supporting role along with Lady Hamilton and Bismarck.
If you haven't dipped into this quirky series, referred to somewhere as Harry Potter for adults, you need to ... and be sure you start with "The Eyre Affair" because it sets everything up. Personally I liked the second one, "Lost in a Good Book," the best.
Of course, you have to be able to handle perfectly outrageous literary puns. One minor character is named Millon deFloss.