LaTeX 错误:未找到文件“knitting.sty” - 无法运行编织包

LaTeX 错误:未找到文件“knitting.sty” - 无法运行编织包

我正在使用 LaTeX 排版我设计的针织图案的说明。此外,我还想添加一个针织图表来直观地展示图案。我发现针织CTAN 上的软件包看起来非常接近我想要的。我按照包装文档以便安装它。

正如文档所述,这是我放置文件的地方:

  • /usr/share/texmf/tex/latex/knitting/(包含 knitting.sty 和 uknit.fd)
  • /usr/share/texmf/fonts/afm/knitting/(包含 .afm 文件)
  • /usr/share/texmf/fonts/map/knitting/(包含 knitfont.map)
  • /usr/share/texmf/fonts/source/knitting/(包含 .mf 文件)
  • /usr/share/texmf/fonts/tfm/knitting/(包含.tfm 文件)
  • /usr/share/texmf/fonts/type1/knitting/(包含 .pfb 文件)

然后我尝试编译示例文件 knitexamples.tex,但 pdflatex 告诉我找不到knitting.sty。但是,如果我手动输入 的路径knitting.sty,pdflatex 会继续处理 .tex 文件,我觉得这很奇怪。

! 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

(整个日志文件可以在我的帖子末尾找到。)

然后 pdflatex 抱怨说

No file Uknit.fd. on input line 140.

(我发现这更奇怪,因为该文件名为uknit.fd,而不是Uknit.fd.,但也许这实际上完全没问题,我不知道)。

为了确保 LaTeX 不会在错误的地方查找文件,我还将上述文件夹的副本放入了/usr/share/texmf-texlive/相应的子文件夹中(我通常会在其中存放 .sty 和 .cls 文件,并手动将它们添加到我的 TeX 发行版中,到目前为止,这种方法一直有效)。
但错误仍然相同。

然后我求助于文档中的最后一个建议:将knitting包中的所有文件转储到我尝试编译 knitexamples.tex 的文件夹中。这实际上确实编译了文件而没有任何错误,并生成了所需的 .pdf 文件。

我(也许可以理解)更喜欢不同的解决方案,但我不知道如何做到这一点。

这是显示上述错误的完整日志文件。

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!

答案1

您必须执行两个步骤:

sudo mktexlsr
sudo updmap-sys --enable Map knitfont

为了能够使用 Type1 字体,第二步是必需的;如果没有它,TeX 程序将创建并使用位图版本。

答案2

你做得太多了。安装库存的 TeXLive 2012- 它已经具有编织包。或者阅读文档关于如何安装 TeXLive 中未找到的软件包。但是忘记 Debian 中的 TeXLive 2009 吧。

相关内容