1. 识别问题

1. 识别问题

我已经复制了示例 ASIS这里来自第 819 页,但出现错误:

来源:

====================================

\documentclass{article}
\usepackage{amsmath,amssymb,tikz-cd}
\usetikzlibrary{graphs}

\begin{document}

\begin{tikzcd}
D\arrow[r,tail,harpoon ,dashed] & B
\end{tikzcd}

\begin{tikzpicture}
\draw (1,0) -- (0,1) -- (-1,0) -- (0,-1) -- cycle;
\end{tikzpicture}

\tikz \graph { a -> {b, c} -> d };

\begin{tikzpicture}
\node {root}
[clockwise from=30,sibling angle=30]
child {node{$30$}}
child {node{$0$}}
child {node{$-30$}}
child {node{$-60$}};
\end{tikzpicture}

\end{document}

====================================

命令行: bibtex.exe "ideje5" 启动文件夹:

C:\Users\hynek0\Desktop\TH0dipl

> This is BibTeX, Version 0.99d (MiKTeX 2.9 64-bit) The top-level
> auxiliary file: ideje5.aux I found no \citation commands---while
> reading file ideje5.aux I found no \bibdata command---while reading
> file ideje5.aux I found no \bibstyle command---while reading file
> ideje5.aux (There were 3 error messages)

命令行: pdflatex.exe --interaction=errorstopmode --synctex=-1 "C:\Users\hynek0\Desktop\TH0dipl\ideje5.tex" 启动文件夹:C:\Users\hynek0\Desktop\TH0dipl

This is pdfTeX, Version 3.14159265-2.6-1.40.15 (MiKTeX 2.9 64-bit)
entering extended mode
(C:/Users/hynek0/Desktop/TH0dipl/ideje5.tex
LaTeX2e <2014/05/01>
Babel <3.9l> and hyphenation patterns for 68 languages loaded.
(D:\ProgramFiles\MikTexExe\tex\latex\base\article.cls
Document Class: article 2014/09/29 v1.4h Standard LaTeX document class
(D:\ProgramFiles\MikTexExe\tex\latex\base\size10.clo))
(D:\ProgramFiles\MikTexExe\tex\latex\amsmath\amsmath.sty
For additional information on amsmath, use the `?' option.
(D:\ProgramFiles\MikTexExe\tex\latex\amsmath\amstext.sty
(D:\ProgramFiles\MikTexExe\tex\latex\amsmath\amsgen.sty))
(D:\ProgramFiles\MikTexExe\tex\latex\amsmath\amsbsy.sty)
(D:\ProgramFiles\MikTexExe\tex\latex\amsmath\amsopn.sty))
(D:\ProgramFiles\MikTexExe\tex\latex\amsfonts\amssymb.sty
(D:\ProgramFiles\MikTexExe\tex\latex\amsfonts\amsfonts.sty))
(D:\ProgramFiles\MikTexExe\tex\latex\tikz-cd\tikz-cd.sty
(D:\ProgramFiles\MikTexExe\tex\latex\pgf\frontendlayer\tikz.sty
(D:\ProgramFiles\MikTexExe\tex\latex\pgf\basiclayer\pgf.sty
(D:\ProgramFiles\MikTexExe\tex\latex\pgf\utilities\pgfrcs.sty
(D:\ProgramFiles\MikTexExe\tex\generic\pgf\utilities\pgfutil-common.tex
(D:\ProgramFiles\MikTexExe\tex\generic\pgf\utilities\pgfutil-common-lists.tex))
(D:\ProgramFiles\MikTexExe\tex\generic\pgf\utilities\pgfutil-latex.def
(D:\ProgramFiles\MikTexExe\tex\latex\ms\everyshi.sty))
(D:\ProgramFiles\MikTexExe\tex\generic\pgf\utilities\pgfrcs.code.tex))
(D:\ProgramFiles\MikTexExe\tex\latex\pgf\basiclayer\pgfcore.sty
(D:\ProgramFiles\MikTexExe\tex\latex\graphics\graphicx.sty
(D:\ProgramFiles\MikTexExe\tex\latex\graphics\keyval.sty)
(D:\ProgramFiles\MikTexExe\tex\latex\graphics\graphics.sty
(D:\ProgramFiles\MikTexExe\tex\latex\graphics\trig.sty)
(D:\ProgramFiles\MikTexExe\tex\latex\00miktex\graphics.cfg)
(D:\ProgramFiles\MikTexExe\tex\latex\pdftex-def\pdftex.def
(D:\ProgramFiles\MikTexExe\tex\generic\oberdiek\infwarerr.sty)
(D:\ProgramFiles\MikTexExe\tex\generic\oberdiek\ltxcmds.sty))))
(D:\ProgramFiles\MikTexExe\tex\latex\pgf\systemlayer\pgfsys.sty
(D:\ProgramFiles\MikTexExe\tex\generic\pgf\systemlayer\pgfsys.code.tex
(D:\ProgramFiles\MikTexExe\tex\generic\pgf\utilities\pgfkeys.code.tex
(D:\ProgramFiles\MikTexExe\tex\generic\pgf\utilities\pgfkeysfiltered.code.tex))
(D:\ProgramFiles\MikTexExe\tex\generic\pgf\systemlayer\pgf.cfg)
(D:\ProgramFiles\MikTexExe\tex\generic\pgf\systemlayer\pgfsys-pdftex.def
(D:\ProgramFiles\MikTexExe\tex\generic\pgf\systemlayer\pgfsys-common-pdf.def)))
 (D:\ProgramFiles\MikTexExe\tex\generic\pgf\systemlayer\pgfsyssoftpath.code.tex
)
(D:\ProgramFiles\MikTexExe\tex\generic\pgf\systemlayer\pgfsysprotocol.code.tex)
) (D:\ProgramFiles\MikTexExe\tex\latex\xcolor\xcolor.sty
(D:\ProgramFiles\MikTexExe\tex\latex\00miktex\color.cfg))
(D:\ProgramFiles\MikTexExe\tex\generic\pgf\basiclayer\pgfcore.code.tex
(D:\ProgramFiles\MikTexExe\tex\generic\pgf\math\pgfmath.code.tex
(D:\ProgramFiles\MikTexExe\tex\generic\pgf\math\pgfmathcalc.code.tex
(D:\ProgramFiles\MikTexExe\tex\generic\pgf\math\pgfmathutil.code.tex)
(D:\ProgramFiles\MikTexExe\tex\generic\pgf\math\pgfmathparser.code.tex)
(D:\ProgramFiles\MikTexExe\tex\generic\pgf\math\pgfmathfunctions.code.tex
(D:\ProgramFiles\MikTexExe\tex\generic\pgf\math\pgfmathfunctions.basic.code.tex
)
(D:\ProgramFiles\MikTexExe\tex\generic\pgf\math\pgfmathfunctions.trigonometric.
code.tex)
(D:\ProgramFiles\MikTexExe\tex\generic\pgf\math\pgfmathfunctions.random.code.te
x)
(D:\ProgramFiles\MikTexExe\tex\generic\pgf\math\pgfmathfunctions.comparison.cod
e.tex)
(D:\ProgramFiles\MikTexExe\tex\generic\pgf\math\pgfmathfunctions.base.code.tex)

(D:\ProgramFiles\MikTexExe\tex\generic\pgf\math\pgfmathfunctions.round.code.tex
)
(D:\ProgramFiles\MikTexExe\tex\generic\pgf\math\pgfmathfunctions.misc.code.tex)

(D:\ProgramFiles\MikTexExe\tex\generic\pgf\math\pgfmathfunctions.integerarithme
tics.code.tex)))
(D:\ProgramFiles\MikTexExe\tex\generic\pgf\math\pgfmathfloat.code.tex))
(D:\ProgramFiles\MikTexExe\tex\generic\pgf\basiclayer\pgfcorepoints.code.tex)
(D:\ProgramFiles\MikTexExe\tex\generic\pgf\basiclayer\pgfcorepathconstruct.code
.tex)
(D:\ProgramFiles\MikTexExe\tex\generic\pgf\basiclayer\pgfcorepathusage.code.tex
) (D:\ProgramFiles\MikTexExe\tex\generic\pgf\basiclayer\pgfcorescopes.code.tex)

(D:\ProgramFiles\MikTexExe\tex\generic\pgf\basiclayer\pgfcoregraphicstate.code.
tex)
(D:\ProgramFiles\MikTexExe\tex\generic\pgf\basiclayer\pgfcoretransformations.co
de.tex)
(D:\ProgramFiles\MikTexExe\tex\generic\pgf\basiclayer\pgfcorequick.code.tex)
(D:\ProgramFiles\MikTexExe\tex\generic\pgf\basiclayer\pgfcoreobjects.code.tex)
(D:\ProgramFiles\MikTexExe\tex\generic\pgf\basiclayer\pgfcorepathprocessing.cod
e.tex)
(D:\ProgramFiles\MikTexExe\tex\generic\pgf\basiclayer\pgfcorearrows.code.tex)
(D:\ProgramFiles\MikTexExe\tex\generic\pgf\basiclayer\pgfcoreshade.code.tex)
(D:\ProgramFiles\MikTexExe\tex\generic\pgf\basiclayer\pgfcoreimage.code.tex
(D:\ProgramFiles\MikTexExe\tex\generic\pgf\basiclayer\pgfcoreexternal.code.tex)
) (D:\ProgramFiles\MikTexExe\tex\generic\pgf\basiclayer\pgfcorelayers.code.tex)

(D:\ProgramFiles\MikTexExe\tex\generic\pgf\basiclayer\pgfcoretransparency.code.
tex)
(D:\ProgramFiles\MikTexExe\tex\generic\pgf\basiclayer\pgfcorepatterns.code.tex)
)) (D:\ProgramFiles\MikTexExe\tex\generic\pgf\modules\pgfmoduleshapes.code.tex)
 (D:\ProgramFiles\MikTexExe\tex\generic\pgf\modules\pgfmoduleplot.code.tex)
(D:\ProgramFiles\MikTexExe\tex\latex\pgf\compatibility\pgfcomp-version-0-65.sty
)
(D:\ProgramFiles\MikTexExe\tex\latex\pgf\compatibility\pgfcomp-version-1-18.sty
)) (D:\ProgramFiles\MikTexExe\tex\latex\pgf\utilities\pgffor.sty
(D:\ProgramFiles\MikTexExe\tex\latex\pgf\utilities\pgfkeys.sty
(D:\ProgramFiles\MikTexExe\tex\generic\pgf\utilities\pgfkeys.code.tex))
(D:\ProgramFiles\MikTexExe\tex\latex\pgf\math\pgfmath.sty
(D:\ProgramFiles\MikTexExe\tex\generic\pgf\math\pgfmath.code.tex))
(D:\ProgramFiles\MikTexExe\tex\generic\pgf\utilities\pgffor.code.tex
(D:\ProgramFiles\MikTexExe\tex\generic\pgf\math\pgfmath.code.tex)))
(D:\ProgramFiles\MikTexExe\tex\generic\pgf\frontendlayer\tikz\tikz.code.tex
(D:\ProgramFiles\MikTexExe\tex\generic\pgf\libraries\pgflibraryplothandlers.cod
e.tex)
(D:\ProgramFiles\MikTexExe\tex\generic\pgf\modules\pgfmodulematrix.code.tex)
(D:\ProgramFiles\MikTexExe\tex\generic\pgf\frontendlayer\tikz\libraries\tikzlib
rarytopaths.code.tex)))
(D:\ProgramFiles\MikTexExe\tex\generic\tikz-cd\tikzlibrarycd.code.tex
(D:\ProgramFiles\MikTexExe\tex\generic\pgf\frontendlayer\tikz\libraries\tikzlib
rarymatrix.code.tex)
(D:\ProgramFiles\MikTexExe\tex\generic\pgf\frontendlayer\tikz\libraries\tikzlib
raryquotes.code.tex)
(D:\ProgramFiles\MikTexExe\tex\generic\pgf\libraries\pgflibraryarrows.meta.code
.tex)))
(D:\ProgramFiles\MikTexExe\tex\generic\pgf\frontendlayer\tikz\libraries\graphs\
tikzlibrarygraphs.code.tex) (ideje5.aux) ABD: EveryShipout initializing macros
(D:\ProgramFiles\MikTexExe\tex\context\base\supp-pdf.mkii
[Loading MPS to PDF converter (version 2006.09.02).]
) (D:\ProgramFiles\MikTexExe\tex\latex\amsfonts\umsa.fd)
(D:\ProgramFiles\MikTexExe\tex\latex\amsfonts\umsb.fd)

! Package pgfkeys Error: I do not know the key '/tikz/clockwise from', to which
 you passed '30', and I am going to ignore it. Perhaps you misspelled it.

See the pgfkeys package documentation for explanation.
Type  H <return>  for immediate help.
 ...                                              

l.19 [clockwise from=30,sibling angle=30]

? 

! Emergency stop.
 ...                                              

l.19 [clockwise from=30,sibling angle=30]

!  ==> Fatal error occurred, no output PDF file produced!
Transcript written on ideje5.log.


Process has been killed ...

答案1

clockwise from在这种情况下,您可以看到您复制的示例来自描述密钥的页面,该密钥是导致错误的密钥。如果您从第 819 页向上滚动,您会很快发现它clockwise from位于手册中讨论trees库功能的部分,因此所有示例都假设\usetikzlibrary{trees}(我认为)。

marmot 在他已删除的回答中建议在手册中搜索clockwise from。他首先在第 707 页找到它,在描述库的部分中mindmap。因为mindmap加载trees库,\usetikzlibrary{mindmap}也会clockwise from提供。

但是,在这里您可以利用手册的一个有用功能:示例和文本中的大多数键名都是指向描述该键的位置的超链接。因此,当您clockwise from在第 707 页找到时,您可以在示例代码中单击它,然后您将发现自己在第 819 页,其中clockwise from描述了它。快速向上滚动将识别该库。

(并非所有此类超链接都是正确的,我认为有些东西没有超链接,但仍然需要牢记。)

答案2

我认为这是一个如何识别和解决此类问题的问题。根据要求取消删除。这个答案描述了A在许多情况下,这种方法是有效的。正如Torjørn T. 给出了很好的回答。,在这种情况下,这种方法实际上会根据需要有效地加载更多的库。

1. 识别问题

您的终端报告

! Package pgfkeys Error: I do not know the key '/tikz/clockwise from', to which
 you passed '30', and I am going to ignore it. Perhaps you misspelled it.

See the pgfkeys package documentation for explanation.
Type  H <return>  for immediate help.
 ...                                              

l.19 [clockwise from=30,sibling angle=30]

因此您知道一定有一些定义的库(或包)clockwise from

2. 识别缺失的库

a. 搜索手册

大多数 PDF 查看器都允许您搜索用空格分隔的字符串,方法是将它们括在"符号中。在previewMac OS 上,第一个结果在第 707 页。如果我随后滚动回该部分的开头,我会发现

 \usetikzlibrary{mindmap}

它是将您的代码转换为可编译文档的要素。

b.谷歌

当我在谷歌上搜索

 site:tex.stackexchange.com "clockwise from"

我被拖到这个帖子。在那里我发现了\usetikzlibrary{mindmap,trees}。正如 Torbjørn 指出的那样,这实际上是一种矫枉过正,因为trees本来就足够了。(顺便说一句,这也是这里的用户经常被要求放弃不需要的软件包的原因之一。否则其他人很难看到发生了什么。具有讽刺意味的是,我最初的回答中有最后两句话,却恰恰落入了我试图避免的陷阱。)

无论哪种情况,人们都会得出这样的结论:mindmap需要该库才能编译你的代码。

\documentclass{article}
\usepackage{amsmath,amssymb,tikz-cd}
\usetikzlibrary{graphs,mindmap}

\begin{document}

\begin{tikzcd}
D\arrow[r,tail,harpoon ,dashed] & B
\end{tikzcd}

\begin{tikzpicture}
\draw (1,0) -- (0,1) -- (-1,0) -- (0,-1) -- cycle;
\end{tikzpicture}

\tikz \graph { a -> {b, c} -> d };

\begin{tikzpicture}
\node {root}
[clockwise from=30,sibling angle=30]
child {node{$30$}}
child {node{$0$}}
child {node{$-30$}}
child {node{$-60$}};
\end{tikzpicture}

\end{document}

在此处输入图片描述

评论

最后,我想说的是,有些情况下该方法并不总是有效。例如,在 pgfmanual v 3.1 的第 560 页的最低示例中,quotes除了 之外,您还需要加载angles。同样,您可以通过使用 Google 找出quotes所需的 。然而,在我看来,如果手册在这方面是自成体系的,即明确告诉您除了本节开头提到的库之外还需要哪些其他库,那就不会有什么坏处了。正如 Ti正在积极开发中,可以想象该手册的未来版本将具有此功能。

相关内容