# vertical arrow with variable length

I wish to have a vertical arrows from the top of the page to the text, with the length of the arrow adjusted automaticall (like vertical fill).

• If the answer below solved your problem, please mark it as 'accepted'. – Sean Allred Aug 2 '15 at 3:17

You can use TikZ:

\documentclass{article}
\usepackage[a6paper]{geometry}
\usepackage{tikz}
\usepackage{lipsum}

\newcounter{myarr}
\newcommand\VArrow[1][]{%
\stepcounter{myarr}%
\begin{tikzpicture}[remember picture, overlay]
\coordinate (\themyarr);
\draw[red,thick,->,#1] (\themyarr|-current page.north) -- (\themyarr);
\end{tikzpicture}
}
\begin{document}

Some test text\VArrow and some more text goes here
\lipsum[2]
And now some more text to draw another arrow.\VArrow[blue,ultra thick,-latex]

\end{document}


The optional argument for \VArrow allows to pass options to the \draw command internally used to draw the arrow.

Since some calculations are internally performed. two or three runs are necessary for the code to stabilize.