The Shakespeare Code

At the end of the play, William Shakespeare announces a forthcoming sequel entitled Love's Labour's Won.

A witch called Lilith uses a voodoo doll to influence Shakespeare to declare that the new play will premiere the following evening.

When Lynley, the Master of the Revels, demands to see the script before allowing the play to proceed, Lilith plunges a voodoo doll made of his hair into a bucket of water and stabs it in the chest.

Lilith compels Shakespeare to write a strange concluding paragraph to Love's Labour's Won before flying away on a broom.

The Doctor helps him emerge from his catatonia long enough to reveal that the witches dictated the Globe's tetradecagonal design to him.

The Doctor identifies the witches as Carrionites, a species whose magic is based on the power of words which allows them to manipulate psychic energy.

The Doctor deduces that the Carrionites intend to use the powerful words of Love's Labour's Won to break their species out of imprisonment.

The Doctor confronts Lilith, who explains that the three witches were released from their banishment by Shakespeare's genius words after he lost his son Hamnet.

Shakespeare improvises a short rhyming stanza but is stuck for a final word until Martha blurts out Expelliarmus.

The Carrionites become trapped in a crystal ball the Doctor locks away in the TARDIS and all the copies of Love's Labour's Won are sucked back through the closing portal.

Among non-TV material, Shakespeare features in the Virgin Missing Adventures novels The Empire of Glass and The Plotters, and in the Big Finish Productions audio drama The Kingmaker.

Producer Russell T Davies and screenwriter Gareth Roberts have both stated that they were aware of these past references to meeting Shakespeare, but that they would neither be mentioned nor contradicted in the episode.

"[4] The name of the Carrionites derives from screenwriter Gareth Roberts' own New Adventures novel, Zamper (1995), which refers to a slug-like race known as "arrionites".

One of the putative lines of Love's Labour's Won, "the eye should have contentment where it rests", is taken from episode three of the 1965 serial The Crusade[7] — a story consciously written in Shakespearean style.

Historically, a reference to Love's Labour's Won (in Francis Meres's Palladis Tamia, Wits Treasury, 1598) predates the construction of the Globe Theatre (1599).

Shakespeare flirts with Martha multiple times during the episode, and ultimately composes Sonnet 18 for her, calling her his "Dark Lady".

Examples of this include the Doctor telling Shakespeare that "all the world's a stage" (from As You Like It) and "the play's the thing" (from Hamlet), as well as the name Sycorax from The Tempest.

In a different version of the joke, the Doctor exclaims "Once more unto the breach", and Shakespeare initially likes the phrase, before realising it is one of his own from Henry V, which was probably written in early 1599.

At the time in which the episode is set, Shakespeare had yet to write Macbeth or Hamlet, which prominently feature the paranormal, such as witches and ghosts.

These references include some metatheatrical humour, since David Tennant played the villain Barty Crouch, Jr in the film adaptation of Harry Potter and the Goblet of Fire.

She also suggests that stepping on a butterfly might change the future of the human race, an idea that originates in Ray Bradbury's 1952 short story A Sound of Thunder.

[8] In SFX magazine #152, producer Phil Collinson called this episode the "most expensive ever", because of the large amounts of CGI and filming in Warwick, Coventry and London.

Scott Matthewman of The Stage gave "The Shakespeare Code" a mostly positive review, highlighting the guest performances and the theme of the power of words.

[13] Digital Spy's Dek Hogan found the plot "ludicrous" but praised the production values and special effects.