Игорь Пашев - Диаграмма зависимостей для TeX

Jan. 14th, 2011

08:01 pm - Диаграмма зависимостей для TeX

Previous Entry Add to Memories Tell A Friend Next Entry

Дано несколько файлов TeX.
Надо построить картинку их зависимостей (какой в каком используется).

Альбом: Screenshots



Что показывает grep:
# grep '\\input' *.tex
pashev-en.tex:\input{common}
pashev-en.tex:\input{contacts}
pashev-en.tex:\input{pashev}
pashev-ru.tex:\input{common}
pashev-ru.tex:\input{contacts}
pashev-ru.tex:\input{pashev}
pashev.tex:\input{education}
pashev.tex:\input{experience}
pashev.tex:\input{languages}
pashev.tex:\input{awards}
pashev.tex:\input{sites}
pashev.tex:\input{computer}
pashev.tex:\input{publications}


Пропускаем это через sed:
# grep '\\input' *.tex | sed -r 's/^(.+):\\input\{(.+)(\.tex)?\}/"\2.tex" -> "\1"/'
"common.tex" -> "pashev-en.tex"
"contacts.tex" -> "pashev-en.tex"
"pashev.tex" -> "pashev-en.tex"
"common.tex" -> "pashev-ru.tex"
"contacts.tex" -> "pashev-ru.tex"
"pashev.tex" -> "pashev-ru.tex"
"education.tex" -> "pashev.tex"
"experience.tex" -> "pashev.tex"
"languages.tex" -> "pashev.tex"
"awards.tex" -> "pashev.tex"
"sites.tex" -> "pashev.tex"
"computer.tex" -> "pashev.tex"
"publications.tex" -> "pashev.tex"


Остаётся поместить это в скобки
digraph {...}


И скормить доту:
# dot -T png -o output.png input.gv # для PNG
# dot -T pdf -o output.pdf input.gv # для PDF

Tags: , , , , ,
(Оставить комментарий)