无法定义宏代码包含 dot2tex 环境的环境

无法定义宏代码包含 dot2tex 环境的环境

我尝试定义一个新环境,其宏代码包含dot2tex来自dot2texi包的环境(查看附加的 MWE)。不幸的是,编译以以下错误结束

Opening dot2tex stream compiled/doc-dot2tex-fig1.dot)
Runaway argument?
! File ended while scanning use of \next.
<inserted text> 
            \par 
<*> doc.tex

I suspect you have forgotten a `}', causing me
to read past where you wanted me to stop.
I'll try to recover; but if the error is serious,
you'd better type `E' or `X' now and fix your file.

! Emergency stop.
<*> doc.tex

*** (job aborted, no legal \end found)

完整的日志文件如下。

此时我甚至不知道去哪里可以解决这个问题。


平均能量损失

\documentclass{article}
\usepackage{dot2texi}
\usepackage{tikz}
\usepackage{environ}
\NewEnviron{map}{%
\begin{dot2tex}[dot]
digraph {
\BODY
}
\end{dot2tex}
}
\usetikzlibrary{shapes,arrows}
\begin{document}
\begin{map}
A -> B -> C -> {C1 C2};
\end{map}
\end{document}

日志档案

This is pdfTeX, Version 3.1415926-2.5-1.40.14 (TeX Live 2013/Debian) (format=pdflatex 2014.4.10)  12 APR 2014 15:49
entering extended mode
 \write18 enabled.
 file:line:error style messages enabled.
 %&-line parsing enabled.
**doc.tex
(./doc.tex
LaTeX2e <2011/06/27>
Babel <3.9h> and hyphenation patterns for 7 languages loaded.
(/usr/share/texlive/texmf-dist/tex/latex/base/article.cls
Document Class: article 2007/10/19 v1.4h Standard LaTeX document class
(/usr/share/texlive/texmf-dist/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
)
(/usr/share/texlive/texmf-dist/tex/latex/dot2texi/dot2texi.sty
Package: dot2texi 2008/05/07 v3.0p1 Run dot2tex from LaTeX

(/usr/share/texlive/texmf-dist/tex/latex/moreverb/moreverb.sty
Package: moreverb 2008/06/03 v2.3a `more' verbatim facilities

(/usr/share/texlive/texmf-dist/tex/latex/tools/verbatim.sty
Package: verbatim 2003/08/22 v1.5q LaTeX2e package for verbatim enhancements
\every@verbatim=\toks14
\verbatim@line=\toks15
\verbatim@in@stream=\read1
)
\tab@position=\count87
\tab@size=\count88
\listing@line=\count89
)
(/usr/share/texlive/texmf-dist/tex/latex/xkeyval/xkeyval.sty
Package: xkeyval 2012/10/14 v2.6b package option processing (HA)

(/usr/share/texlive/texmf-dist/tex/generic/xkeyval/xkeyval.tex
\XKV@toks=\toks16
\XKV@tempa@toks=\toks17
\XKV@depth=\count90
File: xkeyval.tex 2012/10/14 v2.6b key=value parser (HA)

(/usr/share/texlive/texmf-dist/tex/generic/xkeyval/keyval.tex)))
\verbatim@out=\write3
runsystem(echo 'write18-test-2014412949'>"compiled/doc.w18")...executed.

\instream=\read2
runsystem(rm -- "compiled/doc.w18")...executed.

Package dot2texi Info: Automatically converting dot/neato files on input line 1
48.
\c@dtt@fignum=\count91
)
(/usr/share/texlive/texmf-dist/tex/latex/pgf/frontendlayer/tikz.sty
(/usr/share/texlive/texmf-dist/tex/latex/pgf/basiclayer/pgf.sty
(/usr/share/texlive/texmf-dist/tex/latex/pgf/utilities/pgfrcs.sty
(/home/johannes/texmf/tex/generic/pgf/tex/generic/pgf/utilities/pgfutil-common.
tex
\pgfutil@everybye=\toks18
\pgfutil@tempdima=\dimen103
\pgfutil@tempdimb=\dimen104

(/home/johannes/texmf/tex/generic/pgf/tex/generic/pgf/utilities/pgfutil-common-
lists.tex))
(/home/johannes/texmf/tex/generic/pgf/tex/generic/pgf/utilities/pgfutil-latex.d
ef
\pgfutil@abb=\box26
 (/usr/share/texlive/texmf-dist/tex/latex/ms/everyshi.sty
Package: everyshi 2001/05/15 v3.00 EveryShipout Package (MS)
))
(/home/johannes/texmf/tex/generic/pgf/tex/generic/pgf/utilities/pgfrcs.code.tex
Package: pgfrcs 2013/12/20 v3.0.0 (rcs-revision 1.28)
))
Package: pgf 2013/12/18 v3.0.0 (rcs-revision 1.14)
 (/usr/share/texlive/texmf-dist/tex/latex/pgf/basiclayer/pgfcore.sty
(/usr/share/texlive/texmf-dist/tex/latex/graphics/graphicx.sty
Package: graphicx 1999/02/16 v1.0f Enhanced LaTeX Graphics (DPC,SPQR)

(/usr/share/texlive/texmf-dist/tex/latex/graphics/graphics.sty
Package: graphics 2009/02/05 v1.0o Standard LaTeX Graphics (DPC,SPQR)

(/usr/share/texlive/texmf-dist/tex/latex/graphics/trig.sty
Package: trig 1999/03/16 v1.09 sin cos tan (DPC)
)
(/usr/share/texlive/texmf-dist/tex/latex/latexconfig/graphics.cfg
File: graphics.cfg 2010/04/23 v1.9 graphics configuration of TeX Live
)
Package graphics Info: Driver file: pdftex.def on input line 91.

(/usr/share/texlive/texmf-dist/tex/latex/pdftex-def/pdftex.def
File: pdftex.def 2011/05/27 v0.06d Graphics/color for pdfTeX

(/usr/share/texlive/texmf-dist/tex/generic/oberdiek/infwarerr.sty
Package: infwarerr 2010/04/08 v1.3 Providing info/warning/error messages (HO)
)
(/usr/share/texlive/texmf-dist/tex/generic/oberdiek/ltxcmds.sty
Package: ltxcmds 2011/11/09 v1.22 LaTeX kernel commands for general use (HO)
)
\Gread@gobject=\count92
))
\Gin@req@height=\dimen105
\Gin@req@width=\dimen106
)
(/usr/share/texlive/texmf-dist/tex/latex/pgf/systemlayer/pgfsys.sty
(/home/johannes/texmf/tex/generic/pgf/tex/generic/pgf/systemlayer/pgfsys.code.t
ex
Package: pgfsys 2013/11/30 v3.0.0 (rcs-revision 1.47)

(/home/johannes/texmf/tex/generic/pgf/tex/generic/pgf/utilities/pgfkeys.code.te
x
\pgfkeys@pathtoks=\toks19
\pgfkeys@temptoks=\toks20

(/home/johannes/texmf/tex/generic/pgf/tex/generic/pgf/utilities/pgfkeysfiltered
.code.tex
\pgfkeys@tmptoks=\toks21
))
\pgf@x=\dimen107
\pgf@y=\dimen108
\pgf@xa=\dimen109
\pgf@ya=\dimen110
\pgf@xb=\dimen111
\pgf@yb=\dimen112
\pgf@xc=\dimen113
\pgf@yc=\dimen114
\w@pgf@writea=\write4
\r@pgf@reada=\read3
\c@pgf@counta=\count93
\c@pgf@countb=\count94
\c@pgf@countc=\count95
\c@pgf@countd=\count96
\t@pgf@toka=\toks22
\t@pgf@tokb=\toks23
\t@pgf@tokc=\toks24

(/home/johannes/texmf/tex/generic/pgf/tex/generic/pgf/systemlayer/pgf.cfg
File: pgf.cfg 2008/05/14  (rcs-revision 1.7)
)
Driver file for pgf: pgfsys-pdftex.def

(/home/johannes/texmf/tex/generic/pgf/tex/generic/pgf/systemlayer/pgfsys-pdftex
.def
File: pgfsys-pdftex.def 2013/07/18  (rcs-revision 1.33)

(/home/johannes/texmf/tex/generic/pgf/tex/generic/pgf/systemlayer/pgfsys-common
-pdf.def
File: pgfsys-common-pdf.def 2013/10/10  (rcs-revision 1.13)
)))
(/home/johannes/texmf/tex/generic/pgf/tex/generic/pgf/systemlayer/pgfsyssoftpat
h.code.tex
File: pgfsyssoftpath.code.tex 2013/09/09  (rcs-revision 1.9)
\pgfsyssoftpath@smallbuffer@items=\count97
\pgfsyssoftpath@bigbuffer@items=\count98
)
(/home/johannes/texmf/tex/generic/pgf/tex/generic/pgf/systemlayer/pgfsysprotoco
l.code.tex
File: pgfsysprotocol.code.tex 2006/10/16  (rcs-revision 1.4)
)) (/usr/share/texmf/tex/latex/xcolor/xcolor.sty
Package: xcolor 2007/01/21 v2.11 LaTeX color extensions (UK)

(/usr/share/texlive/texmf-dist/tex/latex/latexconfig/color.cfg
File: color.cfg 2007/01/18 v1.5 color configuration of teTeX/TeXLive
)
Package xcolor Info: Driver file: pdftex.def on input line 225.
Package xcolor Info: Model `cmy' substituted by `cmy0' on input line 1337.
Package xcolor Info: Model `hsb' substituted by `rgb' on input line 1341.
Package xcolor Info: Model `RGB' extended on input line 1353.
Package xcolor Info: Model `HTML' substituted by `rgb' on input line 1355.
Package xcolor Info: Model `Hsb' substituted by `hsb' on input line 1356.
Package xcolor Info: Model `tHsb' substituted by `hsb' on input line 1357.
Package xcolor Info: Model `HSB' substituted by `hsb' on input line 1358.
Package xcolor Info: Model `Gray' substituted by `gray' on input line 1359.
Package xcolor Info: Model `wave' substituted by `hsb' on input line 1360.
)
(/home/johannes/texmf/tex/generic/pgf/tex/generic/pgf/basiclayer/pgfcore.code.t
ex
Package: pgfcore 2010/04/11 v3.0.0 (rcs-revision 1.7)
 (/home/johannes/texmf/tex/generic/pgf/tex/generic/pgf/math/pgfmath.code.tex
(/home/johannes/texmf/tex/generic/pgf/tex/generic/pgf/math/pgfmathcalc.code.tex

(/home/johannes/texmf/tex/generic/pgf/tex/generic/pgf/math/pgfmathutil.code.tex
)
(/home/johannes/texmf/tex/generic/pgf/tex/generic/pgf/math/pgfmathparser.code.t
ex
\pgfmath@dimen=\dimen115
\pgfmath@count=\count99
\pgfmath@box=\box27
\pgfmath@toks=\toks25
\pgfmath@stack@operand=\toks26
\pgfmath@stack@operation=\toks27
)
(/home/johannes/texmf/tex/generic/pgf/tex/generic/pgf/math/pgfmathfunctions.cod
e.tex
(/home/johannes/texmf/tex/generic/pgf/tex/generic/pgf/math/pgfmathfunctions.bas
ic.code.tex)
(/home/johannes/texmf/tex/generic/pgf/tex/generic/pgf/math/pgfmathfunctions.tri
gonometric.code.tex)
(/home/johannes/texmf/tex/generic/pgf/tex/generic/pgf/math/pgfmathfunctions.ran
dom.code.tex)
(/home/johannes/texmf/tex/generic/pgf/tex/generic/pgf/math/pgfmathfunctions.com
parison.code.tex)
(/home/johannes/texmf/tex/generic/pgf/tex/generic/pgf/math/pgfmathfunctions.bas
e.code.tex)
(/home/johannes/texmf/tex/generic/pgf/tex/generic/pgf/math/pgfmathfunctions.rou
nd.code.tex)
(/home/johannes/texmf/tex/generic/pgf/tex/generic/pgf/math/pgfmathfunctions.mis
c.code.tex)
(/home/johannes/texmf/tex/generic/pgf/tex/generic/pgf/math/pgfmathfunctions.int
egerarithmetics.code.tex)))
(/home/johannes/texmf/tex/generic/pgf/tex/generic/pgf/math/pgfmathfloat.code.te
x
\c@pgfmathroundto@lastzeros=\count100
))
(/home/johannes/texmf/tex/generic/pgf/tex/generic/pgf/basiclayer/pgfcorepoints.
code.tex
File: pgfcorepoints.code.tex 2013/10/07  (rcs-revision 1.27)
\pgf@picminx=\dimen116
\pgf@picmaxx=\dimen117
\pgf@picminy=\dimen118
\pgf@picmaxy=\dimen119
\pgf@pathminx=\dimen120
\pgf@pathmaxx=\dimen121
\pgf@pathminy=\dimen122
\pgf@pathmaxy=\dimen123
\pgf@xx=\dimen124
\pgf@xy=\dimen125
\pgf@yx=\dimen126
\pgf@yy=\dimen127
\pgf@zx=\dimen128
\pgf@zy=\dimen129
)
(/home/johannes/texmf/tex/generic/pgf/tex/generic/pgf/basiclayer/pgfcorepathcon
struct.code.tex
File: pgfcorepathconstruct.code.tex 2013/10/07  (rcs-revision 1.29)
\pgf@path@lastx=\dimen130
\pgf@path@lasty=\dimen131
)
(/home/johannes/texmf/tex/generic/pgf/tex/generic/pgf/basiclayer/pgfcorepathusa
ge.code.tex
File: pgfcorepathusage.code.tex 2013/12/13  (rcs-revision 1.23)
\pgf@shorten@end@additional=\dimen132
\pgf@shorten@start@additional=\dimen133
)
(/home/johannes/texmf/tex/generic/pgf/tex/generic/pgf/basiclayer/pgfcorescopes.
code.tex
File: pgfcorescopes.code.tex 2013/10/09  (rcs-revision 1.44)
\pgfpic=\box28
\pgf@hbox=\box29
\pgf@layerbox@main=\box30
\pgf@picture@serial@count=\count101
)
(/home/johannes/texmf/tex/generic/pgf/tex/generic/pgf/basiclayer/pgfcoregraphic
state.code.tex
File: pgfcoregraphicstate.code.tex 2013/09/19  (rcs-revision 1.11)
\pgflinewidth=\dimen134
)
(/home/johannes/texmf/tex/generic/pgf/tex/generic/pgf/basiclayer/pgfcoretransfo
rmations.code.tex
File: pgfcoretransformations.code.tex 2013/10/10  (rcs-revision 1.17)
\pgf@pt@x=\dimen135
\pgf@pt@y=\dimen136
\pgf@pt@temp=\dimen137
)
(/home/johannes/texmf/tex/generic/pgf/tex/generic/pgf/basiclayer/pgfcorequick.c
ode.tex
File: pgfcorequick.code.tex 2008/10/09  (rcs-revision 1.3)
)
(/home/johannes/texmf/tex/generic/pgf/tex/generic/pgf/basiclayer/pgfcoreobjects
.code.tex
File: pgfcoreobjects.code.tex 2006/10/11  (rcs-revision 1.2)
)
(/home/johannes/texmf/tex/generic/pgf/tex/generic/pgf/basiclayer/pgfcorepathpro
cessing.code.tex
File: pgfcorepathprocessing.code.tex 2013/09/09  (rcs-revision 1.9)
)
(/home/johannes/texmf/tex/generic/pgf/tex/generic/pgf/basiclayer/pgfcorearrows.
code.tex
File: pgfcorearrows.code.tex 2013/11/07  (rcs-revision 1.40)
\pgfarrowsep=\dimen138
)
(/home/johannes/texmf/tex/generic/pgf/tex/generic/pgf/basiclayer/pgfcoreshade.c
ode.tex
File: pgfcoreshade.code.tex 2013/07/15  (rcs-revision 1.15)
\pgf@max=\dimen139
\pgf@sys@shading@range@num=\count102
)
(/home/johannes/texmf/tex/generic/pgf/tex/generic/pgf/basiclayer/pgfcoreimage.c
ode.tex
File: pgfcoreimage.code.tex 2013/07/15  (rcs-revision 1.18)

(/home/johannes/texmf/tex/generic/pgf/tex/generic/pgf/basiclayer/pgfcoreexterna
l.code.tex
File: pgfcoreexternal.code.tex 2013/07/15  (rcs-revision 1.20)
\pgfexternal@startupbox=\box31
))
(/home/johannes/texmf/tex/generic/pgf/tex/generic/pgf/basiclayer/pgfcorelayers.
code.tex
File: pgfcorelayers.code.tex 2013/07/18  (rcs-revision 1.7)
)
(/home/johannes/texmf/tex/generic/pgf/tex/generic/pgf/basiclayer/pgfcoretranspa
rency.code.tex
File: pgfcoretransparency.code.tex 2013/09/30  (rcs-revision 1.5)
)
(/home/johannes/texmf/tex/generic/pgf/tex/generic/pgf/basiclayer/pgfcorepattern
s.code.tex
File: pgfcorepatterns.code.tex 2013/11/07  (rcs-revision 1.5)
)))
(/home/johannes/texmf/tex/generic/pgf/tex/generic/pgf/modules/pgfmoduleshapes.c
ode.tex
File: pgfmoduleshapes.code.tex 2013/10/31  (rcs-revision 1.34)
\pgfnodeparttextbox=\box32
)
(/home/johannes/texmf/tex/generic/pgf/tex/generic/pgf/modules/pgfmoduleplot.cod
e.tex
File: pgfmoduleplot.code.tex 2013/07/31  (rcs-revision 1.12)
)
(/usr/share/texlive/texmf-dist/tex/latex/pgf/compatibility/pgfcomp-version-0-65
.sty
Package: pgfcomp-version-0-65 2007/07/03 v3.0.0 (rcs-revision 1.7)
\pgf@nodesepstart=\dimen140
\pgf@nodesepend=\dimen141
)
(/usr/share/texlive/texmf-dist/tex/latex/pgf/compatibility/pgfcomp-version-1-18
.sty
Package: pgfcomp-version-1-18 2007/07/23 v3.0.0 (rcs-revision 1.1)
)) (/usr/share/texlive/texmf-dist/tex/latex/pgf/utilities/pgffor.sty
(/usr/share/texlive/texmf-dist/tex/latex/pgf/utilities/pgfkeys.sty
(/home/johannes/texmf/tex/generic/pgf/tex/generic/pgf/utilities/pgfkeys.code.te
x)) (/usr/share/texlive/texmf-dist/tex/latex/pgf/math/pgfmath.sty
(/home/johannes/texmf/tex/generic/pgf/tex/generic/pgf/math/pgfmath.code.tex))
(/home/johannes/texmf/tex/generic/pgf/tex/generic/pgf/utilities/pgffor.code.tex
Package: pgffor 2013/12/13 v3.0.0 (rcs-revision 1.25)
(/home/johannes/texmf/tex/generic/pgf/tex/generic/pgf/math/pgfmath.code.tex)
\pgffor@iter=\dimen142
\pgffor@skip=\dimen143
\pgffor@stack=\toks28
\pgffor@toks=\toks29
))
(/home/johannes/texmf/tex/generic/pgf/tex/generic/pgf/frontendlayer/tikz/tikz.c
ode.tex
Package: tikz 2013/12/13 v3.0.0 (rcs-revision 1.142)

(/home/johannes/texmf/tex/generic/pgf/tex/generic/pgf/libraries/pgflibraryploth
andlers.code.tex
File: pgflibraryplothandlers.code.tex 2013/08/31 v3.0.0 (rcs-revision 1.20)
\pgf@plot@mark@count=\count103
\pgfplotmarksize=\dimen144
)
\tikz@lastx=\dimen145
\tikz@lasty=\dimen146
\tikz@lastxsaved=\dimen147
\tikz@lastysaved=\dimen148
\tikzleveldistance=\dimen149
\tikzsiblingdistance=\dimen150
\tikz@figbox=\box33
\tikz@figbox@bg=\box34
\tikz@tempbox=\box35
\tikz@tempbox@bg=\box36
\tikztreelevel=\count104
\tikznumberofchildren=\count105
\tikznumberofcurrentchild=\count106
\tikz@fig@count=\count107

(/home/johannes/texmf/tex/generic/pgf/tex/generic/pgf/modules/pgfmodulematrix.c
ode.tex
File: pgfmodulematrix.code.tex 2013/09/17  (rcs-revision 1.8)
\pgfmatrixcurrentrow=\count108
\pgfmatrixcurrentcolumn=\count109
\pgf@matrix@numberofcolumns=\count110
)
\tikz@expandcount=\count111

(/home/johannes/texmf/tex/generic/pgf/tex/generic/pgf/frontendlayer/tikz/librar
ies/tikzlibrarytopaths.code.tex
File: tikzlibrarytopaths.code.tex 2008/06/17 v3.0.0 (rcs-revision 1.2)
)))
(/usr/share/texlive/texmf-dist/tex/latex/environ/environ.sty
Package: environ 2013/04/01 v0.3 A new environment syntax

(/usr/share/texlive/texmf-dist/tex/latex/trimspaces/trimspaces.sty
Package: trimspaces 2009/09/17 v1.1 Trim spaces around a token list
)
\@envbody=\toks30
)
(/home/johannes/texmf/tex/generic/pgf/tex/generic/pgf/frontendlayer/tikz/librar
ies/tikzlibraryshapes.code.tex
File: tikzlibraryshapes.code.tex 2008/01/09 v3.0.0 (rcs-revision 1.1)

(/home/johannes/texmf/tex/generic/pgf/tex/generic/pgf/frontendlayer/tikz/librar
ies/tikzlibraryshapes.geometric.code.tex
File: tikzlibraryshapes.geometric.code.tex 2008/01/09 v3.0.0 (rcs-revision 1.1)


(/home/johannes/texmf/tex/generic/pgf/tex/generic/pgf/libraries/shapes/pgflibra
ryshapes.geometric.code.tex
File: pgflibraryshapes.geometric.code.tex 2008/06/26 v3.0.0 (rcs-revision 1.1)
))
(/home/johannes/texmf/tex/generic/pgf/tex/generic/pgf/frontendlayer/tikz/librar
ies/tikzlibraryshapes.misc.code.tex
File: tikzlibraryshapes.misc.code.tex 2008/01/09 v3.0.0 (rcs-revision 1.1)

(/home/johannes/texmf/tex/generic/pgf/tex/generic/pgf/libraries/shapes/pgflibra
ryshapes.misc.code.tex
File: pgflibraryshapes.misc.code.tex 2013/07/18 v3.0.0 (rcs-revision 1.5)
))
(/home/johannes/texmf/tex/generic/pgf/tex/generic/pgf/frontendlayer/tikz/librar
ies/tikzlibraryshapes.symbols.code.tex
File: tikzlibraryshapes.symbols.code.tex 2008/01/09 v3.0.0 (rcs-revision 1.1)

(/home/johannes/texmf/tex/generic/pgf/tex/generic/pgf/libraries/shapes/pgflibra
ryshapes.symbols.code.tex
File: pgflibraryshapes.symbols.code.tex 2013/09/11 v3.0.0 (rcs-revision 1.6)
))
(/home/johannes/texmf/tex/generic/pgf/tex/generic/pgf/frontendlayer/tikz/librar
ies/tikzlibraryshapes.arrows.code.tex
File: tikzlibraryshapes.arrows.code.tex 2008/01/09 v3.0.0 (rcs-revision 1.1)

(/home/johannes/texmf/tex/generic/pgf/tex/generic/pgf/libraries/shapes/pgflibra
ryshapes.arrows.code.tex
File: pgflibraryshapes.arrows.code.tex 2008/06/26 v3.0.0 (rcs-revision 1.1)
))
(/home/johannes/texmf/tex/generic/pgf/tex/generic/pgf/frontendlayer/tikz/librar
ies/tikzlibraryshapes.callouts.code.tex
(/home/johannes/texmf/tex/generic/pgf/tex/generic/pgf/libraries/shapes/pgflibra
ryshapes.callouts.code.tex))
(/home/johannes/texmf/tex/generic/pgf/tex/generic/pgf/frontendlayer/tikz/librar
ies/tikzlibraryshapes.multipart.code.tex
File: tikzlibraryshapes.multipart.code.tex 2008/01/09 v3.0.0 (rcs-revision 1.1)


(/home/johannes/texmf/tex/generic/pgf/tex/generic/pgf/libraries/shapes/pgflibra
ryshapes.multipart.code.tex
File: pgflibraryshapes.multipart.code.tex 2010/01/07 v3.0.0 (rcs-revision 1.2)
\pgfnodepartlowerbox=\box37
\pgfnodeparttwobox=\box38
\pgfnodepartthreebox=\box39
\pgfnodepartfourbox=\box40
\pgfnodeparttwentybox=\box41
\pgfnodepartnineteenbox=\box42
\pgfnodeparteighteenbox=\box43
\pgfnodepartseventeenbox=\box44
\pgfnodepartsixteenbox=\box45
\pgfnodepartfifteenbox=\box46
\pgfnodepartfourteenbox=\box47
\pgfnodepartthirteenbox=\box48
\pgfnodeparttwelvebox=\box49
\pgfnodepartelevenbox=\box50
\pgfnodeparttenbox=\box51
\pgfnodepartninebox=\box52
\pgfnodeparteightbox=\box53
\pgfnodepartsevenbox=\box54
\pgfnodepartsixbox=\box55
\pgfnodepartfivebox=\box56
)))
(/home/johannes/texmf/tex/generic/pgf/tex/generic/pgf/frontendlayer/tikz/librar
ies/tikzlibraryarrows.code.tex
File: tikzlibraryarrows.code.tex 2008/01/09 v3.0.0 (rcs-revision 1.1)

(/home/johannes/texmf/tex/generic/pgf/tex/generic/pgf/libraries/pgflibraryarrow
s.code.tex
File: pgflibraryarrows.code.tex 2013/09/23 v3.0.0 (rcs-revision 1.16)
\arrowsize=\dimen151
)) (./compiled/doc.aux)
\openout1 = `compiled/doc.aux'.

LaTeX Font Info:    Checking defaults for OML/cmm/m/it on input line 13.
LaTeX Font Info:    ... okay on input line 13.
LaTeX Font Info:    Checking defaults for T1/cmr/m/n on input line 13.
LaTeX Font Info:    ... okay on input line 13.
LaTeX Font Info:    Checking defaults for OT1/cmr/m/n on input line 13.
LaTeX Font Info:    ... okay on input line 13.
LaTeX Font Info:    Checking defaults for OMS/cmsy/m/n on input line 13.
LaTeX Font Info:    ... okay on input line 13.
LaTeX Font Info:    Checking defaults for OMX/cmex/m/n on input line 13.
LaTeX Font Info:    ... okay on input line 13.
LaTeX Font Info:    Checking defaults for U/cmr/m/n on input line 13.
LaTeX Font Info:    ... okay on input line 13.
 ABD: EveryShipout initializing macros
(/usr/share/texlive/texmf-dist/tex/context/base/supp-pdf.mkii
[Loading MPS to PDF converter (version 2006.09.02).]
\scratchcounter=\count112
\scratchdimen=\dimen152
\scratchbox=\box57
\nofMPsegments=\count113
\nofMParguments=\count114
\everyMPshowfont=\toks31
\MPscratchCnt=\count115
\MPscratchDim=\dimen153
\MPnumerator=\count116
\makeMPintoPDFobject=\count117
\everyMPtoPDFconversion=\toks32
) (/usr/share/texlive/texmf-dist/tex/generic/oberdiek/pdftexcmds.sty
Package: pdftexcmds 2011/11/29 v0.20 Utility functions of pdfTeX for LuaTeX (HO
)

(/usr/share/texlive/texmf-dist/tex/generic/oberdiek/ifluatex.sty
Package: ifluatex 2010/03/01 v1.3 Provides the ifluatex switch (HO)
Package ifluatex Info: LuaTeX not detected.
)
(/usr/share/texlive/texmf-dist/tex/generic/oberdiek/ifpdf.sty
Package: ifpdf 2011/01/30 v2.3 Provides the ifpdf switch (HO)
Package ifpdf Info: pdfTeX in PDF mode is detected.
)
Package pdftexcmds Info: LuaTeX not detected.
Package pdftexcmds Info: \pdf@primitive is available.
Package pdftexcmds Info: \pdf@ifprimitive is available.
Package pdftexcmds Info: \pdfdraftmode found.
)
(/usr/share/texlive/texmf-dist/tex/latex/oberdiek/epstopdf-base.sty
Package: epstopdf-base 2010/02/09 v2.5 Base part for package epstopdf

(/usr/share/texlive/texmf-dist/tex/latex/oberdiek/grfext.sty
Package: grfext 2010/08/19 v1.1 Manage graphics extensions (HO)

(/usr/share/texlive/texmf-dist/tex/generic/oberdiek/kvdefinekeys.sty
Package: kvdefinekeys 2011/04/07 v1.3 Define keys (HO)
))
(/usr/share/texlive/texmf-dist/tex/latex/oberdiek/kvoptions.sty
Package: kvoptions 2011/06/30 v3.11 Key value format for package options (HO)

(/usr/share/texlive/texmf-dist/tex/generic/oberdiek/kvsetkeys.sty
Package: kvsetkeys 2012/04/25 v1.16 Key value parser (HO)

(/usr/share/texlive/texmf-dist/tex/generic/oberdiek/etexcmds.sty
Package: etexcmds 2011/02/16 v1.5 Avoid name clashes with e-TeX commands (HO)
Package etexcmds Info: Could not find \expanded.
(etexcmds)             That can mean that you are not using pdfTeX 1.50 or
(etexcmds)             that some package has redefined \expanded.
(etexcmds)             In the latter case, load this package earlier.
)))
Package grfext Info: Graphics extension search list:
(grfext)             [.png,.pdf,.jpg,.mps,.jpeg,.jbig2,.jb2,.PNG,.PDF,.JPG,.JPE
G,.JBIG2,.JB2,.eps]
(grfext)             \AppendGraphicsExtensions on input line 452.

(/usr/share/texlive/texmf-dist/tex/latex/latexconfig/epstopdf-sys.cfg
File: epstopdf-sys.cfg 2010/07/13 v1.3 Configuration of (r)epstopdf for TeX Liv
e
))
\openout3 = `compiled/doc-dot2tex-fig1.dot'.


Opening dot2tex stream compiled/doc-dot2tex-fig1.dot)
Runaway argument?
! File ended while scanning use of \next.
<inserted text> 
                \par 
<*> doc.tex

I suspect you have forgotten a `}', causing me
to read past where you wanted me to stop.
I'll try to recover; but if the error is serious,
you'd better type `E' or `X' now and fix your file.

! Emergency stop.
<*> doc.tex

*** (job aborted, no legal \end found)


Here is how much of TeX's memory you used:
 14037 strings out of 494976
 305884 string characters out of 6179137
 355279 words of memory out of 5000000
 17004 multiletter control sequences out of 15000+600000
 3640 words of font info for 14 fonts, out of 8000000 for 9000
 14 hyphenation exceptions out of 8191
 55i,0n,67p,404b,116s stack positions out of 5000i,500n,10000p,200000b,80000s
!  ==> Fatal error occurred, no output PDF file produced!

答案1

我们可以找到一些解决方法。

解决方案A:我们可以在 TeX 运行期间生成一个临时文件,在每次命令调用时关闭它并将其加载回 TeX,请参阅mal-dot2tex-file.tex。我们可以运行所有 LaTeX 引擎。

解决方案B:我们可以使用 LuaTeX 为我们生成该部分 TeX 代码并即时运行,请参阅mal-dot2tex.tex。我们只能在该文件上运行 LuaLaTeX。

如果我们没有dot2tex安装后我们可以手动运行以下命令:

点-Tpdf-O mal-dot2tex-file-dot2tex-fig1.dot
点-Tpdf-O mal-dot2tex-dot2tex-fig1.dot

我附上了两个片段和 PDF 文件的预览。

该文件的内容mal-dot2tex-file.tex如下:

%! *latex mal-dot2tex-file.tex
\documentclass{article}
\pagestyle{empty}
\usepackage{dot2texi}
\usepackage{tikz}
\usetikzlibrary{shapes,arrows}
\def\malfile{malwrite.txt}
\newwrite\malwrite
\long\def\map#1{
  \immediate\openout\malwrite=\malfile
  \immediate\write\malwrite{%
\string\begin{dot2tex}[dot]^^J%
digraph {^^J%
\noexpand#1^^J%
}^^J%
\string\end{dot2tex}^^J%
}
  \immediate\closeout\malwrite
  \input{\malfile}
  }% End of \map...
\begin{document}
\map{A -> B -> C -> {C1 C2};}
\end{document}

该文件的内容mal-dot2tex.tex如下:

%! lualatex mal-dot2tex.tex
\documentclass{article}
\pagestyle{empty}
\usepackage{luatextra}
\usepackage{dot2texi}
\usepackage{tikz}
\long\def\map#1{\directlua{map([[#1]])}}
\usepackage{luacode}
\usetikzlibrary{shapes,arrows}
\begin{luacode*}
function map(text)
malstring=[[
\begin{dot2tex}[dot]
digraph {
]]..text..[[

}
\end{dot2tex}]]
tex.print(malstring)
end
\end{luacode*}
\begin{document}
\map{A -> B -> C -> {C1 C2};}
\end{document}

这是该示例的预览图形可视化

姆韦

相关内容