# Draw to right margin using TikZ

I can draw up to the right edge of a page like this:

\tikz[remember picture,overlay]%
{%
\draw (0,0)--(0,0-|current page.east);%
}%


How can I do something similar, but draw only up until the right margin of the page? That is, the edge at which text is wrapped.

I thought perhaps there would be a current margin.east or something like that, but that doesn't appear to be the case.

• tikzpagenodes? – Symbol 1 Mar 1 '18 at 1:40
• Are you by chance looking for \draw (0,0)--(0,0-|current page text area.east)? – user121799 Mar 1 '18 at 3:43

\documentclass[]{article}

\usepackage{tikzpagenodes}

\begin{document}
\begin{tikzpicture}[remember picture,overlay]
\draw (0,0)--(0,0-|current page marginpar area.east);%
\end{tikzpicture}

\end{document}


• Thanks. TIL tikzpagenodes. It was current page text area that I was after. – Kent Boogaart Mar 1 '18 at 3:59