I remember reading that "J&H" was inspired by the true case of the Edinburgh sociopath Deacon Brodie, a pillar of the Calvinist establishment by day and a cat burglar by night.
Regards, Tom (Rymour)
Dear Tom,
Yes, you remember correctly. RLS wrote a play (1880) about Brodie several years before he produced J&H.