The world's great writers and their adventures in literature. This week, as the Edinburgh Festival begins, follow Sir Walter Scott to 'The Heart of Midlothian'

Sir Walter Scott (1771-1832) was born in Edinburgh on 15 August and it is when he is writing about Scottish history that he is probably at his best. This extract is taken from one of the Waverley Novels, 'The Heart of Midlothian'. Set in Edinburgh, the "heart" in the title refers to the city jail. The historic event at the heart of the story is the Porteous riots, which followed the hanging of a convicted smuggler who won the sympathy of the populace.

Adjacent to the tolbooth or city jail of Edinburgh is one of three churches into which the cathedral of St Giles is now divided, called, from its vicinity, the Tolbooth Church. It was the custom that criminals under sentence of death were brought to this church, with a sufficient guard, to hear and join in public worship on the Sabbath before execution. It was supposed that the hearts of these unfortunate persons, however hardened before against feelings of devotion, could not but be accessible to them upon uniting their thoughts and voices, for the last time, along with their fellow-mortals, in addressing their Creator. And to the rest of the congregation, it was thought it could not but be impressive and affecting, to find their devotions mingling with those, who, sent by the doom of an earthly tribunal to appear where the whole earth is judged, might be considered as beings trembling on the verge of eternity. The practice, however edifying, has been discontinued, in consequence of the incident we are about to detail.

The clergyman, whose duty it was to officiate in the Tolbooth Church, had concluded an affecting discourse, part of which was particularly directed to the unfortunate men, Wilson and Robertson, who were each secured betwixt two soldiers of the city guard. The clergyman had reminded them, that the next congregation they must join would be that of the just, or of the unjust; that the psalms they now heard must be exchanged, in the space of two brief days, for eternal hallelujahs, or eternal lamentations; and that this fearful alternative must depend upon the state to which they might be able to bring their minds before the moment of awful preparation. "Therefore,'' urged the good man, his voice trembling with emotion, "redeem the time, my unhappy brethren, which is yet left; and remember, that, with the grace of Him to whom space and time are but as nothing, salvation may yet be assured.''

The benediction was pronounced and the congregation was dismissed, many lingering to indulge their curiosity with a more fixed look at the two criminals, who now, as well as their guards, rose up, as if to depart. A murmur of compassion was heard to pervade the spectators, when all at once, Wilson, who, as we have already noticed, was a very strong man, seized two of the soldiers, one with each hand, and calling at the same time to his companion, "Run, Geordie, run!'' threw himself on a third, and fastened his teeth on the collar of his coat. Robertson stood for a second as if thunderstruck, and unable to avail himself of the opportunity of escape; but the cry of "Run, run!'' being echoed from many around, he shook off the grasp of the remaining soldier, threw himself over the pew, mixed with the dispersing congregation, gained the door of the church, and was lost to all pursuit.