The Shakespeare Code (TV story)

The Shakespeare Code was the second episode of series 3 of Doctor Who.
It included the first televised appearance of William Shakespeare since a cameo in 1965's The Chase. Writer Gareth Roberts was well known as a fan of Shakespeare; he had included him as a character in A Groatsworth of Wit, a Ninth Doctor comic strip. The Carrionites were also derived from the Bard's work, specifically the witches in Macbeth.
Code was one of the most costly stories ever produced, with large expenditures on costumes and sets. Some of the expense was quickly rationalised by BBC Wales, however. The interior of the witches' house was almost immediately reused as Sarah Jane's attic at 13 Bannerman Road, where its expense was amortised over the five-year run of The Sarah Jane Adventures. (DWMSE 23)
It also introduced the narrative lynchpin of Queen Elizabeth I having a severe distrust towards the Tenth Doctor. The reasoning behind why she disliked him so much wasn't explained until the 50th anniversary special The Day of the Doctor.
== Synopsis ==
As a reward for her help with the Plasmavore, Martha Jones gets a trip in the TARDIS. The Tenth Doctor takes her to 1599 England. After viewing a performance of Shakespeare's latest play, the time travellers are beset by apparent sorcery. Under threat of annihilation from a species from the Dark Times, the TARDIS team have to establish whether there is a connection between a witch they've met and Shakespeare's Love's Labour's Won — a play that was legendarily lost to time.
== Plot ==
In 16th century London, a nymph, Lilith, is serenaded from her balcony by a lute-playing swain, Wiggins. Seeing how much he desires her, Lilith allows him entrance to her home. However, upon entering, he is shocked to find it full of horrifying witching artefacts — not what he would expect a beautiful girl to have in her home. Lilith kisses Wiggins, but on pulling away, he finds her transformed into a hideous, wrinkled old hag. She decides to introduce her suitor to her two "mothers", Mother Doomfinger and Mother Bloodtide. Much to Wiggins' horror, the two mothers cackle and pounce on him, mauling him to death without warning. Lilith cackles evilly and states that at the hour of spoken words, they will be freed and the Earth will perish.
Meanwhile, the TARDIS lands in the same time period sometime later. Martha Jones steps outside and is amazed by the fact they have gone back in time. Martha questions when they are, but the Doctor quickly pulls her back, keeping her from being struck by the contents of a chamber pot. The Doctor tells her it's "before the invention of the toilet", apologising. However, Martha takes the event in stride as she has seen worse things in hospital. She then questions whether it is safe to walk around in the past, citing familiar time travel paradoxes such as the grandfather paradox and the so-called "butterfly effect". She frets over her reception as a black woman in a time when slavery still exists. The Doctor points out that he's not even human and she should just walk around like "[she] own[s] the place", just as he does.
They walk around the town and the Doctor says Elizabethan England is far more like the 21st century than Martha might think. He points out there are things similar to the future: recycling, water cooler moments and people thinking the Earth will burn in flames - aka global warming. The Doctor deduces both their location and the year: near the Globe Theatre in 1599. Among the facts that the Doctor lists are that it's not really a globe, but a tetra-decagon; it's also brand new and recently opened for the plays written by the great writer himself. He offers to take Martha to the theatre, which she happily agrees to. The Doctor tells her that when she gets home, she can tell everyone she's seen Shakespeare. However, Martha gleefully and sarcastically retorts that she would get sectioned.
At the Globe, Love's Labour's Lost is on. Martha tells the Doctor how much she loved the play (it was worth putting up with the horrible smell of the crowd) before pointing out that the male actors are dressed as women. The Doctor jokes, "London never changes". Wanting to see the author himself, Martha starts what the Doctor thinks might be the first crowd chant for Shakespeare. The author himself comes on stage with the crowd cheering; he's quite a bit different from his portraits: he's not bald or wearing a collar. The Doctor goes on about how much he admires Shakespeare, but turns out to be wrong about the consistency of the Bard's genius when he asks the audience to shut their "big fat mouths". Martha tells the disappointed Doctor he shouldn't meet his heroes.
Shakespeare then announces there will soon be a sequel, Love's Labour's Won; it will answer the questions Lost left behind. Watching from above is Lilith, dressed as royalty. When Will is about to announce when the play will be performed, she takes control of his mind with a puppet and he declares that it will be tomorrow night. The Doctor is left bewildered by Will's sudden behaviour. As they leave the theatre, Martha asks why she has never heard of Love's Labour's Won. The Doctor knows of the lost play as it appears in the listing of Shakespeare's works, but the play itself is non-existent. Martha asks if he has an advanced gadget for recording things; they could record the play and sell it back in the 21st century, make a fortune. The Doctor tells her no; Martha agrees that would be taking advantage of time travel the wrong way. He decides to find out more about why the play never published.
At The Elephant, Will and his actors are given beer by Dolly Bailey, the landlady. Also in the room is Lilith, disguised as a maid. The actors ask Will why he announced the play for tomorrow instead of next week as they planned. He promises that he will have the last scene finished by the morning. The Doctor enters and Shakespeare tells him to leave, thinking him a fan who wants an autograph or a portrait done with him. He is in no mood for the Doctor to ask him where he gets his ideas, but upon seeing Martha, he stops dead and then suddenly changes his tune, welcoming the two travellers to his table. Recognising the signs, the actors excuse themselves; to them, it looks like Shakespeare has found a new muse. Shakespeare is confused by Martha's "fitted" clothing and the Doctor explains she's from "Freedonia".
Upon trying to pass himself off as "Sir Doctor of TARDIS" via the psychic paper, the Doctor is shocked to find that Shakespeare sees it as blank. Martha is confused by this as she sees the Doctor's title on the paper. Shakespeare remains adamant about what he sees and the Doctor explains the psychic paper, noting that Shakespeare's immunity to the paper proves that he is an "absolute genius". Shakespeare takes interest in the word "psychic" and wonders who the Doctor is. However, his attention shifts to Martha, whom he tries wooing, describing her as "a queen of Afric" or a "blackamoor lady", which she finds slightly offensive. The Doctor says it's "political correctness gone mad".
At that moment, Lynley, Master of the Revels, barges in, demanding to see Shakespeare's script before he allows the play to proceed. Shakespeare tells him that the play will be given to him tomorrow morning; however, Lynley arrogantly declares that the Master of Revels does not work to an author's schedule. He again demands the play, but Shakespeare insists it's not ready yet. Insulted, Lynley declares that this slight means he will ensure the play will never be performed, even if it's the last thing he does; he will return to his office for a banning order. Martha assumes that this explains why Love's Labour's Won was never shown and is quite disappointed by the lack of mystery.
Lilith, having overheard Lynley, contacts her mothers to warn them; they insist that the play must be performed the next night. She tells them to calm down and chant with her, adding hair she secretly took from Lynley to a doll; it is now a voodoo doll, which Lilith plunges into a bucket of water. The Doctor, Martha and Shakespeare hear a commotion in the street and run out, where Lynley is seen vomiting water as he drowns on dry land. Lilith stabs the doll in the chest, and Lynley collapses, dead.
Martha and the Doctor try helping him, with the Doctor noting that it's like something struck Lynley's heart. Martha attempts CPR but is shocked to find Lynley's lungs full of water. The Doctor calmly announces to the crowd that Lynley has died a natural death, of a sudden imbalance of the humours. He asks for a constable to take Lynley's corpse; Lilith offers to fetch one, walking off with a hidden grin on her face. Confused, Martha asks the Doctor why he told the crowd a lie. The Doctor whispers that they've still got "one foot in the Dark Ages", and any seemingly unnatural answer would lead them to think that it was witchcraft. When Martha asks what actually killed Lynley, the Doctor responds, "witchcraft", confusing her further.
Inside the inn, they wonder about Lynley's murder, but Shakespeare is equally confused by Martha's training as a doctor, wondering what kind of land Freedonia is. Martha defends herself by saying that in Freedonia, women can have any profession they want. The Bard then asks the Doctor how he can have eyes so old for someone young; the Doctor replies he does "a lot of reading". Shakespeare sees it as a trite reply, something he'd do himself; both would rather not go into detail if they can help it. He then notes Martha looks at the Doctor like she's surprised that he even exists.
Dolly informs the Doctor and Martha that she's prepared a room for them. Shakespeare explains he still has to finish writing the end of the play and bids the Doctor goodnight, saying he will solve why the constant performance from him tomorrow. The Doctor then gives Shakespeare his "All the world's a stage" line before retiring for the night.
Martha is less than impressed with the room, complaining she doesn't even have a toothbrush. The Doctor gives her one from one of his pockets, explaining it contains Venusian spearmint. An excited Martha says these oddities remind her of Harry Potter; with a smile, the Doctor tells her "Wait to till you read book seven. Oh, I cried." She then asks if magic really exists, to which he states it doesn't — this looks like magic but isn't. Martha defends herself by stating that she's only just started believing in time travel. The Doctor gives a disgruntled Martha mixed signals by casually sharing the single bed with her only to show no interest, then dismissing the idea that a mere human could be channelling the psychic energy and bemoaning the lack of Rose's insight. He attributes this to Martha being a novice to time travel and ponders taking her back home tomorrow, leading a hurt Martha to blow the candle out in a temper.
Meanwhile, Lilith entrances Shakespeare in his room with a potion and, using a marionette, compels him to write a strange concluding paragraph to Love's Labour's Won. She is discovered by Dolly, who had just finished her work to help "relax" Will. Lilith shows her true face, scaring Dolly with a snarl. Upon hearing another scream ring through the inn, the Doctor and Martha run in to find Dolly's body as Shakespeare wakes; the Doctor notes that Dolly's heart gave out from a powerful fright. Through the window, Martha sees Lilith flying away on a broomstick. When asked by the Doctor what she saw, Martha answers, "A witch".
In the morning the Doctor, Martha and Shakespeare are none the wiser about what has happened. Correctly guessing that Shakespeare is central to the witch's plot, Martha accidentally mentions to Shakespeare he will write about witches. Shakespeare then remembers Peter Streete spoke of witches; he was the architect for the Globe Theatre. This leads the Doctor to investigate the Globe next. There, he wonders why the theatre is tetradecagal, knowing he's heard of something before that involves the number 14, but can't seem to remember it. The Doctor asks Shakespeare why the Globe was designed like this and he explains the architect thought it allowed the sound to carry well. When questioned as to the whereabouts of Peter Streete, Shakespeare says that he was admitted to Bedlam, which the Doctor decides is their next stop. Shakespeare follows after him after giving his actors the final draft of his play. He tells them the Queen may come, before muttering "As if. She never does."
The actors rehearse, with the lead actor reading what he thinks is gibberish; he guesses Will was dozing off as he wrote it. This alerts the witches, who say it's too soon for their spell. However, Lilith assures them it's just a preview of what's to come that night. They all cackle in glee as a spirit appears to the actors before they can finish reading the spell. It fades away into cinders without a word, making the duo swear to keep it a secret for fear of getting committed to Bedlam.
Once at Bedlam, Martha and the Doctor are disgusted to learn that the patients are whipped to entertain the gentry but Shakespeare defends its purpose, saying that fear of the place helped "set him right". The Doctor notes that Shakespeare fell into depression after his son's death, and the Bard admits he began to question the futility of existence, quoting "To be or not to be", from his future play when explaining what he felt then. The Doctor advises him to write it down, but Shakespeare wonders if the line is a "bit pretentious". The three of them are led into Streete's cell, where the Doctor finds he is suffering from catatonia.
This visit causes Lilith to sense something is amiss; she and her mothers look into their cauldron and find the Doctor at the mad house with Shakespeare. Lilith notes the Doctor was at the inn with Shakespeare and smells of something new. Fearing that they would be revealed if the Doctor can get Peter to talk, Lilith has Doomfinger transport herself.
In the cell, the Doctor uses his telepathy to help Peter think that all the horrible things that happened to him were nothing more than an illusion, calming the man and making him aware of their presence. On the Doctor's order, Streete reveals that witches spoke to him and made him design the Globe to their design, not his own; once he had served his usefulness, they snapped his wits to keep him quiet about their plans. Once he reveals to the Doctor that the witches were based in All Hallows Street, however, Mother Doomfinger suddenly appears in the cell and kills Peter with a touch to the heart. Martha yells to be let out of the cell but is told by the Doctor that it's pointless, as the entire building is yelling that.
Doomfinger looks around to stop the heart of her next victim, asking who would like to go first. The Doctor steps forward to confront her; Doomfinger explains no-one on Earth has knowledge of them, but the Doctor, who has been listening carefully, begins narrowing down the facts: humanoid females that channel energy into power through words. The Doctor figures out that the 14 walls of the Globe are based on the 14 stars of the Rexel configuration. He then names Doomfinger a Carrionite, which causes her to disappear. The Doctor explains the Carrionites produce their "magic" through an ancient science based on the power of words.
In the witches' home, a wheezing Doomfinger rejoins Bloodtide and Lilith; she tells them that the Doctor knows of their nature - he spoke their true name. Lilith promises to kill the Doctor as the bells ring outside. She instructs her mothers to go the Globe and wait for her; Lilith will be waiting for the Doctor to find their home so she can kill him and put an end to his threat to their plans.
Back at The Elephant Inn, the Doctor explains that the Carrionites vanished at the dawn of the universe; thus it was left to debate whether they were actually real. "I'm going for real," Shakespheare quips. However, it seems some of the Carrionites are back. How they managed to get back is quickly figured out by Martha and the Doctor; when Shakespeare was grieving for his son, he wrote something in a play that allowed them access to Earth. The Carrionites now plan on using Will's brilliant words inside the Globe as an energy converter to bring the rest of their species back; "Love's Labour's Won is a weapon!" The Doctor sends Shakespeare to stop the show whilst he and Martha go to All Hallows Street to thwart the witches.
Per his orders, Shakespeare bursts on to the Globe's stage and tells the crowd that they will be getting a refund, but the play must not be performed. His actors think Will's being a critic about his own work. However, Bloodtide and Doomfinger are there waiting, using their voodoo doll to knock Will out by tapping its head. The actors, assuming Will is drunk, carry him backstage and apologise to the crowd, resuming the play. Amused, Bloodtide tells her sister that no-one that can stop them now; humanity will doom itself.
The Doctor and Martha reach All Hallows Street, with Martha questioning how this could cause a problem, as she's living proof that the world didn't end this year. Annoyed, the Doctor tells her that it's like Back to the Future, where if the past is significantly changed, the entire present day will be rewritten into something entirely different; now fearful, Martha wonders if she's going to start fading away, which the Doctor confirms if they don't stop the witches. The Doctor wonders which house they need to go to before a nearby door creaks open; "Make that witch house."
They confront Lilith, who is expecting them inside. She confirms the Doctor's suspicions: the three Carrionites hope to gain entry for the rest of their species, eliminate the humans, begin a new empire on Earth and spread out from there. Martha, re-enacting the Doctor's actions at Bedlam, tries to neutralise her by speaking the name Carrionite, but Lilith mocks her, since naming only works once. To prove her point she names Martha Jones, rendering her unconscious but unable to harm her more, as she must be out of her own time. Lilith tries to do the same to the Doctor, but fails, as her psychic power is unable to uncover his real name. She senses a name that could hurt him and tries to weaken him by naming "Rose", but he assures her that that name keeps him fighting and demands to know how the Carrionites came to be on Earth.
Lilith explains the Eternals found the correct word to banish the Carrionites into darkness, but the three were able to escape using the power of Shakespeare's grief over his son — the grief of a genius — and intend to free the others. She approaches seductively, which the Doctor says definitely won't work on him, and then quickly cuts a lock of his hair. Taking flight through the window, Lilith attaches the hair to a doll — which the Doctor says is basically a DNA replication module — and stabs it in the heart, making the Doctor collapse. Believing him to be dead, Lilith flies to the Globe, leaving him and Martha behind. Martha awakens, thinking the Doctor is dead as well, but finds he's still alive — two hearts. With her help, the Doctor manages to re-start his other heart and they proceed to the Globe together to stop the Carrionites.
However, at the Globe, the actors have reached the end of the play. Doomfinger and Bloodtide are joined by Lilith, who tells them of her supposed success. The lead actor recites the final incantation, and a vortex appears in the middle of the Globe. Much to the horror of the audience, Carrionites emerge and swarm the skies outside; laughing wickedly at their terror, Lilith locks the audience in. The Doctor and Martha arrive to find Shakespeare regaining consciousness and rubbing his head in pain. After making a joke about his eventual balding, the Doctor goes on stage to try undoing the damage but finds only Shakespeare can.
Joining the Doctor, Shakespeare is told to improvise a verse to get rid of the Carrionites, as he is the most brilliant wordsmith. The Carrionites in the theatre wither in fear of his words, but William gets stuck on the last one, unable to think of a rhyme. Martha comes up with "Expelliarmus" and the Carrionites — together with all the extant copies of Love's Labour's Won — are sucked back through the portal. Martha, Shakespeare and the actors are left to take their bows before the applause of the audience, who think it was all special effects. The Doctor recovers Lilith's orb and finds the three "witches" trapped, screaming in their own crystal ball.
In the morning, Shakespeare flirts once more with Martha as the Doctor returns from the prop room carrying a skull, which he states reminds him of a Sycorax; Shakespeare states he'll take that word from him as well. "I must be on 10% now," the Doctor thinks. The Doctor gives Will a neck brace for his pain, advising him to keep it as it looks good on him. Looking at the crystal ball, he says he has a nice dark attic in the TARDIS for the Carrionites to scream in for all eternity, and that he needs to get Martha back to Freedonia. However, Will reveals to the Doctor that he actually means they will be leaving this era, and shares his deduction that the Doctor is not of the Earth and that Martha is from the future.
Shakespeare claims that he and the Doctor aren't so different; both are men of great intellect. He ponders rewriting the play but is told not to as it would risk releasing the Carrionites, as they could manipulate him into rewriting the spell. Accepting this, Will announces that he will now focus on writing about sons and fathers in honour of his son, Hamnet. Martha is surprised by this, asking Will about the name; obviously, Will is going to base Hamlet on his son. For his "Dark Lady", he produces the sonnet, "Shall I compare thee to a summer's day?" in her honour, but is interrupted when two of his actors burst in. To Will's shock, they tell him the Queen has heard of last night's production and wishes to see the play for herself.
Queen Elizabeth enters, much to the Doctor's amusement. However, it seems they have met before in her past; he is deemed her "sworn enemy". The Queen declares, "Off with his head!" This shocks the Doctor as he has yet to meet her, but comments that he is looking forward to finding out what he will do to offend her. He is then forced to run by Martha to keep himself alive. Together they run through the streets back to the TARDIS as the guards run after them and slam the door just as an arrow embeds itself in the TARDIS' exterior before dematerialisation.
== Cast ==
* The Doctor - David Tennant
* Martha Jones - Freema Agyeman
* Shakespeare - Dean Lennox Kelly
* Lilith - Christina Cole
* Wiggins - Sam Marks
* Doomfinger - Amanda Lawrence
* Bloodtide - Linda Clark
* Dick - Jalaal Hartley
* Kempe - David Westhead
* Dolly Bailey - Andrée Bernard
* Lynley - Chris Larkin
* Jailer - Stephen Marcus
* Peter Streete - Matt King
* Preacher - Robert Demeger
* Queen Elizabeth - Angela Pleasence
== Crew ==
== Worldbuilding ==
=== Individuals ===
* Psychic paper doesn't work on Shakespeare.
=== Species ===
* The Carrionites have several similarities to the Shadeys who were also involved with Shakespeare at one point.
=== Culture ===
* There are numerous Harry Potter mentions and references. David Tennant had previously appeared in Harry Potter and the Goblet of Fire.
* Martha references the Grandfather Paradox.
* The Doctor uses the 1980s film Back to the Future to explain the mechanics of the infinite temporal flux in relation to time travel to Martha.
* Martha thinks she is going to be carted off as a slave because she is black, which references the .
* William describes Martha as a "delicious blackamoor lady", to her shock. He then suggests the alternatives "swarth", "ethiop girl", and "Queen of Afric". The Doctor says that it's "political correctness gone mad".
* In attempting to explain Martha to Shakespeare, the Doctor claims that she comes from Freedonia, a reference to the fictional country in Duck Soup.
=== Places ===
* The Doctor muses that the psychic energy he has seen in Elizabethan England would require a generator the size of Taunton.
== Story notes ==
* This was the second appearance of a famous writer in the revived series, the first being Charles Dickens in The Unquiet Dead.
* This episode's working titles were Theatre of Doom and Love's Labours Won.
* Shakespeare did use the word Sycorax in The Tempest.
* Shakespeare referred to Martha as the "Dark Lady," the mysterious subject (though perhaps allegorical) of many of his sonnets.
* The story plays on the speculation around Shakespeare's Love's Labour's Won, a possible "lost play" or alternate title for an existent play.
* Lilith's name is only said once throughout the whole episode. It is only said in the beginning when the young man tells Lilith that her house is foul. Her name is not even said by Bloodtide, Doomfinger, or Lilith herself.
* Christina Cole revealed on the audio commentary that she took her vampire teeth home with her.
* The scene in which the Doctor and Martha share a room was originally written to have the Doctor casually undress down to his underwear; and still obliviously invite Martha to share the bed. It was rewritten as the producers and David Tennant thought it would be inappropriate.
* The ending featuring Queen Elizabeth was Russell T Davies's idea, who told Gareth Roberts to "make it a bit like the ending of The One Doctor".
* For the villains, Gareth Roberts proposed drawing upon either the three witches of Macbeth or the fairies of A Midsummer Night's Dream. It was felt that the former were more iconic; it also meant that Roberts' characters could be inferred as inspiring their counterparts in Macbeth, which was probably written around 1606. A Midsummer Night's Dream, on the other hand, was an earlier play, predating the construction of the Globe. 
* In response to a flirtatious remark from Shakespeare towards him, the Doctor says, "57 academics just punched the air." Shakespeare's Sonnet 57 is one of those believed to be written to a man, and contains lines referring to time, "I have no precious time at all to spend,/ Nor services to do, till you require./ Nor dare I chide the world-without-end hour/ Whilst I, my sovereign, watch the clock for you."
* The Doctor previously claimed to have met Shakespeare. However his behaviour upon meeting Shakespeare in this episode suggests he's never met the man before. Gareth Roberts indicated that lines were written to reference the City of Death meeting, but were cut so as not to confuse new viewers.
* The Doctor finds Shakespeare backstage, rubbing the top of his head where he had hit it when he fell on stage. The Doctor tells him to stop rubbing it or he'll go bald. Most images portraying Shakespeare show him to be a man who is balding on the top of his head.
* This is one of few occasions where the Doctor didn't appear to use the sonic screwdriver in the episode.
* David Tennant would later star in the Royal Shakespeare Company's production of Hamlet at the Globe Theatre.
* Lilith was the name of a storm demon in Mesopotamian mythology; she was also mentioned in Judeo-Christian tradition, including in the Apocrypha of the Bible, where she was said to be Adam's first wife, preceding Eve.
* Martha was originally going to audition for the Lord Chamberlain's Men, in a scene that was written as a send-up of The X Factor.
* Shakespeare's teenaged daughter, Susanna, was a character at one point, disguised as a boy amongst the Globe players. 
* Peter Streete's demise was envisaged as a more complex affair, with the architect being sucked down into his bed. 
* Until a late stage, Bloodtide and Doomfinger were Lilith's sisters, rather than her mothers.
* Bloodtide was named after a song on Marc Almond's 1986 album Violent Silence.
* Peter Streete did indeed design and build the Globe Theatre although, in reality, he would not die for another decade. 
* Two invented figures were named in honour of fans. The amorous Wiggins referred to Shakespearean scholar Martin Wiggins, who was also a regular contributor to the DVD releases of the classic series. Dolly Bailey, meanwhile, was a nod to David Bailey, writer of various short stories, as well as Bernice Summerfield.
* For Shakespeare's infatuation with Martha, Gareth Roberts was drawing upon the belief of some researchers that the unnamed “dark lady” to whom Shakespeare wrote twenty-six sonnets was a woman of African descent. 
* The invented text for Love's Labour's Won included a line from The Crusade; fan commentators had often likened David Whitaker's dialogue to the works of Shakespeare.
* Carrionites was originally spelt “Karyonites”. Gareth Roberts adapted a term used in Zamper.
* This episode formed the first recording block of season three, along with Smith and Jones.
* It quickly became apparent that the scale of the script exceeded the other recent historical adventures, each of which had been confined to a small setting with a limited cast. It was agreed that there was no suitable venue in Wales to stage the action, so the production team instead approached the management of the new Shakespeare's Globe Theatre. This became the first television drama to be granted permission to film at the new Globe, although recording would be limited to nighttime hours in order to avoid interference with the regularly-scheduled performances. The script was duly revised to reflect this, introducing an element of anachronism into the narrative which was felt to be a reasonable exchange for the heightened atmosphere which would result.
* There was originally an elaborate swordfight between the Doctor and Lilith, which had earlier been conceived as taking place on the building's roof, culminating in his fall to the street below. However, recording was brought to a halt when the stuntperson playing Lilith inadvertently injured the eye of David Tennant's stunt double. Russell T Davies hastily rewrote the scene so that the duel was no longer necessary.
* When it appeared that contractual difficulties would scupper the planned filming at the Globe Theatre, the production team contemplated overhauling the script to relocate the action to the countryside. Fortunately the issues were resolved before filming started.
* Some consideration was given to the Doctor obliviously undressing down to his underclothes as he and Martha prepared to lay in bed together.
* The insert shot of Shakespeare writing Love's Labours Won had to be remounted, as the footage was deemed unsatisfactory.
* After all events Shakespeare tells Martha "Shall I compare thee to a summer’s day?" which is start of Sonet 18, one of the most famous Shakespeare's sonets.
* The Doctor says "Rage, rage against the dying of the light." telling Shakespeare "It belongs to someone else" afterwards referencing to Do not go gentle into that good night (1951) by Dilan Thomas 
=== Ratings ===
* 7.23 million viewers - BARB final ratingsDoctor Who - consolidated ratings
* 6.8 million viewers - Overnight ratings
* 1.039 million viewers - BBC3 Repeat ratings
=== Filming locations ===
* Ford's Hospital, Greyfriar's Lane, Coventry
* Lord Leycester Hospital, Warwick
* Newport Indoor Market (Basement), Newport
* Chelesmore Manor House, Greyfriar's Lane, Coventry
* Shakespeare's Globe, Southwark, London
* BBC Studios, Upper Boat, Tonteg Road, Treforest Industrial Estate, Pontypridd
* Stageworks, Unit H1, Colchester Industrial Estate, Colchester Avenue, Penylan, Cardiff
* Black Horse Ltd, St William House, Tresillian Terrace, Cardiff
=== Production errors ===
* When Lilith is attempting to charm the Doctor, she strokes his face. In the first shot, she's stroking his hair behind his ear, in the next shot, she is touching his sideburn, and her fingers shift to behind his ear again in the following shot.
* When the crowd is chanting "author!" a shot of one of the wooden beams has 'Bay J' printed on it. This is part of the reconstructed Globe and wouldn't have been present in the original.
== Continuity ==
* The Doctor previously encountered the Carrionites in his fourth (PROSE: Toil and Trouble) and sixth incarnations. (AUDIO: The Carrionite Curse) The Carrionites in the latter story have knowledge of the events of this episode.
* The Doctor and Martha visit the Globe Theatre, as the First Doctor's companions Ian Chesterton and Barbara Wright had intended to do in November 1605 before becoming embroiled in the Gunpowder Plot. (PROSE: The Plotters)
* Shakespeare has previously appeared as a young boy in AUDIO: The Time of the Daleks, on the Space Time Visualiser in TV: The Chase, as an older man, who hitches a ride aboard the TARDIS in AUDIO: The Kingmaker, and in PROSE: The Empire of Glass.
* The Doctor reads minds in TV: The Girl in the Fireplace and TV: Fear Her. The First Doctor earlier remarked upon his capability to read Ian Chesterton's mind. (TV: The Sensorites)
* The Doctor previously felt emotional at the mention of his lost companion, Rose. (TV: The Runaway Bride)
* The arrow that is shot into the TARDIS mimics similar occurrences in TV: An Unearthly Child and TV: Silver Nemesis. It is still there in the next episode and is removed by the Doctor after materialising. (TV: Gridlock)
* Queen Elizabeth's anger at the Doctor is given a possible cause in TV: The End of Time, when the Doctor indicates that he had married her and then left unexpectedly. This marriage takes place during TV: The Day of the Doctor, where he made a marriage proposal to the real Elizabeth I by accident after thinking he was speaking to a Zygon impersonator, then jilted her by fleeing to his TARDIS when there was no other way out of the lifelong commitment.
* The Doctor also mentioned meeting Queen Elizabeth in TV: The Mind of Evil.
* The Doctor claims that Martha is a citizen of the nation of "Freedonia". Freedonia was the name of a planet in PROSE: Warmonger.
* The Doctor uses the title of "Sir Doctor of TARDIS". (TV: Tooth and Claw)
* The Doctor's elder brother, Irving Braxiatel, would later obtain a copy of Love's Labour's Won for the Braxiatel Collection. (PROSE: The Empire of Glass)
* Lilith mentions the Eternals. (TV: Enlightenment)
* The Doctor mentions the Sycorax. (TV: The Christmas Invasion)
* The Doctor's psychic paper fails to work again because the person on the receiving end is able to outsmart the trick it plays on the mind. (TV: Army of Ghosts)
* The crystal ball imprisoning the Carrionites reappears when the Doctor is fishing through a TARDIS chest for an Agatha Christie novel. (TV: The Unicorn and the Wasp)
* After arriving in 1599, The Doctor tells Martha to "walk like you own the place." The Seventh Doctor told Ace something similar while they were investigating at Windsor Castle. (TV: Silver Nemesis)
* In TV: Planet of Evil, the Fourth Doctor mentions he once met Shakespeare, and went on to claim he was a terrible actor. Sarah Jane suggests that perhaps this is why he took up writing.
* The subject of the Doctor's old eyes returns when Clara Oswald later notices that the War Doctor has younger eyes than the Tenth Doctor and the Eleventh Doctor because they contain more hope. (TV: The Day of the Doctor)
* One of the Doctor's hearts stops temporarily. Both hearts stopped in the previous episode, TV: Smith and Jones, from blood loss, but were restarted when Martha applied pressure to them.
* Lilith drowns Lynley manipulating a voodoo doll. In the Torchwood episode Small Worlds, fairies drown a woman by manipulating the elements.
== Home video releases ==
File:The Complete David Tennant Years Region 1 US DVD cover.jpg|The Complete David Tennant Years DVDRegion 1 US cover
File:Series-3-boxset.jpg|The Complete Series Three DVD box-set
File:Bbcdvd-s3-v1.jpg|thumb|Series 3 Volume 1 DVD Cover
File:Bbcdvd-series1234.jpg|thumb|Doctor Who: The Complete Series One to Four DVD box-set
File:Bbcdvd-series1234567.jpg|thumb|Doctor Who: The Complete Series One to Seven DVD box-set
* This story was released with Smith and Jones and Gridlock on the Series 3 Volume 1 DVD.
* It is also included in the Series 3 DVD box set.
== External links ==
* Official BBC Website - Episode Guide: The Shakespeare Code
* 
* 
* 
== Footnotes ==
Category:Doctor Who (2005) television stories
Category:Stories set in Southwark
Category:Stories set in 1599
Category:2007 television stories
Category:Series 3 (Doctor Who) stories
fr:The Shakespeare Code (TV)
it:The Shakespeare Code (TV)