我在 Windows 下使用 MikTeX。pdflatex
需要执行一次才能绘制图形。
LateX 代码:
\documentclass{standalone}
\usepackage[pdf]{graphviz}
\ShellEscape{where dot > test.log}
\begin{document}
\digraph{abc}{
a -> b;
}
\end{document}
命令:
pdflatex -shell-escape main.tex
结果:
我奇怪地注意到点文件已正确生成......
Graphviz 文档说了一些关于 ps 格式的事情,我不太明白。无论如何,我认为 windows 没有内置工具可以即时将 ps 转换为 pdf。
dot -Tpdf -o abc.pdf abc.dot
当我尝试生成 pdf 图表时,我的 graphviz 安装似乎工作正常。
编辑
日志文件,(编辑2:真实的)(出于保密目的进行编辑):
This is pdfTeX, Version 3.141592653-2.6-1.40.23 (MiKTeX 21.10) (preloaded format=pdflatex 2022.1.17) 14 FEB 2022 18:04
entering extended mode
**./main.tex
(main.tex
LaTeX2e <2021-06-01> patch level 1
L3 programming layer <2021-08-27>
(C:\Users\***edit hide***\AppData\Local\Programs\MiKTeX\tex/latex/standalone\standalone
.cls
Document Class: standalone 2018/03/26 v1.3a Class to compile TeX sub-files stan
dalone
(C:\Users\***edit hide***\AppData\Local\Programs\MiKTeX\tex/latex/tools\shellesc.sty
Package: shellesc 2019/11/08 v1.0c unified shell escape interface for LaTeX
Package shellesc Info: Unrestricted shell escape enabled on input line 75.
)
(C:\Users\***edit hide***\AppData\Local\Programs\MiKTeX\tex/generic/iftex\ifluatex.sty
Package: ifluatex 2019/10/25 v1.5 ifluatex legacy package. Use iftex instead.
(C:\Users\***edit hide***\AppData\Local\Programs\MiKTeX\tex/generic/iftex\iftex.sty
Package: iftex 2020/03/06 v1.0d TeX engine tests
))
(C:\Users\***edit hide***\AppData\Local\Programs\MiKTeX\tex/latex/xkeyval\xkeyval.sty
Package: xkeyval 2020/11/20 v2.8 package option processing (HA)
(C:\Users\***edit hide***\AppData\Local\Programs\MiKTeX\tex/generic/xkeyval\xkeyval.tex
(C:\Users\***edit hide***\AppData\Local\Programs\MiKTeX\tex/generic/xkeyval\xkvutils.te
x
\XKV@toks=\toks16
\XKV@tempa@toks=\toks17
(C:\Users\***edit hide***\AppData\Local\Programs\MiKTeX\tex/generic/xkeyval\keyval.tex)
)
\XKV@depth=\count182
File: xkeyval.tex 2014/12/03 v2.7a key=value parser (HA)
))
\sa@internal=\count183
\c@sapage=\count184
(C:\Users\***edit hide***\AppData\Local\Programs\MiKTeX\tex/latex/standalone\standalone
.cfg
File: standalone.cfg 2018/03/26 v1.3a Default configuration file for 'standalon
e' class
)
(C:\Users\***edit hide***\AppData\Local\Programs\MiKTeX\tex/latex/base\article.cls
Document Class: article 2021/02/12 v1.4n Standard LaTeX document class
(C:\Users\***edit hide***\AppData\Local\Programs\MiKTeX\tex/latex/base\size10.clo
File: size10.clo 2021/02/12 v1.4n Standard LaTeX file (size option)
)
\c@part=\count185
\c@section=\count186
\c@subsection=\count187
\c@subsubsection=\count188
\c@paragraph=\count189
\c@subparagraph=\count190
\c@figure=\count191
\c@table=\count192
\abovecaptionskip=\skip47
\belowcaptionskip=\skip48
\bibindent=\dimen138
)
\sa@box=\box50
)
(C:\Users\***edit hide***\AppData\Local\Programs\MiKTeX\tex/latex/graphviz\graphviz.sty
Package: graphviz 2013/08/15 v0.94 .dtx graphviz file
(C:\Users\***edit hide***\AppData\Local\Programs\MiKTeX\tex/latex/graphics\graphicx.sty
Package: graphicx 2020/12/05 v1.2c Enhanced LaTeX Graphics (DPC,SPQR)
(C:\Users\***edit hide***\AppData\Local\Programs\MiKTeX\tex/latex/graphics\graphics.sty
Package: graphics 2021/03/04 v1.4d Standard LaTeX Graphics (DPC,SPQR)
(C:\Users\***edit hide***\AppData\Local\Programs\MiKTeX\tex/latex/graphics\trig.sty
Package: trig 2016/01/03 v1.10 sin cos tan (DPC)
)
(C:\Users\***edit hide***\AppData\Local\Programs\MiKTeX\tex/latex/graphics-cfg\graphics
.cfg
File: graphics.cfg 2016/06/04 v1.11 sample graphics configuration
)
Package graphics Info: Driver file: pdftex.def on input line 107.
(C:\Users\***edit hide***\AppData\Local\Programs\MiKTeX\tex/latex/graphics-def\pdftex.d
ef
File: pdftex.def 2020/10/05 v1.2a Graphics/color driver for pdftex
))
\Gin@req@height=\dimen139
\Gin@req@width=\dimen140
))
(C:\Users\***edit hide***\AppData\Local\Programs\MiKTeX\tex/latex/l3backend\l3backend-p
dftex.def
File: l3backend-pdftex.def 2021-08-04 L3 backend support: PDF output (pdfTeX)
\l__color_backend_stack_int=\count193
\l__pdf_internal_box=\box51
)
No file main.aux.
\openout1 = `main.aux'.
LaTeX Font Info: Checking defaults for OML/cmm/m/it on input line 4.
LaTeX Font Info: ... okay on input line 4.
LaTeX Font Info: Checking defaults for OMS/cmsy/m/n on input line 4.
LaTeX Font Info: ... okay on input line 4.
LaTeX Font Info: Checking defaults for OT1/cmr/m/n on input line 4.
LaTeX Font Info: ... okay on input line 4.
LaTeX Font Info: Checking defaults for T1/cmr/m/n on input line 4.
LaTeX Font Info: ... okay on input line 4.
LaTeX Font Info: Checking defaults for TS1/cmr/m/n on input line 4.
LaTeX Font Info: ... okay on input line 4.
LaTeX Font Info: Checking defaults for OMX/cmex/m/n on input line 4.
LaTeX Font Info: ... okay on input line 4.
LaTeX Font Info: Checking defaults for U/cmr/m/n on input line 4.
LaTeX Font Info: ... okay on input line 4.
(C:\Users\***edit hide***\AppData\Local\Programs\MiKTeX\tex/context/base/mkii\supp-pdf.
mkii
[Loading MPS to PDF converter (version 2006.09.02).]
\scratchcounter=\count194
\scratchdimen=\dimen141
\scratchbox=\box52
\nofMPsegments=\count195
\nofMParguments=\count196
\everyMPshowfont=\toks18
\MPscratchCnt=\count197
\MPscratchDim=\dimen142
\MPnumerator=\count198
\makeMPintoPDFobject=\count199
\everyMPtoPDFconversion=\toks19
)
(C:\Users\***edit hide***\AppData\Local\Programs\MiKTeX\tex/latex/epstopdf-pkg\epstopdf
-base.sty
Package: epstopdf-base 2020-01-24 v2.11 Base part for package epstopdf
Package epstopdf-base Info: Redefining graphics rule for `.eps' on input line 4
85.
(C:\Users\***edit hide***\AppData\Local\Programs\MiKTeX\tex/latex/00miktex\epstopdf-sys
.cfg
File: epstopdf-sys.cfg 2021/03/18 v2.0 Configuration of epstopdf for MiKTeX
))
runsystem(dot -Tpdf -o abc.pdf abc.dot)...executed.
LaTeX Font Info: External font `cmex10' loaded for size
(Font) <7> on input line 5.
LaTeX Font Info: External font `cmex10' loaded for size
(Font) <5> on input line 5.
\dotfile=\write3
\openout3 = `abc.dot'.
[1
{C:/Users/***edit hide***/AppData/Local/MiKTeX/pdftex/config/pdftex.map}]
(main.aux) )
Here is how much of TeX's memory you used:
1751 strings out of 478927
28895 string characters out of 2851587
320646 words of memory out of 3000000
19626 multiletter control sequences out of 15000+600000
403598 words of font info for 28 fonts, out of 8000000 for 9000
1141 hyphenation exceptions out of 8191
72i,10n,80p,221b,176s stack positions out of 5000i,500n,10000p,200000b,80000s
<C:/Users/***edit hide***/AppData/Local/Programs/MiKTeX/fonts/type1/public/
amsfonts/cm/cmr10.pfb><C:/Users/***edit hide***/AppData/Local/Programs/MiKTeX/fonts/typ
e1/public/amsfonts/cm/cmr7.pfb><C:/Users/***edit hide***/AppData/Local/Programs/MiKTeX/
fonts/type1/public/amsfonts/cm/cmtt10.pfb>
Output written on main.pdf (1 page, 38929 bytes).
PDF statistics:
21 PDF objects out of 1000 (max. 8388607)
0 named destinations out of 1000 (max. 500000)
1 words of extra memory for PDF output out of 10000 (max. 10000000)
编辑3:
测试日志:C:\Program Files\Graphviz 2.44.1\bin\dot.exe