[Ipe-discuss] listings package and ipe

Otfried Cheong ipe at otfried.org
Fri Feb 7 22:42:27 CET 2020


It turns out that

\usepackage{helvet}
\usepackage[T1]{fontenc}
\usepackage{listings}

does not actually cause the listings class to use the Helvetica font.    The reason is that the "helvet" package only sets Helvetica as the "Sans Serif" font (the one used by \textsf{xxx}).

But listings are produced in the standard roman shape, and therefore uses Computer Modern Roman.   The fontenc command switches the encoding from OT1 to T1, and unfortunately, the extended T1 version of Computer Modern Roman is on most systems only available as a bitmapped Type 3 font.  Ipe does not support Type 3 fonts, because Ipe wants to produce scalable vector graphics.

The easiest way to use the listings package and have a sans-serif font would be to put this in your preamble:

\usepackage{listings}
\renewcommand\rmdefault{cmss}

This will use Computer Modern Sans Serif.   If you really want to use Helvetica, this will work:

\usepackage{helvet}
\usepackage[T1]{fontenc}
\usepackage{listings}
\renewcommand\rmdefault{phv}

(I looked in "helvet.sty" to find the name of the font.)

Cheers,
  Otfried



On Fri, Feb 7, 2020, at 05:25, Mandar Mitra via Ipe-discuss wrote:
> Mandar Mitra wrote (Fri, Feb 07, 2020 at 09:06:29AM +0530):
> > I think the following is the offending line that makes the difference:
> > \usepackage[T1]{fontenc}
> > 
> > I know this is not the right list to ask, but if you have a quick explanation for what the above is doing, I'd be most grateful.
> > 
> > I just use it as an incantation that makes fonts on beamer slides show up as expected; without that line (and with \usefonttheme{professionalfonts}), sans fonts are replaced by serif ones.
> 
> Correction (in case this gets archived somewhere): the incantation is 
> only required if \usepackage{helvet} (or similar) is used. This is 
> documented in the psnfss package.
> 
> Sorry for the noise,
> -mandar
> 
> _______________________________________________
> Ipe-discuss mailing list
> Ipe-discuss at lists.science.uu.nl
> https://mailman.science.uu.nl/mailman/listinfo/ipe-discuss
>


More information about the Ipe-discuss mailing list