The history of engine sheds at Thornton Junction had its beginnings in the 31 July 1845 Act of Incorporation of the Edinburgh & Northern Railway (E&NR). The Act empowered construction of a double-track line from Burntisland to Perth, with a branch to Cupar; in addition, a later extension to the Act authorised the building of a branch line from Thornton through to Dunfermline – all were fully open by the end of 1849.
Leaving Burntisland, the main E&NR route went via a coal-mining hamlet called Thornton and on to Ladybank, where it divided, one line going east to Cupar, while that to the west headed to Perth. These railways opened in stages, as follows:
Friday, 17 September 1847:
Burntisland to Cupar, 24½ miles (temporary railhead), and Ladybank to Lindores, 4½…