我用CTEX/WinEdit7.0书写,使用的是网上的代码,如下:
```tex
\documentclass[runningheads]{llncs}
\usepackage{tikz}
\usetikzlibrary{calc,matrix,decorations.markings,decorations.pathreplacing}
\usetikzlibrary{arrows,shapes,chains}
\begin{document}
\begin{tikzpicture}[nodes in empty cells,
nodes={minimum width=0.7cm, minimum height=0.6cm}]
\node(0){0};
\nodedraw,rectangle,node distance=0.7cm,right of=0,minimum height=0.8cm{$V_1$} ;
\noderectangle,draw,right of=n0,node distance=0.7cm,minimum height=0.8cm{};
\noderectangle,draw,right of=n1{1};
\noderectangle,draw, right of=n2,node distance=0.7cm{10};
\noderectangle,draw,right of=n3,node distance=0.7cm{};
\noderectangle,draw, right of=n4{3};
\noderectangle,draw, right of=n5,node distance=0.7cm{4};
\noderectangle,draw,right of=n6,node distance=0.7cm{};
\noderectangle,draw, right of=n7{4};
\noderectangle,draw, right of=n8,node distance=0.7cm{12};
\noderectangle,draw, right of=n9,node distance=0.7cm{$\wedge$};
\draw[-latex] (n1.center) — (n2.west);
\draw[-latex] (n4.center) — (n5.west);
\draw[-latex] (n7.center) — (n8.west);
\node(1)[node distance=0.8cm,below of=0]{1};
\node[draw,rectangle,node distance=0.7cm,right of=1,minimum height=0.8cm](n10){$V_2$} ;
\node[rectangle,draw,right of=n10,node distance=0.7cm,minimum height=0.8cm](n11){};
\node[rectangle,draw,right of=n11](n12){0};
\node[rectangle,draw, right of=n12,node distance=0.7cm](n13){10};
\node[rectangle,draw,right of=n13,node distance=0.7cm](n14){};
\node[rectangle,draw, right of=n14](n15){2};
\node[rectangle,draw, right of=n15,node distance=0.7cm](n16){15};
\node[rectangle,draw,right of=n16,node distance=0.7cm](n17){};
\node[rectangle,draw, right of=n17](n18){3};
\node[rectangle,draw, right of=n18,node distance=0.7cm](n19){8};
\node[rectangle,draw,right of=n19,node distance=0.7cm](n110){};
\node[rectangle,draw, right of=n110](n111){4};
\node[rectangle,draw,right of=n111,node distance=0.7cm](n112){5};
\node[rectangle,draw, right of=n112,node distance=0.7cm](n113){$\wedge$};
\draw[-latex] (n11.center) -- (n12.west);
\draw[-latex] (n14.center) -- (n15.west);
\draw[-latex] (n17.center) -- (n18.west);
\draw[-latex] (n110.center) -- (n111.west);
\node(2)[node distance=0.8cm,below of=1]{2};
\node[draw,rectangle,node distance=0.7cm,right of=2,minimum height=0.8cm](n20){$V_3$} ;
\node[rectangle,draw,right of=n20,node distance=0.7cm,minimum height=0.8cm](n21){};
\node[rectangle,draw,right of=n21](n22){1};
\node[rectangle,draw, right of=n22,node distance=0.7cm](n23){15};
\node[rectangle,draw,right of=n23,node distance=0.7cm](n24){};
\node[rectangle,draw, right of=n24](n25){3};
\node[rectangle,draw, right of=n25,node distance=0.7cm](n26){7};
\node[rectangle,draw,right of=n26,node distance=0.7cm](n27){};
\node[rectangle,draw, right of=n27](n28){4};
\node[rectangle,draw, right of=n28,node distance=0.7cm](n29){30};
\node[rectangle,draw, right of=n29,node distance=0.7cm](n210){$\wedge$};
\draw[-latex] (n21.center) -- (n22.west);
\draw[-latex] (n24.center) -- (n25.west);
\draw[-latex] (n27.center) -- (n28.west);
\node(3)[node distance=0.8cm,below of=2]{3};
\node[draw,rectangle,node distance=0.7cm,right of=3,minimum height=0.8cm](n30){$V_4$} ;
\node[rectangle,draw,right of=n30,node distance=0.7cm,minimum height=0.8cm](n31){};
\node[rectangle,draw,right of=n31](n32){0};
\node[rectangle,draw, right of=n32,node distance=0.7cm](n33){4};
\node[rectangle,draw,right of=n33,node distance=0.7cm](n34){};
\node[rectangle,draw, right of=n34](n35){1};
\node[rectangle,draw, right of=n35,node distance=0.7cm](n36){8};
\node[rectangle,draw,right of=n36,node distance=0.7cm](n37){};
\node[rectangle,draw, right of=n37](n38){2};
\node[rectangle,draw, right of=n38,node distance=0.7cm](n39){7};
\node[rectangle,draw,right of=n39,node distance=0.7cm](n310){};
\node[rectangle,draw, right of=n310](n311){4};
\node[rectangle,draw,right of=n311,node distance=0.7cm](n312){6};
\node[rectangle,draw, right of=n312,node distance=0.7cm](n313){$\wedge$};
\draw[-latex] (n31.center) -- (n32.west);
\draw[-latex] (n34.center) -- (n35.west);
\draw[-latex] (n37.center) -- (n38.west);
\draw[-latex] (n310.center) -- (n311.west);
\node(4)[node distance=0.8cm,below of=3]{4};
\node[draw,rectangle,node distance=0.7cm,right of=4,minimum height=0.8cm](n40){$V_5$} ;
\node[rectangle,draw,right of=n40,node distance=0.7cm,minimum height=0.8cm](n41){};
\node[rectangle,draw,right of=n41](n42){0};
\node[rectangle,draw, right of=n42,node distance=0.7cm](n43){12};
\node[rectangle,draw,right of=n43,node distance=0.7cm](n44){};
\node[rectangle,draw, right of=n44](n45){1};
\node[rectangle,draw, right of=n45,node distance=0.7cm](n46){5};
\node[rectangle,draw,right of=n46,node distance=0.7cm](n47){};
\node[rectangle,draw, right of=n47](n48){2};
\node[rectangle,draw, right of=n48,node distance=0.7cm](n49){30};
\node[rectangle,draw,right of=n49,node distance=0.7cm](n410){};
\node[rectangle,draw, right of=n410](n411){3};
\node[rectangle,draw,right of=n411,node distance=0.7cm](n412){6};
\node[rectangle,draw, right of=n412,node distance=0.7cm](n413){$\wedge$};
\draw[-latex] (n41.center) -- (n42.west);
\draw[-latex] (n44.center) -- (n45.west);
\draw[-latex] (n47.center) -- (n48.west);
\draw[-latex] (n410.center) -- (n411.west);
\end{tikzpicture}
\end{document}
```
效果如下图所示
提问于:
浏览数:
1403
2 回答
0
老版本, 不好重现了. 代码里有些地方看不懂, 我格式调整了下.看看对不对.
看你代码应该是投稿的,推荐图片用代码生成pdf 插图到论文里,后期编译也好,编辑也好方便一点. 需要修改了,可以再改源代码.
作者追问:2019-12-29 07:59
谢谢!我这段代码是从网上下载的,用latex生成有问题,dvi显示如图所示。用pdflatex生成pdf显示正常,能用什么办法解决dvi显示不正常的问题?我用的是CTeX 2.9.2
-
谢谢!我这段代码是从网上下载的,用latex生成有问题,dvi显示如图所示。用pdflatex生成pdf显示正常,能用什么办法解决dvi显示不正常的问题?我用的是CTeX 2.9.2。 – 匿名用户 2019-12-28 08:30 回复
0
建议能提供代码的来源,也许能够得到更多的帮助。
将你的绘图代码更改为:
```tex
\begin{tikzpicture}[nodes in empty cells,
nodes={minimum width=0.7cm, minimum height=0.6cm}]
\node(0){0};
\node[draw,rectangle,node distance=0.7cm,right of=0,minimum height=0.8cm](n0){$V_1$} ;
\node[rectangle,draw,right of=n0,node distance=0.7cm,minimum height=0.8cm](n1){};
\node[rectangle,draw,right of=n1](n2){1};
\node[rectangle,draw, right of=n2,node distance=0.7cm](n3){10};
\node[rectangle,draw,right of=n3,node distance=0.7cm](n4){};
\node[rectangle,draw, right of=n4](n5){3};
\node[rectangle,draw, right of=n5,node distance=0.7cm](n6){4};
\node[rectangle,draw,right of=n6,node distance=0.7cm](n7){};
\node[rectangle,draw, right of=n7](n8){4};
\node[rectangle,draw, right of=n8,node distance=0.7cm](n9){12};
\node[rectangle,draw, right of=n9,node distance=0.7cm](n10){$\wedge$};
\draw[-latex] (n1.center) -- (n2.west);
\draw[-latex] (n4.center) -- (n5.west);
\draw[-latex] (n7.center) -- (n8.west);
\node(1)[node distance=0.8cm,below of=0]{1};
\node[draw,rectangle,node distance=0.7cm,right of=1,minimum height=0.8cm](n10){$V_2$} ;
\node[rectangle,draw,right of=n10,node distance=0.7cm,minimum height=0.8cm](n11){};
\node[rectangle,draw,right of=n11](n12){0};
\node[rectangle,draw, right of=n12,node distance=0.7cm](n13){10};
\node[rectangle,draw,right of=n13,node distance=0.7cm](n14){};
\node[rectangle,draw, right of=n14](n15){2};
\node[rectangle,draw, right of=n15,node distance=0.7cm](n16){15};
\node[rectangle,draw,right of=n16,node distance=0.7cm](n17){};
\node[rectangle,draw, right of=n17](n18){3};
\node[rectangle,draw, right of=n18,node distance=0.7cm](n19){8};
\node[rectangle,draw,right of=n19,node distance=0.7cm](n110){};
\node[rectangle,draw, right of=n110](n111){4};
\node[rectangle,draw,right of=n111,node distance=0.7cm](n112){5};
\node[rectangle,draw, right of=n112,node distance=0.7cm](n113){$\wedge$};
\draw[-latex] (n11.center) -- (n12.west);
\draw[-latex] (n14.center) -- (n15.west);
\draw[-latex] (n17.center) -- (n18.west);
\draw[-latex] (n110.center) -- (n111.west);
\node(2)[node distance=0.8cm,below of=1]{2};
\node[draw,rectangle,node distance=0.7cm,right of=2,minimum height=0.8cm](n20){$V_3$} ;
\node[rectangle,draw,right of=n20,node distance=0.7cm,minimum height=0.8cm](n21){};
\node[rectangle,draw,right of=n21](n22){1};
\node[rectangle,draw, right of=n22,node distance=0.7cm](n23){15};
\node[rectangle,draw,right of=n23,node distance=0.7cm](n24){};
\node[rectangle,draw, right of=n24](n25){3};
\node[rectangle,draw, right of=n25,node distance=0.7cm](n26){7};
\node[rectangle,draw,right of=n26,node distance=0.7cm](n27){};
\node[rectangle,draw, right of=n27](n28){4};
\node[rectangle,draw, right of=n28,node distance=0.7cm](n29){30};
\node[rectangle,draw, right of=n29,node distance=0.7cm](n210){$\wedge$};
\draw[-latex] (n21.center) -- (n22.west);
\draw[-latex] (n24.center) -- (n25.west);
\draw[-latex] (n27.center) -- (n28.west);
\node(3)[node distance=0.8cm,below of=2]{3};
\node[draw,rectangle,node distance=0.7cm,right of=3,minimum height=0.8cm](n30){$V_4$} ;
\node[rectangle,draw,right of=n30,node distance=0.7cm,minimum height=0.8cm](n31){};
\node[rectangle,draw,right of=n31](n32){0};
\node[rectangle,draw, right of=n32,node distance=0.7cm](n33){4};
\node[rectangle,draw,right of=n33,node distance=0.7cm](n34){};
\node[rectangle,draw, right of=n34](n35){1};
\node[rectangle,draw, right of=n35,node distance=0.7cm](n36){8};
\node[rectangle,draw,right of=n36,node distance=0.7cm](n37){};
\node[rectangle,draw, right of=n37](n38){2};
\node[rectangle,draw, right of=n38,node distance=0.7cm](n39){7};
\node[rectangle,draw,right of=n39,node distance=0.7cm](n310){};
\node[rectangle,draw, right of=n310](n311){4};
\node[rectangle,draw,right of=n311,node distance=0.7cm](n312){6};
\node[rectangle,draw, right of=n312,node distance=0.7cm](n313){$\wedge$};
\draw[-latex] (n31.center) -- (n32.west);
\draw[-latex] (n34.center) -- (n35.west);
\draw[-latex] (n37.center) -- (n38.west);
\draw[-latex] (n310.center) -- (n311.west);
\node(4)[node distance=0.8cm,below of=3]{4};
\node[draw,rectangle,node distance=0.7cm,right of=4,minimum height=0.8cm](n40){$V_5$} ;
\node[rectangle,draw,right of=n40,node distance=0.7cm,minimum height=0.8cm](n41){};
\node[rectangle,draw,right of=n41](n42){0};
\node[rectangle,draw, right of=n42,node distance=0.7cm](n43){12};
\node[rectangle,draw,right of=n43,node distance=0.7cm](n44){};
\node[rectangle,draw, right of=n44](n45){1};
\node[rectangle,draw, right of=n45,node distance=0.7cm](n46){5};
\node[rectangle,draw,right of=n46,node distance=0.7cm](n47){};
\node[rectangle,draw, right of=n47](n48){2};
\node[rectangle,draw, right of=n48,node distance=0.7cm](n49){30};
\node[rectangle,draw,right of=n49,node distance=0.7cm](n410){};
\node[rectangle,draw, right of=n410](n411){3};
\node[rectangle,draw,right of=n411,node distance=0.7cm](n412){6};
\node[rectangle,draw, right of=n412,node distance=0.7cm](n413){$\wedge$};
\draw[-latex] (n41.center) -- (n42.west);
\draw[-latex] (n44.center) -- (n45.west);
\draw[-latex] (n47.center) -- (n48.west);
\draw[-latex] (n410.center) -- (n411.west);
\end{tikzpicture}
```
我感觉主要是因为没有为各个`\node`命名的原因,另外:
```tex
\draw[-latex] (n1.center) — (n2.west);
\draw[-latex] (n4.center) — (n5.west);
\draw[-latex] (n7.center) — (n8.west);
```
这三行代码中使用了`—`,应该是`--`,修改后的代码为:
```tex
\draw[-latex] (n21.center) -- (n22.west);
\draw[-latex] (n24.center) -- (n25.west);
\draw[-latex] (n27.center) -- (n28.west);
```
结果没有问题:
![](https://pics.latexstudio.net/data/images/201912/9e5dd05f5389f00.png)
作者追问:2019-12-29 07:58
谢谢!您也是用latex编译的吗?我用pdflatex编译后pdf文件显示正常,但是用latex编译后dvi显示不正常,是不是我的系统缺什么东西?我用的是CTeX 2.9.2
你的回答
请登录后回答
你的回答将会帮助更多人,请务必认真回答问题。