# How to align the top of the text with the top of a figure produced by tikz in minipage

How to align the top of the figure produced by tikz with the top of a text positioned next to it. Both the figure and the text are encapsulated by a minipage each. I just got an approximate but totally manual effect using \vspace at the end of theminipage that contains the figure.

\documentclass{article}
\usepackage{tikz, lipsum}
\begin{document}
\begin{minipage}{1\textwidth}
\fbox{
\begin{minipage}{0.8\textwidth}
%\hspace{.002in}
%\noindent
\textsf{\vspace{.3in}\\}
\setlength\parindent{5pt}
\begin{minipage}{.5\textwidth}
\textsf{\fontsize{10}{6}\selectfont \lipsum[1]}
\end{minipage}
\setlength\parindent{9pt}
\begin{minipage}{.5\textwidth}
\begin{tikzpicture}[scale=0.5]
\draw [help lines] (0,0) grid (8,17);
\end{tikzpicture}
\vspace{1.17in}
\end{minipage}
\end{minipage}
}
\end{minipage}
\end{document}


You can use a combination of adjustbox with the valign option and the TikZ baseline option. Also I think you're using too many minipages. I have stripped some of them off.

\documentclass{article}
\begin{document}

\fbox{%