Emotions have often been a crucial part of compelling narratives: literaturetells about people with goals, desires, passions, and intentions. In the past,classical literary studies usually scrutinized the affective dimension ofliterature within the framework of hermeneutics. However, with emergence of theresearch field known as Digital Humanities (DH) some studies of emotions inliterary context have taken a computational turn. Given the fact that DH isstill being formed as a science, this direction of research can be renderedrelatively new. At the same time, the research in sentiment analysis started incomputational linguistic almost two decades ago and is nowadays an establishedfield that has dedicated workshops and tracks in the main computationallinguistics conferences. This leads us to the question of what are thecommonalities and discrepancies between sentiment analysis research incomputational linguistics and digital humanities? In this survey, we offer anoverview of the existing body of research on sentiment and emotion analysis asapplied to literature. We precede the main part of the survey with a shortintroduction to natural language processing and machine learning, psychologicalmodels of emotions, and provide an overview of existing approaches to sentimentand emotion analysis in computational linguistics. The papers presented in thissurvey are either coming directly from DH or computational linguistics venuesand are limited to sentiment and emotion analysis as applied to literary text.