Add cross-page text referenced to text

I have \appendix in my document and I want to have referenced text throud pages for current section. For example:

-
Welcome to TeX.sx! Please tell use which class you are using, because this can affect \appendix. At best add a minimal working example (MWE) that illustrates your basic usage. -- I removed the xetex tag because your question is not XeTeX specific. –  Martin Scharrer May 3 '12 at 19:15
Thanks @MartinScharrer;) It's doesn't depends on \appendix, I can have such pages without it, I only just need functionality. –  Yaroslav Boichuk May 3 '12 at 19:19
Please consider being a bit more specific about what you need to accomplish. Are you maybe looking to place the name of the section -- "Some Appendix", for instance -- in the upper-right hand side of the running header of the page? If so, do check out the fancyhdr package and its capabilities. –  Mico May 3 '12 at 20:15

In principle you can add a text at the top of the next page(s) using \afterpage from the afterpage package. You should define a macro which \afterpage-s itself but is reset when you don't need it any longer.

Here some principle code:

\documentclass{report}

\usepackage{afterpage}
\usepackage{blindtext}

\begin{document}
\blinddocument

\appendix
\chapter{SOME APPENDIX}
\newcommand\mycontinue{\noindent\makebox[\linewidth][r]{\textbf{Continue SOME APPENDIX}}\afterpage{\mycontinue}}
\afterpage{\mycontinue}
\Blindtext \Blindtext \Blindtext
\Blindtext \Blindtext \Blindtext
\let\mycontinue\relax % disable text

\chapter{Other stuff}
other text \Blindtext

\end{document}

-
Thank You a lot, that's amazing, but there is issue. When I use \lstinputlisting it's create one blank page, and on other page is two of "Continue SOME APPENDIX". *****************code example******* \section*{SOME APPENDIX} \subsection*{some text} \lstinputlisting[language=Java]{code/Worker.java} –  Yaroslav Boichuk May 4 '12 at 6:14