
Numerical Recipes 本の索引にあるような依存関係のグラフを作成したいと思います。次のような単純明快なものがほしいです。
質問で示唆されていることはLaTeX ファイルの依存関係のグラフ提供されているチャートを使用する方法ですhttp://www.graphviz.org/ただし、依存関係が多数あるため、視覚的なグラフは必要ありません。このタイプのチャートを含む LaTeX ドキュメントをコンパイルするには、どうすればよいでしょうか。
答え1
答え2
psmatrix
環境による解決策は次のとおりですpst-node
:
\documentclass[12pt,a4paper]{article}
\usepackage[utf8]{inputenc}
\usepackage{pgffor}
\usepackage{pst-node}
\usepackage{auto-pst-pdf}
\newcommand{\ebranch}[1]{\textnormal{[#1]}}
\begin{document}
\psset{armA=0.4cm, angleB=180, nodesep=3pt, linewidth=0.6pt, linejoin=1}
\psset{mcol=l, rowsep=0.15cm, colsep=1cm}% settings for psmatrices
\ttfamily
\begin{psmatrix}
%% nodes
shoot & \ebranch{load} \\
& odeint & \ebranch{derivs} \\
& & rkqs & rkrk & \ebranch{derivs} \\
& \ebranch{score}
%% node connections
\foreach \i in {1,2,4}{\ncangles{1,1}{\i,2}}
\foreach \i in {2,3}{\ncangles{2,2}{\i,3}}
\foreach \i in {3,4} {\fpAdd{\i}{1}{\j}\ncline{3,\i}{3, \j}}
\end{psmatrix}
\vspace{1cm}
\begin{psmatrix}
%% nodes
shootf & \ebranch{load1} \\
& odeint & \ebranch{derivs} \\
& & rkqs & rkrk & \ebranch{derivs} \\
& \ebranch{score} \\
& \ebranch{load2}
%% node connections
\foreach \i in {1,2, 4, 5}{\ncangles{1,1}{\i,2}}
\foreach \i in {2,3}{\ncangles{2,2}{\i,3}}
\foreach \i in {3,4} {\fpAdd{\i}{1}{\j}\ncline{3,\i}{3, \j}}
\end{psmatrix}
\end{document}