当我删除独立类并将图形放入文档中时,我只得到了架构的一部分
\documentclass{article}
\usepackage[edges]{forest}
\begin{document}
\begin{figure}
\begin{forest}
for tree={draw,edge={-latex},parent anchor=south,align=center,
}
[Ontological models and languages\\
for mathematical knowledge management\\
on the Semantic Web
[Terminological Ressources\\ and Symbolic Notation\\ for Mathematical domain
[Terminological Ressources
[Vocabularies
[The Online Encyclopedia\\ of Integer Sequences]
]
[pft1nnnnnnnn\\nnnnnnnnnnnnnnn12
[pftnnnnnnnnnn\\
nnnnnnnnnnnnnnnnnnnnnn1121]
[pft1122]
]
]
[pftgggggggggg12
[pfggggggggt121
[pfggggggggggt1211]
]
[pftggggggg122
[pfggggggggt1221]
]
[pftggggggggg123
[pfggggggggggt1231]
]
]
]
[pfgggggggt2
[pftgggggggggg21
[pftnnnnnnnnn\\
nnnnnnnnnnnnnnn211]
[pfnnnnnnnnnnnnnnnnnnnnnt212]
]
[pfjjjjjjjjjjjjjjjjjt22]
]
]
\end{forest}
\centering
\caption{\textbf{The multilevel of the abstraction.}\label{fig:tree}}
\end{figure}
\end{document}
答案1
(太渴望评论了)
您的问题与 LateX 的关系非常薄弱。主要问题是节点内容的格式。从 LaTeX 方面,您只能做两件事:
将图形旋转为横向。例如使用包
rotating
:\documentclass{article} \usepackage{rotating} \usepackage[edges]{forest} \begin{document} \begin{sidewaysfigure} .... \end{sidewaysfigure} \end{document}
此外,使用此解决方案时,您的表格将无法放在一页上。
减小字体大小,使图形适合文本宽度或至少适合文本高度(如果您旋转图形)。但是这样做,您很快就会遇到图形中文本难以辨认的情况。
因此,唯一有希望的解决方案是以下组合:
- 稍微减小字体大小,但不要超过
\footnotesize
。 - 重新格式化节点内容,节点会变窄。在这方面我们可以为您提供帮助,因为我们不知道真正的文本。
- 如果需要的话,最后旋转图形。
附录:
当节点内容为(较短的)单词序列时,树的一个例子是,针对字体大小进行选择,并且节点宽度 由下三个级别\footnotesize
以不同的方式确定:text width=...
\documentclass{article}
\usepackage[margin=25mm]{geometry}
\usepackage{rotating}
\usepackage[edges]{forest}
%---------------- show page layout. don't use in a real document!
\usepackage{showframe}
\renewcommand\ShowFrameLinethickness{0.15pt}
\renewcommand*\ShowFrameColor{\color{red}}
%---------------------------------------------------------------%
\begin{document}
\begin{figure}
\begin{forest}
for tree={draw,
edge={-latex},
parent anchor=south,
child anchor=north,
font=\footnotesize,
text centered,
text width=31mm,
where level=2{text width=21mm}{},
where level=3{text width=17mm}{},
where level=4{text width=13mm}{},
tier/.option=level,
l sep=9mm,
s sep=1mm,
}
[Ontological models and languages for mathematical knowledge management on the Semantic Web
[Terminological Ressources and Symbolic Notation for Mathematical domain
[Terminological Ressources
[Vocabularies
[The Online Encyclopedia of Integer]
]
[pft1 nnn nnnnn nnnnnn nnn nnnn nn12
[pft1122]
]
]
[pft gg ggggg ggg 12
[pfggg gggggt121
[pfgg ggggg gggt 1211]
]
[pft ggg gggg 122
[pf ggg ggggg t1221]
]
[pft ggggg gggg 123
[pfg gggg gg gggt 1231]
]
]
]
[pfgggggggt2
[pftgggg gg gggg 21
[pft nnn nnnnnn nnnnnnn nn nnnnnn 211]
[pfn nn nnnnnn nnnnn nn nnnnnt 212]
]
[pfjj jjj jjjjjj jjjjjj t22]
]
]
\end{forest}
\centering
\caption{\textbf{The multilevel of the abstraction.}
\label{fig:tree}}
\end{figure}
这使得图形能够适合边框宽度为 25 毫米的页面:
(红线表示文本区域的边界)