绘制非常大的 tikz 图形

绘制非常大的 tikz 图形

我想知道是否有办法绘制一个非常大的 tikz 图形?这是完全自动生成的代码。请注意它已从页面溢出。

在此处输入图片描述

仅无边的节点:

\documentclass{article}
\usepackage[utf8]{inputenc}

\usepackage{geometry}
\geometry{a0paper, landscape, margin=1in}

\usepackage{algorithm}
\usepackage{algpseudocode}
\usepackage{amsmath,amssymb}
\usepackage{amsthm}
\usepackage{forest}
\usepackage{tikz}
\usepackage{pdflscape}
\usepackage{xcolor}
\pagenumbering{gobble}

\usetikzlibrary{positioning,calc,arrows.meta}

\begin{document}

\begin{figure}[htbp]
    \centering
    \begin{tikzpicture}[->,>=Stealth,auto,scale=0.6,shorten >= 4pt, thick,main node/.style={draw, rectangle, align=center}]
\node[main node,text width=1.54cm,align=center] (1) at (-215.417, 0) {$ { \tiny  \text{p.shared\_info} } $}; 
\node[main node,text width=7.26cm,align=center, anchor=south west] (2) at (1.south east) {$ { \tiny  \text{shared\_info.class\_table.class\_env.enclosing.locals.object\_type} } $}; 
\node[main node,text width=6.16cm,align=center, anchor=south west] (3) at (2.south east) {$ { \tiny  \text{shared\_info.class\_table.class\_env.locals.object\_type} } $}; 
\node[main node,text width=6.16cm,align=center, anchor=south west] (4) at (3.south east) {$ { \tiny  \text{shared\_info.class\_table.class\_env.enclosing.enclosing} } $}; 
\node[main node,text width=5.06cm,align=center, anchor=south west] (5) at (4.south east) {$ { \tiny  \text{shared\_info.class\_table.class\_env.enclosing} } $}; 
\node[main node,text width=5.83cm,align=center, anchor=south west] (6) at (5.south east) {$ { \tiny  \text{shared\_info.class\_table.class\_env.enclosing.locals} } $}; 
\node[main node,text width=4.73cm,align=center, anchor=south west] (7) at (6.south east) {$ { \tiny  \text{shared\_info.class\_table.class\_env.locals} } $}; 
\node[main node,text width=7.37cm,align=center, anchor=south west] (8) at (7.south east) {$ { \tiny  \text{shared\_info.class\_table.parent\_class.local\_methods.return\_type} } $}; 
\node[main node,text width=5.83cm,align=center, anchor=south west] (9) at (8.south east) {$ { \tiny  \text{shared\_info.class\_table.local\_methods.return\_type} } $}; 
\node[main node,text width=7.48cm,align=center, anchor=south west] (10) at (9.south east) {$ { \tiny  \text{shared\_info.class\_table.parent\_class.local\_methods.formal\_types} } $}; 
\node[main node,text width=5.94cm,align=center, anchor=south west] (11) at (10.south east) {$ { \tiny  \text{shared\_info.class\_table.local\_methods.formal\_types} } $}; 
\node[main node,text width=6.27cm,align=center, anchor=south west] (12) at (11.south east) {$ { \tiny  \text{shared\_info.class\_table.parent\_class.defined\_ancestry} } $}; 
\node[main node,text width=4.73cm,align=center, anchor=south west] (13) at (12.south east) {$ { \tiny  \text{shared\_info.class\_table.defined\_ancestry} } $}; 
\node[main node,text width=5.28cm,align=center, anchor=south west] (14) at (13.south east) {$ { \tiny  \text{shared\_info.class\_table.class\_is\_inheritable} } $}; 
\node[main node,text width=4.62cm,align=center, anchor=south west] (15) at (14.south east) {$ { \tiny  \text{shared\_info.class\_table.class\_is\_basic} } $}; 
\node[main node,text width=3.96cm,align=center, anchor=south west] (16) at (15.south east) {$ { \tiny  \text{shared\_info.class\_table.class\_env} } $}; 
\node[main node,text width=5.94cm,align=center, anchor=south west] (17) at (16.south east) {$ { \tiny  \text{shared\_info.class\_table.parent\_class.local\_methods} } $}; 
\node[main node,text width=4.4cm,align=center, anchor=south west] (18) at (17.south east) {$ { \tiny  \text{shared\_info.class\_table.local\_methods} } $}; 
\node[main node,text width=5.83cm,align=center, anchor=south west] (19) at (18.south east) {$ { \tiny  \text{shared\_info.class\_table.parent\_class.parent\_class} } $}; 
\node[main node,text width=4.29cm,align=center, anchor=south west] (20) at (19.south east) {$ { \tiny  \text{shared\_info.class\_table.parent\_class} } $}; 
\node[main node,text width=2.64cm,align=center, anchor=south west] (21) at (20.south east) {$ { \tiny  \text{shared\_info.object\_sym} } $}; 
\node[main node,text width=2.42cm,align=center, anchor=south west] (22) at (21.south east) {$ { \tiny  \text{shared\_info.this\_sym} } $}; 
\node[main node,text width=2.42cm,align=center, anchor=south west] (23) at (22.south east) {$ { \tiny  \text{shared\_info.main\_sym} } $}; 
\node[main node,text width=2.42cm,align=center, anchor=south west] (24) at (23.south east) {$ { \tiny  \text{shared\_info.void\_sym} } $}; 
\node[main node,text width=2.64cm,align=center, anchor=south west] (25) at (24.south east) {$ { \tiny  \text{shared\_info.native\_sym} } $}; 
\node[main node,text width=2.53cm,align=center, anchor=south west] (26) at (25.south east) {$ { \tiny  \text{shared\_info.error\_sym} } $}; 
\node[main node,text width=2.75cm,align=center, anchor=south west] (27) at (26.south east) {$ { \tiny  \text{shared\_info.class\_table} } $}; 
\node[main node,text width=2.86cm,align=center, anchor=south west] (28) at (27.south east) {$ { \tiny  \text{shared\_info.a\_void\_type} } $}; 
\node[main node,text width=3.08cm,align=center, anchor=south west] (29) at (28.south east) {$ { \tiny  \text{shared\_info.an\_error\_type} } $}; 
\node[main node,text width=3.3cm,align=center, anchor=south west] (30) at (29.south east) {$ { \tiny  \text{shared\_info.an\_integer\_type} } $}; 
\node[main node,text width=3.19cm,align=center, anchor=south west] (31) at (30.south east) {$ { \tiny  \text{shared\_info.a\_boolean\_type} } $}; 
\node[main node,text width=3.08cm,align=center, anchor=south west] (32) at (31.south east) {$ { \tiny  \text{shared\_info.a\_string\_type} } $}; 
\node[main node,text width=3.19cm,align=center, anchor=south west] (33) at (32.south east) {$ { \tiny  \text{shared\_info.an\_object\_type} } $}; 
\node[main node,text width=2.86cm,align=center, anchor=south west] (34) at (33.south east) {$ { \tiny  \text{shared\_info.a\_unit\_type} } $}; 
\node[main node,text width=7.37cm,align=center, anchor=south west] (35) at (34.south east) {$ { \tiny  \text{shared\_info.class\_table!.class\_env.enclosing.locals.object\_type} } $}; 
\node[main node,text width=6.27cm,align=center, anchor=south west] (36) at (35.south east) {$ { \tiny  \text{shared\_info.class\_table!.class\_env.locals.object\_type} } $}; 
\node[main node,text width=6.27cm,align=center, anchor=south west] (37) at (36.south east) {$ { \tiny  \text{shared\_info.class\_table!.class\_env.enclosing.enclosing} } $}; 
\node[main node,text width=5.17cm,align=center, anchor=south west] (38) at (37.south east) {$ { \tiny  \text{shared\_info.class\_table!.class\_env.enclosing} } $}; 
\node[main node,text width=5.94cm,align=center, anchor=south west] (39) at (38.south east) {$ { \tiny  \text{shared\_info.class\_table!.class\_env.enclosing.locals} } $}; 
\node[main node,text width=4.84cm,align=center, anchor=south west] (40) at (39.south east) {$ { \tiny  \text{shared\_info.class\_table!.class\_env.locals} } $}; 
\node[main node,text width=7.48cm,align=center, anchor=south west] (41) at (40.south east) {$ { \tiny  \text{shared\_info.class\_table!.parent\_class.local\_methods.return\_type} } $}; 
\node[main node,text width=5.94cm,align=center, anchor=south west] (42) at (41.south east) {$ { \tiny  \text{shared\_info.class\_table!.local\_methods.return\_type} } $}; 
\node[main node,text width=7.59cm,align=center, anchor=south west] (43) at (42.south east) {$ { \tiny  \text{shared\_info.class\_table!.parent\_class.local\_methods.formal\_types} } $}; 
\node[main node,text width=6.05cm,align=center, anchor=south west] (44) at (43.south east) {$ { \tiny  \text{shared\_info.class\_table!.local\_methods.formal\_types} } $}; 
\node[main node,text width=6.38cm,align=center, anchor=south west] (45) at (44.south east) {$ { \tiny  \text{shared\_info.class\_table!.parent\_class.defined\_ancestry} } $}; 
\node[main node,text width=4.84cm,align=center, anchor=south west] (46) at (45.south east) {$ { \tiny  \text{shared\_info.class\_table!.defined\_ancestry} } $}; 
\node[main node,text width=5.39cm,align=center, anchor=south west] (47) at (46.south east) {$ { \tiny  \text{shared\_info.class\_table!.class\_is\_inheritable} } $}; 
\node[main node,text width=4.73cm,align=center, anchor=south west] (48) at (47.south east) {$ { \tiny  \text{shared\_info.class\_table!.class\_is\_basic} } $}; 
\node[main node,text width=4.07cm,align=center, anchor=south west] (49) at (48.south east) {$ { \tiny  \text{shared\_info.class\_table!.class\_env} } $}; 
\node[main node,text width=6.05cm,align=center, anchor=south west] (50) at (49.south east) {$ { \tiny  \text{shared\_info.class\_table!.parent\_class.local\_methods} } $}; 
\node[main node,text width=4.51cm,align=center, anchor=south west] (51) at (50.south east) {$ { \tiny  \text{shared\_info.class\_table!.local\_methods} } $}; 
\node[main node,text width=5.94cm,align=center, anchor=south west] (52) at (51.south east) {$ { \tiny  \text{shared\_info.class\_table!.parent\_class.parent\_class} } $}; 
\node[main node,text width=4.4cm,align=center, anchor=south west] (53) at (52.south east) {$ { \tiny  \text{shared\_info.class\_table!.parent\_class} } $}; 
\node[main node,text width=2.2cm,align=center, anchor=south west] (54) at (53.south east) {$ { \tiny  \text{shared\_info.errors!} } $}; 
\node[main node,text width=2.86cm,align=center, anchor=south west] (55) at (54.south east) {$ { \tiny  \text{shared\_info.class\_table!} } $}; 
\node[main node,text width=0.88cm,align=center] (0) at (323.125, -10.0) {$ { \tiny  \text{cond@319} } $}; 
\node[main node,text width=3.85cm,align=center] (111) at (-323.125, -20) {$ { \tiny  \text{lookup\_class(...):317.shared\_info} } $}; 
\node[main node,text width=8.14cm,align=center, anchor=south west] (112) at (111.south east) {$ { \tiny  \text{..):317.shared\_info.class\_table.class\_env.enclosing.locals.object\_type} } $}; 
\node[main node,text width=7.04cm,align=center, anchor=south west] (113) at (112.south east) {$ { \tiny  \text{..):317.shared\_info.class\_table.class\_env.locals.object\_type} } $}; 
\node[main node,text width=7.04cm,align=center, anchor=south west] (114) at (113.south east) {$ { \tiny  \text{..):317.shared\_info.class\_table.class\_env.enclosing.enclosing} } $}; 
\node[main node,text width=5.94cm,align=center, anchor=south west] (115) at (114.south east) {$ { \tiny  \text{..):317.shared\_info.class\_table.class\_env.enclosing} } $}; 
\node[main node,text width=6.71cm,align=center, anchor=south west] (116) at (115.south east) {$ { \tiny  \text{..):317.shared\_info.class\_table.class\_env.enclosing.locals} } $}; 
\node[main node,text width=5.61cm,align=center, anchor=south west] (117) at (116.south east) {$ { \tiny  \text{..):317.shared\_info.class\_table.class\_env.locals} } $}; 
\node[main node,text width=8.25cm,align=center, anchor=south west] (118) at (117.south east) {$ { \tiny  \text{..):317.shared\_info.class\_table.parent\_class.local\_methods.return\_type} } $}; 
\node[main node,text width=6.71cm,align=center, anchor=south west] (119) at (118.south east) {$ { \tiny  \text{..):317.shared\_info.class\_table.local\_methods.return\_type} } $}; 
\node[main node,text width=8.36cm,align=center, anchor=south west] (120) at (119.south east) {$ { \tiny  \text{..):317.shared\_info.class\_table.parent\_class.local\_methods.formal\_types} } $}; 
\node[main node,text width=6.82cm,align=center, anchor=south west] (121) at (120.south east) {$ { \tiny  \text{..):317.shared\_info.class\_table.local\_methods.formal\_types} } $}; 
\node[main node,text width=7.15cm,align=center, anchor=south west] (122) at (121.south east) {$ { \tiny  \text{..):317.shared\_info.class\_table.parent\_class.defined\_ancestry} } $}; 
\node[main node,text width=5.61cm,align=center, anchor=south west] (123) at (122.south east) {$ { \tiny  \text{..):317.shared\_info.class\_table.defined\_ancestry} } $}; 
\node[main node,text width=6.16cm,align=center, anchor=south west] (124) at (123.south east) {$ { \tiny  \text{..):317.shared\_info.class\_table.class\_is\_inheritable} } $}; 
\node[main node,text width=5.5cm,align=center, anchor=south west] (125) at (124.south east) {$ { \tiny  \text{..):317.shared\_info.class\_table.class\_is\_basic} } $}; 
\node[main node,text width=4.84cm,align=center, anchor=south west] (126) at (125.south east) {$ { \tiny  \text{..):317.shared\_info.class\_table.class\_env} } $}; 
\node[main node,text width=6.82cm,align=center, anchor=south west] (127) at (126.south east) {$ { \tiny  \text{..):317.shared\_info.class\_table.parent\_class.local\_methods} } $}; 
\node[main node,text width=5.28cm,align=center, anchor=south west] (128) at (127.south east) {$ { \tiny  \text{..):317.shared\_info.class\_table.local\_methods} } $}; 
\node[main node,text width=6.71cm,align=center, anchor=south west] (129) at (128.south east) {$ { \tiny  \text{..):317.shared\_info.class\_table.parent\_class.parent\_class} } $}; 
\node[main node,text width=5.17cm,align=center, anchor=south west] (130) at (129.south east) {$ { \tiny  \text{..):317.shared\_info.class\_table.parent\_class} } $}; 
\node[main node,text width=3.63cm,align=center, anchor=south west] (131) at (130.south east) {$ { \tiny  \text{..):317.shared\_info.class\_table} } $}; 
\node[main node,text width=1.98cm,align=center, anchor=south west] (132) at (131.south east) {$ { \tiny  \text{..):317.lc\_result} } $}; 
\node[main node,text width=6.49cm,align=center, anchor=south west] (133) at (132.south east) {$ { \tiny  \text{..):317.lc\_result.class\_env.enclosing.locals.object\_type} } $}; 
\node[main node,text width=5.39cm,align=center, anchor=south west] (134) at (133.south east) {$ { \tiny  \text{..):317.lc\_result.class\_env.locals.object\_type} } $}; 
\node[main node,text width=5.39cm,align=center, anchor=south west] (135) at (134.south east) {$ { \tiny  \text{..):317.lc\_result.class\_env.enclosing.enclosing} } $}; 
\node[main node,text width=4.29cm,align=center, anchor=south west] (136) at (135.south east) {$ { \tiny  \text{..):317.lc\_result.class\_env.enclosing} } $}; 
\node[main node,text width=5.06cm,align=center, anchor=south west] (137) at (136.south east) {$ { \tiny  \text{..):317.lc\_result.class\_env.enclosing.locals} } $}; 
\node[main node,text width=3.96cm,align=center, anchor=south west] (138) at (137.south east) {$ { \tiny  \text{..):317.lc\_result.class\_env.locals} } $}; 
\node[main node,text width=6.6cm,align=center, anchor=south west] (139) at (138.south east) {$ { \tiny  \text{..):317.lc\_result.parent\_class.local\_methods.return\_type} } $}; 
\node[main node,text width=5.06cm,align=center, anchor=south west] (140) at (139.south east) {$ { \tiny  \text{..):317.lc\_result.local\_methods.return\_type} } $}; 
\node[main node,text width=6.71cm,align=center, anchor=south west] (141) at (140.south east) {$ { \tiny  \text{..):317.lc\_result.parent\_class.local\_methods.formal\_types} } $}; 
\node[main node,text width=5.17cm,align=center, anchor=south west] (142) at (141.south east) {$ { \tiny  \text{..):317.lc\_result.local\_methods.formal\_types} } $}; 
\node[main node,text width=5.5cm,align=center, anchor=south west] (143) at (142.south east) {$ { \tiny  \text{..):317.lc\_result.parent\_class.defined\_ancestry} } $}; 
\node[main node,text width=5.17cm,align=center, anchor=south west] (144) at (143.south east) {$ { \tiny  \text{..):317.lc\_result.parent\_class.local\_methods} } $}; 
\node[main node,text width=5.06cm,align=center, anchor=south west] (145) at (144.south east) {$ { \tiny  \text{..):317.lc\_result.parent\_class.parent\_class} } $}; 
\node[main node,text width=3.52cm,align=center, anchor=south west] (146) at (145.south east) {$ { \tiny  \text{..):317.lc\_result.parent\_class} } $}; 
\node[main node,text width=3.63cm,align=center, anchor=south west] (147) at (146.south east) {$ { \tiny  \text{..):317.lc\_result.local\_methods} } $}; 
\node[main node,text width=3.19cm,align=center, anchor=south west] (148) at (147.south east) {$ { \tiny  \text{..):317.lc\_result.class\_env} } $}; 
\node[main node,text width=3.85cm,align=center, anchor=south west] (149) at (148.south east) {$ { \tiny  \text{..):317.lc\_result.class\_is\_basic} } $}; 
\node[main node,text width=4.51cm,align=center, anchor=south west] (150) at (149.south east) {$ { \tiny  \text{..):317.lc\_result.class\_is\_inheritable} } $}; 
\node[main node,text width=3.96cm,align=center, anchor=south west] (151) at (150.south east) {$ { \tiny  \text{..):317.lc\_result.defined\_ancestry} } $}; 
\node[main node,text width=0.99cm,align=center, anchor=south west] (152) at (151.south east) {$ { \tiny  \text{..):317.n} } $}; 
\node[main node,text width=1.76cm,align=center] (56) at (107.708, -20) {$ { \tiny  \text{cls.shared\_info} } $}; 
\node[main node,text width=7.26cm,align=center, anchor=south west] (57) at (56.south east) {$ { \tiny  \text{shared\_info.class\_table.class\_env.enclosing.locals.object\_type} } $}; 
\node[main node,text width=6.16cm,align=center, anchor=south west] (58) at (57.south east) {$ { \tiny  \text{shared\_info.class\_table.class\_env.locals.object\_type} } $}; 
\node[main node,text width=6.16cm,align=center, anchor=south west] (59) at (58.south east) {$ { \tiny  \text{shared\_info.class\_table.class\_env.enclosing.enclosing} } $}; 
\node[main node,text width=5.06cm,align=center, anchor=south west] (60) at (59.south east) {$ { \tiny  \text{shared\_info.class\_table.class\_env.enclosing} } $}; 
\node[main node,text width=5.83cm,align=center, anchor=south west] (61) at (60.south east) {$ { \tiny  \text{shared\_info.class\_table.class\_env.enclosing.locals} } $}; 
\node[main node,text width=4.73cm,align=center, anchor=south west] (62) at (61.south east) {$ { \tiny  \text{shared\_info.class\_table.class\_env.locals} } $}; 
\node[main node,text width=7.37cm,align=center, anchor=south west] (63) at (62.south east) {$ { \tiny  \text{shared\_info.class\_table.parent\_class.local\_methods.return\_type} } $}; 
\node[main node,text width=5.83cm,align=center, anchor=south west] (64) at (63.south east) {$ { \tiny  \text{shared\_info.class\_table.local\_methods.return\_type} } $}; 
\node[main node,text width=7.48cm,align=center, anchor=south west] (65) at (64.south east) {$ { \tiny  \text{shared\_info.class\_table.parent\_class.local\_methods.formal\_types} } $}; 
\node[main node,text width=5.94cm,align=center, anchor=south west] (66) at (65.south east) {$ { \tiny  \text{shared\_info.class\_table.local\_methods.formal\_types} } $}; 
\node[main node,text width=6.27cm,align=center, anchor=south west] (67) at (66.south east) {$ { \tiny  \text{shared\_info.class\_table.parent\_class.defined\_ancestry} } $}; 
\node[main node,text width=4.73cm,align=center, anchor=south west] (68) at (67.south east) {$ { \tiny  \text{shared\_info.class\_table.defined\_ancestry} } $}; 
\node[main node,text width=5.28cm,align=center, anchor=south west] (69) at (68.south east) {$ { \tiny  \text{shared\_info.class\_table.class\_is\_inheritable} } $}; 
\node[main node,text width=4.62cm,align=center, anchor=south west] (70) at (69.south east) {$ { \tiny  \text{shared\_info.class\_table.class\_is\_basic} } $}; 
\node[main node,text width=3.96cm,align=center, anchor=south west] (71) at (70.south east) {$ { \tiny  \text{shared\_info.class\_table.class\_env} } $}; 
\node[main node,text width=5.94cm,align=center, anchor=south west] (72) at (71.south east) {$ { \tiny  \text{shared\_info.class\_table.parent\_class.local\_methods} } $}; 
\node[main node,text width=4.4cm,align=center, anchor=south west] (73) at (72.south east) {$ { \tiny  \text{shared\_info.class\_table.local\_methods} } $}; 
\node[main node,text width=5.83cm,align=center, anchor=south west] (74) at (73.south east) {$ { \tiny  \text{shared\_info.class\_table.parent\_class.parent\_class} } $}; 
\node[main node,text width=4.29cm,align=center, anchor=south west] (75) at (74.south east) {$ { \tiny  \text{shared\_info.class\_table.parent\_class} } $}; 
\node[main node,text width=2.64cm,align=center, anchor=south west] (76) at (75.south east) {$ { \tiny  \text{shared\_info.object\_sym} } $}; 
\node[main node,text width=2.42cm,align=center, anchor=south west] (77) at (76.south east) {$ { \tiny  \text{shared\_info.this\_sym} } $}; 
\node[main node,text width=2.42cm,align=center, anchor=south west] (78) at (77.south east) {$ { \tiny  \text{shared\_info.main\_sym} } $}; 
\node[main node,text width=2.42cm,align=center, anchor=south west] (79) at (78.south east) {$ { \tiny  \text{shared\_info.void\_sym} } $}; 
\node[main node,text width=2.64cm,align=center, anchor=south west] (80) at (79.south east) {$ { \tiny  \text{shared\_info.native\_sym} } $}; 
\node[main node,text width=2.53cm,align=center, anchor=south west] (81) at (80.south east) {$ { \tiny  \text{shared\_info.error\_sym} } $}; 
\node[main node,text width=2.75cm,align=center, anchor=south west] (82) at (81.south east) {$ { \tiny  \text{shared\_info.class\_table} } $}; 
\node[main node,text width=2.86cm,align=center, anchor=south west] (83) at (82.south east) {$ { \tiny  \text{shared\_info.a\_void\_type} } $}; 
\node[main node,text width=3.08cm,align=center, anchor=south west] (84) at (83.south east) {$ { \tiny  \text{shared\_info.an\_error\_type} } $}; 
\node[main node,text width=3.3cm,align=center, anchor=south west] (85) at (84.south east) {$ { \tiny  \text{shared\_info.an\_integer\_type} } $}; 
\node[main node,text width=3.19cm,align=center, anchor=south west] (86) at (85.south east) {$ { \tiny  \text{shared\_info.a\_boolean\_type} } $}; 
\node[main node,text width=3.08cm,align=center, anchor=south west] (87) at (86.south east) {$ { \tiny  \text{shared\_info.a\_string\_type} } $}; 
\node[main node,text width=3.19cm,align=center, anchor=south west] (88) at (87.south east) {$ { \tiny  \text{shared\_info.an\_object\_type} } $}; 
\node[main node,text width=2.86cm,align=center, anchor=south west] (89) at (88.south east) {$ { \tiny  \text{shared\_info.a\_unit\_type} } $}; 
\node[main node,text width=7.37cm,align=center, anchor=south west] (90) at (89.south east) {$ { \tiny  \text{shared\_info.class\_table!.class\_env.enclosing.locals.object\_type} } $}; 
\node[main node,text width=6.27cm,align=center, anchor=south west] (91) at (90.south east) {$ { \tiny  \text{shared\_info.class\_table!.class\_env.locals.object\_type} } $}; 
\node[main node,text width=6.27cm,align=center, anchor=south west] (92) at (91.south east) {$ { \tiny  \text{shared\_info.class\_table!.class\_env.enclosing.enclosing} } $}; 
\node[main node,text width=5.17cm,align=center, anchor=south west] (93) at (92.south east) {$ { \tiny  \text{shared\_info.class\_table!.class\_env.enclosing} } $}; 
\node[main node,text width=5.94cm,align=center, anchor=south west] (94) at (93.south east) {$ { \tiny  \text{shared\_info.class\_table!.class\_env.enclosing.locals} } $}; 
\node[main node,text width=4.84cm,align=center, anchor=south west] (95) at (94.south east) {$ { \tiny  \text{shared\_info.class\_table!.class\_env.locals} } $}; 
\node[main node,text width=7.48cm,align=center, anchor=south west] (96) at (95.south east) {$ { \tiny  \text{shared\_info.class\_table!.parent\_class.local\_methods.return\_type} } $}; 
\node[main node,text width=5.94cm,align=center, anchor=south west] (97) at (96.south east) {$ { \tiny  \text{shared\_info.class\_table!.local\_methods.return\_type} } $}; 
\node[main node,text width=7.59cm,align=center, anchor=south west] (98) at (97.south east) {$ { \tiny  \text{shared\_info.class\_table!.parent\_class.local\_methods.formal\_types} } $}; 
\node[main node,text width=6.05cm,align=center, anchor=south west] (99) at (98.south east) {$ { \tiny  \text{shared\_info.class\_table!.local\_methods.formal\_types} } $}; 
\node[main node,text width=6.38cm,align=center, anchor=south west] (100) at (99.south east) {$ { \tiny  \text{shared\_info.class\_table!.parent\_class.defined\_ancestry} } $}; 
\node[main node,text width=4.84cm,align=center, anchor=south west] (101) at (100.south east) {$ { \tiny  \text{shared\_info.class\_table!.defined\_ancestry} } $}; 
\node[main node,text width=5.39cm,align=center, anchor=south west] (102) at (101.south east) {$ { \tiny  \text{shared\_info.class\_table!.class\_is\_inheritable} } $}; 
\node[main node,text width=4.73cm,align=center, anchor=south west] (103) at (102.south east) {$ { \tiny  \text{shared\_info.class\_table!.class\_is\_basic} } $}; 
\node[main node,text width=4.07cm,align=center, anchor=south west] (104) at (103.south east) {$ { \tiny  \text{shared\_info.class\_table!.class\_env} } $}; 
\node[main node,text width=6.05cm,align=center, anchor=south west] (105) at (104.south east) {$ { \tiny  \text{shared\_info.class\_table!.parent\_class.local\_methods} } $}; 
\node[main node,text width=4.51cm,align=center, anchor=south west] (106) at (105.south east) {$ { \tiny  \text{shared\_info.class\_table!.local\_methods} } $}; 
\node[main node,text width=5.94cm,align=center, anchor=south west] (107) at (106.south east) {$ { \tiny  \text{shared\_info.class\_table!.parent\_class.parent\_class} } $}; 
\node[main node,text width=4.4cm,align=center, anchor=south west] (108) at (107.south east) {$ { \tiny  \text{shared\_info.class\_table!.parent\_class} } $}; 
\node[main node,text width=2.2cm,align=center, anchor=south west] (109) at (108.south east) {$ { \tiny  \text{shared\_info.errors!} } $}; 
\node[main node,text width=2.86cm,align=center, anchor=south west] (110) at (109.south east) {$ { \tiny  \text{shared\_info.class\_table!} } $}; 

    \end{tikzpicture}
    \caption{\texttt{program} in \texttt{COOL}}
\end{figure}


\end{document}

答案1

仅一些评论(评论太长了):

  • 您的图像太宽,即使是横向和 A0 纸张大小,也无法放在一页上
  • 由于不可能看到全貌,很难说是否有合理的方法来重新组织它,使其变得更窄。例如,将一长串节点分成上下两部分。
  • 节点的代码没有必要那么复杂。例如,它们的内容写成
{$ { \tiny  \text{shared\_info.class\_table.class\_env.enclosing.locals.object\_type} } $}; 

但可以通过移动\tiny到节点样式定义来获得相同的结果,然后将其简单地写为

{shared\_info.class\_table.class\_env.enclosing.locals.object\_type};
  • 在写入节点时情况类似:
\node[main node,text width=7.26cm,align=center, anchor=south west] (2) at (1.south east)

其中 optionalign=center已在节点样式中定义,因此无需再次重复,并且 optionanchor并非真正需要,或者至少应移至节点样式定义。此外,optiontext width=...还可以剪裁为 snode 样式定义,例如text width=#1。考虑到这一点,节点可以写成例如:

\node[main node=1.54cm] (1)

其中,主节点定义为:

main node/.style = {draw, font=\tiny, inner ysep=1ex, outer sep=0pt, 
                    text depth=0.5ex, text width=#1, align=center},
  • 为什么使用绝对位置放置节点。更简单的方法是使用库chains并写入节点链。例如,前五个节点为
\node[MN=1.54cm] (1)    {p.shared\_info};
\node[MN=7.26cm] (2)    {shared\_info.class\_table.class\_env.enclosing.locals.object\_type};
\node[MN=6.16cm] (3)    {shared\_info.class\_table.class\_env.locals.object\_type};
\node[MN=6.16cm] (4)    {shared\_info.class\_table.class\_env.enclosing.enclosing};
\node[MN=5.06cm] (5)    {shared\_info.class\_table.class\_env.enclosing};

并为此重新定义图片序言:

    \begin{tikzpicture}[scale=0.6,
node distance = 0pt,
  start chain = going right, 
    MN/.style = {% shortnes for main node
                 draw, font=\tiny, inner ysep=1ex, outer sep=0pt, 
                 text depth=0.5ex, text width=#1, align=center,
                 on chain}
                        ]
  • 我想知道,为什么你为每个节点定义自己的text width。在我看来,它们根本不需要定义。删除它们!通过这张图片将变得相当短。例如,看看前四个节点的比较:

在此处输入图片描述

上述比较的测试代码为:

\documentclass{article}
\usepackage{geometry}
\geometry{%a0paper,     % for test proposes
          landscape, margin=1in}
\usepackage{tikz}
\usetikzlibrary{arrows.meta, 
                chains,
                positioning}
\usepackage{pdflscape}

\begin{document}
with defined \verb+text width+:\\

\noindent%
    \begin{tikzpicture}[scale=0.6,
node distance = 0pt,
  start chain = going right, 
    MN/.style = {%Main node
                 draw, font=\tiny, inner ysep=1ex, outer sep=0pt, 
                 text depth=0.5ex, text width=#1, align=center,
                 on chain}
                        ]
\node[MN=1.54cm] (1)    {p.shared\_info};
\node[MN=7.26cm] (2)    {shared\_info.class\_table.class\_env.enclosing.locals.object\_type};
\node[MN=6.16cm] (3)    {shared\_info.class\_table.class\_env.locals.object\_type};
\node[MN=6.16cm] (4)    {shared\_info.class\_table.class\_env.enclosing.enclosing};

   \end{tikzpicture}

\bigskip
without defined \verb+text width+:\\
   
\noindent%
    \begin{tikzpicture}[scale=0.6,
node distance = 0pt,
  start chain = going right,
    MN/.style = {%Main node
                 draw, font=\tiny, inner sep=1ex, outer sep=0pt,
                 text depth=0.5ex, 
                 on chain}
                        ]
\node[MN] (1)    {p.shared\_info};
\node[MN] (2)    {shared\_info.class\_table.class\_env.enclosing.locals.object\_type};
\node[MN] (3)    {shared\_info.class\_table.class\_env.locals.object\_type};
\node[MN] (4)    {shared\_info.class\_table.class\_env.enclosing.enclosing};
   \end{tikzpicture}
\end{document}

结论

  • 建议的更改会使您的图像变短,但恐怕这还不够。

  • 测试代码中显示了如何实施所提议的更改的方式。

  • 在我看来,这么长的图片,加上使用的字体和纸张尺寸,可读性会很差。

  • 为了获得进一步的帮助,应该了解此插图的目的及其重组的可能性。

相关内容