[Tex/LaTex] LaTeX Error: File `knitting.sty’ not found – cannot get knitting package to run

errorspackagestexlive

I am using LaTeX to typeset instructions for a knitting pattern that I designed.
Additionally, I would like to include a knitting chart to visualize the motif.
I found the knitting package on CTAN which looks very close to what I want to do.
I followed the instructions in the package documentation in order to install it.

Like the documentation said, this is where I put the files:

  • /usr/share/texmf/tex/latex/knitting/ (contains knitting.sty and uknit.fd)
  • /usr/share/texmf/fonts/afm/knitting/ (contains .afm files)
  • /usr/share/texmf/fonts/map/knitting/ (contains knitfont.map)
  • /usr/share/texmf/fonts/source/knitting/ (contains .mf files)
  • /usr/share/texmf/fonts/tfm/knitting/ (contains .tfm files)
  • /usr/share/texmf/fonts/type1/knitting/ (contains .pfb files)

Then I tried to compile the sample file knitexamples.tex, but pdflatex tells me that it cannot find knitting.sty.
However, if I manually enter the path to knitting.sty, pdflatex continues processing the .tex file, which I find very weird.

! LaTeX Error: File `knitting.sty' not found.

Type X to quit or <RETURN> to proceed,
or enter new name. (Default extension: sty)

Enter file name: /usr/share/texmf-texlive/tex/latex/knitting/knitting.sty

(The entire log file can be found at the end of my post.)

pdflatex then complains that

No file Uknit.fd. on input line 140.

(which I find even weirder because the file is called uknit.fd, not Uknit.fd., but maybe this is actually totally okay, I don't know).

To make sure LaTeX isn't looking for the files in the wrong place, I also placed copies of the above-mentioned folders into /usr/share/texmf-texlive/ and respective subfolders (where I usually deposit .sty and .cls files that I manually add to my TeX distribution, which so far has always worked out).
But the errors remain the same.

I then resorted to the last suggestion in the docs: dumping all files of the knitting package into the folder where I try to compile knitexamples.tex.
This actually does compile the file without any errors and produces the desired .pdf file.

I would (perhaps understandably) prefer a different solution, but I am stumped as to how to do that.

This is the complete log file where said errors show.

This is pdfTeX, Version 3.1415926-1.40.10 (TeX Live 2009/Debian) (format=pdflatex 2012.4.27)  6 AUG 2012 12:04
entering extended mode
 %&-line parsing enabled.
**knitexamples.tex
(./knitexamples.tex
LaTeX2e <2009/09/24>
Babel <v3.8l> and hyphenation patterns for english, usenglishmax, dumylang, noh
yphenation, farsi, arabic, croatian, bulgarian, ukrainian, russian, czech, slov
ak, danish, dutch, finnish, french, basque, ngerman, german, german-x-2009-06-1
9, ngerman-x-2009-06-19, ibycus, monogreek, greek, ancientgreek, hungarian, san
skrit, italian, latin, latvian, lithuanian, mongolian2a, mongolian, bokmal, nyn
orsk, romanian, irish, coptic, serbian, turkish, welsh, esperanto, uppersorbian
, estonian, indonesian, interlingua, icelandic, kurmanji, slovenian, polish, po
rtuguese, spanish, galician, catalan, swedish, ukenglish, loaded.
(/usr/share/texmf-texlive/tex/latex/base/article.cls
Document Class: article 2007/10/19 v1.4h Standard LaTeX document class
(/usr/share/texmf-texlive/tex/latex/base/size10.clo
File: size10.clo 2007/10/19 v1.4h Standard LaTeX file (size option)
)
\c@part=\count79
\c@section=\count80
\c@subsection=\count81
\c@subsubsection=\count82
\c@paragraph=\count83
\c@subparagraph=\count84
\c@figure=\count85
\c@table=\count86
\abovecaptionskip=\skip41
\belowcaptionskip=\skip42
\bibindent=\dimen102
)

! LaTeX Error: File `knitting.sty' not found.

Type X to quit or <RETURN> to proceed,
or enter new name. (Default extension: sty)

Enter file name: /usr/share/texmf-texlive/tex/latex/knitting/knitting.sty
(/usr/share/texmf-texlive/tex/latex/knitting/knitting.sty
Package: knitting 2010/08/29

(/usr/share/texmf-texlive/tex/latex/graphics/color.sty
Package: color 2005/11/14 v1.0j Standard LaTeX Color (DPC)

(/etc/texmf/tex/latex/config/color.cfg
File: color.cfg 2007/01/18 v1.5 color configuration of teTeX/TeXLive
)
Package color Info: Driver file: pdftex.def on input line 130.

(/usr/share/texmf-texlive/tex/latex/pdftex-def/pdftex.def
File: pdftex.def 2009/08/25 v0.04m Graphics/color for pdfTeX
\Gread@gobject=\count87
))
\leftgap@knit=\skip43
\bgshift@knit=\skip44
\chartwidth@knit=\skip45
\stitchcountwidth@knit=\skip46
\rnleftwd@knit=\skip47
\rnrightwd@knit=\skip48
\bgbox@knit=\box26
\fgbox@knit=\box27
\ggbox@knit=\box28
\c@rownumber=\count88
\c@tempcount@knit=\count89
\c@rownumberskip=\count90
\c@stitchcountin=\count91
\c@stitchcountinprev=\count92
\c@stitchcountout=\count93
LaTeX Font Info:    Try loading font information for U+knit on input line 140.
LaTeX Font Info:    No file Uknit.fd. on input line 140.


LaTeX Font Warning: Font shape `U/knit/g/n' undefined
(Font)              using `U/cmr/m/n' instead on input line 140.

) (/usr/share/texmf-texlive/tex/latex/tools/calc.sty
Package: calc 2007/08/22 v4.3 Infix arithmetic (KKT,FJ)
\calc@Acount=\count94
\calc@Bcount=\count95
\calc@Adimen=\dimen103
\calc@Bdimen=\dimen104
\calc@Askip=\skip49
\calc@Bskip=\skip50
LaTeX Info: Redefining \setlength on input line 76.
LaTeX Info: Redefining \addtolength on input line 77.
\calc@Ccount=\count96
\calc@Cskip=\skip51
){/var/lib/texmf/fonts/map/pdftex/updmap/pdftex.map}

pdfTeX warning: pdflatex (file knitfont.map): cannot open font map file
No file knitexamples.aux.
\openout1 = `knitexamples.aux'.

LaTeX Font Info:    Checking defaults for OML/cmm/m/it on input line 42.
LaTeX Font Info:    ... okay on input line 42.
LaTeX Font Info:    Checking defaults for T1/cmr/m/n on input line 42.
LaTeX Font Info:    ... okay on input line 42.
LaTeX Font Info:    Checking defaults for OT1/cmr/m/n on input line 42.
LaTeX Font Info:    ... okay on input line 42.
LaTeX Font Info:    Checking defaults for OMS/cmsy/m/n on input line 42.
LaTeX Font Info:    ... okay on input line 42.
LaTeX Font Info:    Checking defaults for OMX/cmex/m/n on input line 42.
LaTeX Font Info:    ... okay on input line 42.
LaTeX Font Info:    Checking defaults for U/cmr/m/n on input line 42.
LaTeX Font Info:    ... okay on input line 42.
(/usr/share/texmf/tex/context/base/supp-pdf.mkii
[Loading MPS to PDF converter (version 2006.09.02).]
\scratchcounter=\count97
\scratchdimen=\dimen105
\scratchbox=\box29
\nofMPsegments=\count98
\nofMParguments=\count99
\everyMPshowfont=\toks14
\MPscratchCnt=\count100
\MPscratchDim=\dimen106
\MPnumerator=\count101
\everyMPtoPDFconversion=\toks15
)
LaTeX Font Info:    External font `cmex10' loaded for size
(Font)              <7> on input line 48.
LaTeX Font Info:    External font `cmex10' loaded for size
(Font)              <5> on input line 48.


LaTeX Font Warning: Font shape `U/knit/g/p' undefined
(Font)              using `U/knit/g/n' instead on input line 48.


LaTeX Font Warning: Font shape `U/knit/g/g' undefined
(Font)              using `U/knit/g/n' instead on input line 48.


Overfull \hbox (3.05557pt too wide) in paragraph at lines 51--60
[] |
 []

[1


]
! Font \U/knit/g/g/10 has only 7 fontdimen parameters.
<recently read> \U/knit/g/n/10 

l.82 }

? 
! Emergency stop.
<recently read> \U/knit/g/n/10 

l.82 }

End of file on the terminal!


Here is how much of TeX's memory you used:
 1022 strings out of 493857
 12999 string characters out of 1153305
 64769 words of memory out of 3000000
 4358 multiletter control sequences out of 15000+50000
 3640 words of font info for 14 fonts, out of 3000000 for 9000
 714 hyphenation exceptions out of 8191
 24i,9n,21p,218b,173s stack positions out of 5000i,500n,10000p,200000b,50000s
!  ==> Fatal error occurred, no output PDF file produced!

Best Answer

You have to perform two steps:

sudo mktexlsr
sudo updmap-sys --enable Map knitfont

The second step is necessary in order to be able to use the Type1 font; without it the TeX programs would create and use the bitmap version.

Related Question