1

When using the listings package to display code together with mathdesign, it seems that a bitmap font is used. Here is an example:

\documentclass[12pt]{article}

\usepackage[french]{babel}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}

\usepackage[charter]{mathdesign}
%\usepackage{lmodern}
\usepackage{listings}

\lstset{basicstyle=\ttfamily\footnotesize, frame=single, tabsize=4}

\begin{document}
Some text to describe my function
\lstinputlisting[language=Python]{script.py}
\end{document}

This file procuces an output where "Some text to describe my function" is displayed correctly (in Adobe Reader) while the code is pixelated. If I use the lmodern package instead, the code looks fine. It also works correctly when omitting the ttfamily setting in lstset.

Is it possible to display the code in vector format with my choice of fonts?

JD80121
  • 163

1 Answers1

1

As suggested in a comment, I installed the cm-super package, but it was not enough to solve the problem. It is also necessary to load the lmodern package in the preamble, just before mathdesign:

\usepackage[french]{babel}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}

\usepackage{lmodern}
\usepackage[charter]{mathdesign}

\usepackage{listings}

With this configuration, the pdf output is as expected!

JD80121
  • 163