[Tex/LaTex] \usepackage{inconsolata} changes \ttfamily to serif/non-monospace font

fontsinconsolataluatexmiktex

I am trying to compile a simple latex document:

\documentclass{report}
\usepackage{inconsolata}
\begin{document}
  \normalfont\ttfamily
  Some text
\end{document}

But my output looks like this:

"Some text" written with the default normal font

Rather than the expected:

"Some text" written the way I'd expect

Removing the \usepackage{inconsolata} gives me the default \ttfamily font but I'd like to be able to use inconsolas.

I am using the MiKTeX distribution on Windows and while compiling, using Lualatex, I get the following output:

This is LuaTeX, Version 1.06.2 (MiKTeX 2.9.6530 64-bit)
 restricted system commands enabled.
(./testing_tt.tex
LaTeX2e <2017-04-15>
(using cache: C:/Users/XYZ/AppData/Local/MiKTeX/2.9/luatex-cache/generic)
luaotfload | main : initialization completed in 0.493 seconds
Babel <3.15> and hyphenation patterns for 1 language(s) loaded.
("C:/Program Files/MiKTeX 2.9/tex/latex/base/report.cls"
Document Class: report 2014/09/29 v1.4h Standard LaTeX document class
("C:/Program Files/MiKTeX 2.9/tex/latex/base/size10.clo"(load luc: C:/Users/XYZ/AppData/Local/MiKTeX/2.9/luatex-cache/generic/fonts/otl/lmroman10-regular.lu
c))) ("C:/Program Files/MiKTeX 2.9/tex/latex/inconsolata/inconsolata.sty"
`inconsolata-zi4' v1.112, 2017/01/04 Text macros for Inconsolata (msharpe)
("C:/Program Files/MiKTeX 2.9/tex/latex/base/textcomp.sty"
("C:/Program Files/MiKTeX 2.9/tex/latex/base/ts1enc.def"))
("C:/Program Files/MiKTeX 2.9/tex/latex/xkeyval/xkeyval.sty"
("C:/Program Files/MiKTeX 2.9/tex/generic/xkeyval/xkeyval.tex"
("C:/Program Files/MiKTeX 2.9/tex/generic/xkeyval/xkvutils.tex"
("C:/Program Files/MiKTeX 2.9/tex/generic/xkeyval/keyval.tex")))))
(./testing_tt.aux) ("C:/Program Files/MiKTeX 2.9/tex/latex/base/ts1cmr.fd")
("C:/Program Files/MiKTeX 2.9/tex/latex/upquote/upquote.sty")

LaTeX Font Warning: Font shape `TU/zi4/m/n' undefined
(Font)              using `TU/lmr/m/n' instead on input line 4.

[1{C:/Users/XYZ/AppData/Local/MiKTeX/2.9/pdftex/config/pdftex.map}]
(./testing_tt.aux)

LaTeX Font Warning: Some font shapes were not available, defaults substituted.

)
 355 words of node memory still in use:
   2 hlist, 1 vlist, 1 rule, 2 glue, 3 attribute, 45 glue_spec, 3 attribute_lis
t, 1 write nodes
   avail lists: 2:15,3:2,4:1,5:21,6:1,7:22,8:1,9:6
<c:/program files/miktex 2.9/fonts/opentype/public/lm/lmroman10-regular.otf>
Output written on testing_tt.pdf (1 page, 3672 bytes).
Transcript written on testing_tt.log.

I realise that I get a warning about a font not being available (presumably inconsolata), what I don't understand is why.

the miktex-makepk.log shows:

2018-01-03 01:29:03,274+0100 INFO  miktex-makepk - starting with command line: miktex-makepk --enable-installer --verbose ot1-zi4r-0 600 600 magstep(0.0)
2018-01-03 01:29:03,276+0100 INFO  makepk - Trying to make PK font ot1-zi4r-0 at 600 DPI...
2018-01-03 01:29:03,286+0100 INFO  makepk - The METFAONT mode is: ljfour
2018-01-03 01:29:03,293+0100 INFO  makepk - Running miktex-makemf.exe...
2018-01-03 01:29:03,296+0100 INFO  makepk - running: miktex-makemf.exe --verbose ot1-zi4r-0
2018-01-03 01:29:03,600+0100 INFO  makepk - Running miktex-ttf2pk.exe...
2018-01-03 01:29:03,604+0100 INFO  makepk - running: miktex-ttf2pk.exe -q -t ot1-zi4r-0
2018-01-03 01:29:03,899+0100 FATAL miktex-makepk - PK font ot1-zi4r-0 could not be created.

I have:

  • Uninstalled and reinstalled the inconsolata package through the MiKTeX packet manager (as admin)
  • Made sure the the inconsolata style files are present (from what I understand this message 'inconsolata-zi4' v1.112, 2017/01/04 Text macros for Inconsolata (msharpe) indicates that it is found as well)
  • Verified the *.pfb font files are present in: C:\Program Files\MiKTeX 2.9\fonts\type1\public\inconsolata

I am not sure where else to look, perhaps someone else knows what might be the issue?

Best Answer

If you use fontspec,

\documentclass{report}
\usepackage{fontspec}
\setmonofont{Inconsolatazi4}

\begin{document}

\ttfamily Some text

\end{document}

enter image description here