In this paper we propose a new distance function (rank distance) designed to reflect stylistic similarity between texts. To assess the ability of this distance measure to capture stylistic similarity between texts, we tested it in two different machine learning settings: clustering and binary classification.