Sign up ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

Please see for the start of this discussion.

I am using fancyvrb to create a fancy Verbatim environment. I have


to load the Inconsolata font, then


for the environment itself. I would like it to display in italics, but it appears the inconsolata package doesn't load an italicized version of that font. Is there some other package that does, or some other way I can get it?

share|improve this question
Welcome to TeX.SX! There's no italic version of Inconsolata, I'm afraid. – egreg Jun 4 '14 at 22:44
Reference: Inconsolata in the LaTeX Font Catalogue only shows \normalfont. – Werner Jun 4 '14 at 23:12

2 Answers 2

The font Inconsolata does not have an italic or slanted variant (June 2014).

Some TeX engines can fake a slanted font, based on a font transformation feature of the PDF format (therefore PDF mode only).





The slanted/italic versions are only faked. Also the italics correction is not set.


A SlantFont operator can be used in the .map file.

The following Perl script reads (found via kpsewhich) and modifies the entries:

  • -sl is added to the font (TFM) name,
  • .167 Slantfont is added.

Perl script:

#!/usr/bin/env perl
use strict;

my $outfile = '';
my $infile = `kpsewhich`;
chomp $infile;

open(IN, '<', $infile) or die "!!! Error: Cannot open `': $!";
open(OUT, '>', $outfile) or die "!!! Error: Cannot write `$outfile': $!";

while (<IN>) {
    s/^([^- ]+)-([^- ]+)/$1-$2-sl/ or die "!!! Error: Cannot parse TFM name!\n";
    s/ " / " .167 SlantFont / or die "!!! Error: Cannot insert SlantFont!\n";
    print OUT;


The following example:

  • includes the map file via \pdfmapfile,
  • defines the font shapes (would go into .fd files normally).


\sbox0{\ttfamily x}% load .fd file
\expandafter\ifx\csname zifour@scaled\endcsname\relax
\expandafter\ifx\csname zifour@opt\endcsname\relax
  <-> \zifour@scaled ot1-zi4r-sl-\zifour@opt}{}%
  <-> ssub * zi4/m/sl}{}
  <-> \zifour@scaled ot1-zi4b-sl-\zifour@opt}{}
  <-> ssub * zi4/b/sl}{}
  <-> ssub * zi4/b/sl}{}
  <-> ssub * zi4/b/sl}{}


Finally the TFM files are needed. A poor man's solution is to use the TFM files for the original fonts. The example would need (bash syntax):

cp $(kpsewhich ot1-zi4r-0.tfm) ot1-zi4r-sl-0.tfm
cp $(kpsewhich ot1-zi4b-0.tfm) ot1-zi4b-sl-0.tfm


Again, the slanted and italic variants are only faked. Also the italics correction is missing, but it could be added by editing the .tfm files.

share|improve this answer
While I admire the technical wizardry in this answer (+1), I cannot refrain from disparaging the purpose to which it is turned. ;) – cfr Jun 5 '14 at 1:32
Hmm, looks like fontspec should also slant the bold font with AutoFakeSlant. Bug added. – Will Robertson Jun 5 '14 at 7:01
@cfr It should be noted that it's quite common for font designers to simply slant the glyphs for an italic monospaced font. I'd consider this less of a travesty than, say, slanting a text font. – Will Robertson Jun 5 '14 at 7:03
This one might give even another option to slant a font. But haven't tried it, so it might give problems. – Manuel Jun 5 '14 at 10:18
@Manuel: There are problems with line and page breaks inside the argument. Then the coordinate systems of TeX and the PDF output device get out of sync. Safely it can be used inside \mbox, which forbids line breaks. – Heiko Oberdiek Jun 5 '14 at 10:48

It seems there is no italic version for your font (at least not that I'm aware of), but you can always search for a monospaced font you like in the LaTeX Font Catalogue

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.