\documentclass{article}
\usepackage{babel}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{tikz}
\usetikzlibrary{trees}
\usepackage{verbatimbox}
\usepackage[active,tightpage]{preview}
\PreviewEnvironment{tikzpicture}
\setlength\PreviewBorder{5pt}
\begin{document}
	\tikzstyle{every node}=[draw=black,thick,anchor=west]
	\tikzstyle{selected}=[draw=red,fill=red!30]
	\tikzstyle{foot}=[fill=gray!50]
	\tikzstyle{rel}=[fill=blue!70]
	\tikzstyle{partition}=[draw=white]

	\begin{myverbbox}{\main}
		\documentclass{article}
		\usepackage{babel}
		\usepackage[utf8]{inputenc}
		\usepackage[T1]{fontenc}
		\title{A Title}
		\begin{document}
			\maketitle
			\tableofcontents
			\input{part1.tex}
			\input{part2.tex}
		\end{document}
		\end{myverbbox}

	\begin{myverbbox}{\one}
		\section{This is section 1}
		A paragraph about the content
		of section 1.
	\end{myverbbox}

	\begin{myverbbox}{\two}
		\section{This is section 2}
		A paragraph about the content
		of section 2.
	\end{myverbbox}

	\tikzstyle{every node}=[shape=rectangle]
	\tikzstyle{boxy}=[draw]
	\tikzstyle{mega}=[fill=gray!30]
	\begin{tikzpicture}
	\node(main) at (5,5) [mega, boxy] {\main};
	\node(one) at (0,0) [boxy] {\one};
	\node(two) at (10,0) [boxy] {\two};
	\node at (5,2.45) {main.tex};
	\node at (0,-1) {part1.tex};
	\node at (10,-1) {part2.tex};
	\draw[->] (one) -- (main);
	\draw[->] (two) -- (main);
	\end{tikzpicture}

\end{document}
