# Using Package “lmodern” creates strange characters in text

I have used the package \usepackage{lmodern} to increase the font size of the my chapter title. Due to that, I am getting strange characters in my text.

Before using the package the text looked like this:

Now it looks like this:

My code in part is as under:

\documentclass[a4paper,12pt,oneside]{report}
\usepackage[left=3.81cm,right=2.54cm,top=2.54cm,bottom=2.54cm]{geometry}

\usepackage{sectsty,lmodern}

\chapternumberfont{\fontsize{36pt}{32pt}\selectfont}

\chaptertitlefont{\fontsize{36pt}{35pt}\selectfont}


Any ideas how to rectify that?

• How are you typesetting the document? What file encoding are you using? Are you using a 2018 TeX Distribution? – Herb Schulz Sep 1 '18 at 20:36
• Sorry, I am new to this. can you plz tell me where to fetch this information. I am using overleaf btw. – Tasie Sep 1 '18 at 20:40
• that is unrelated to the font choice, it looks like you have saved the file in UTF-8 encoding but declared to TeX that it is in latin1 – David Carlisle Sep 1 '18 at 21:13

You have an endash – at this places and your document is utf8 encoded. For pdflatex this means it sees the bytes "E2 "80 "93 You are using an older latex which doesn't declare utf8 by default. As your document is neither using inputenc nor fontenc the default font cmr, which has empty slots at this positions simply shows nothing. lmodern has glyphs there and shows them.

\documentclass[a4paper, english]{article}