%; whizzy  -pdf  llpp

% Note that the above line is not active if you have a file whizzy.sh
% Unless you set whizzy-configuration-path to nil or a string

\documentclass{article}

%% \PassOptionsToPackage{pdftex}{hyperref}
\RequirePackage{hyperref}
\providecommand {\WhizzyTeX}{\textsc{WhizzyTeX}}


\begin{document}

\begin{abstract}
This example is used to illustrate, test and expalin how to run {\WhizzyTeX}
with the Okular pdf previewer. 
\end{abstract}

\tableofcontents

\section{Quick tips}

This has been tested under linux with Ubuntu \verb"12.04"
and \verb"textlive 2009".

\subsection{Okular Configuration}


In \verb"Settings", choose \verb"Configure Okular..."  and \verb"Editor".
Then select \verb"Custom Text Editor" and fill in the following line:
\begin{verbatim}
        echo '#position %l, %c %f'
\end{verbatim}
Use \texttt{shift left click} to move to the source file.
\begin{quote}\small
This will echo a command in the \verb"*whizzytex*" emacs buffer of the form
\begin{verbatim}
        #position 26, 0 main.tex
\end{verbatim}
that is interpreted by emacs to move the edited file to the right position.
(Here 26 and 0 are the line and character offset positions in the source
file, while \verb"main.tex" is the name of the source file.
\end{quote}
You can click on the source file anywhere, which should move to the 
correct line in the source file.

You should also choose the "Fit Page" option and turn off "Continuous" 
option to avoid \texttt{Okular} blinking at each reaload.

\subsection{Whizzytex configuration}

To activate this mode, you must tell whizzytex to run in \texttt{kpdf} mode,
for instance by inserting the following line among the first lines of your
buffer 
\begin{verbatim}
        %; whizzy  -kpdf kpdf
\end{verbatim}
{\WhizzyTeX} will then call Okular as a previewer and the appropriate 
commands to run \verb"pdflatex" with \verb"synctex=1"
and to reload slices.

\subsection{Editing in emacs}

Okular does not allow
You can switch bewteen slice and master in emacs with the 
\verb"\C-c \C-w" keystrokes. 


\section {Sandbox}

This sections is a sandbox for you to try editing and nivigatiing in the
document. 
 
\subsection {Sub}

Some text in a subsection.
You may jump in another subsection on another page by selecting this
\hyperlink{next}{link}.

\newpage

\subsubsection {SubSub} 

This subsection appearson another page \hypertarget{next}{link} 
Move cursor to check that \emph{pages follow the cursor}.

\subsection {Your sandbox}

\setbox0 \hbox \bgroup

\begin{minipage}{0.8\linewidth}
This is you sandbox: it is a text arear to try typing in. It easily previews
when the mode is "Fit Page".. However, for some reason, okular sometime
jumps back to "Fit Width"....

\medskip

You may freely override this text and see if the cursor follows your
edition. 
\end{minipage}

\egroup
\bigskip
\centerline{\fbox{\box0}}
\bigskip

\subsection {Another section}

with no text

\vfill

\subsection {An a section at the bottom of the page}

A few lines of text here. 

To see the bottom of the page

\newpage
This section expand on several pages, you can move betwen pages in the
source, click, etc.


The cursor should follow on other pages as well.  This requires loading the
package hyperref, which is done automatically in pdf mode (if after loading
the package \texttt{ifpdf}, the command \verb"\ifpdf" is true).


\newcommand{\PAGE}[1][this text]{
\newpage 
 \section*{Foo}

This page will be display twice in exacly the same way---except the
page and section numbers and  \textbf{#1}. 

\subsection* {Bar}

This is filling the page with some text.

\subsection*{Gnus}

This is to see whether the effect of displaying similar pages, 
which gives an idea of the best possible effect when reloading the document
}

\PAGE
\PAGE[that text]
\PAGE[that tex]
\PAGE[that t]
\PAGE[that]
\PAGE[that's]
\PAGE[that's a]
\PAGE[that's al]
\PAGE[that's all]


\end{document}   

