\documentclass[a4paper,12pt]{article}
% \usepackage{graphicx}
\usepackage[top=2in,bottom=1in,left=1.25in,right=1.25in]{geometry}
\usepackage{color} 
\definecolor{darkblue}{rgb}{0,0,.5} 
\definecolor{darkred}{rgb}{.5,0,0} 
\definecolor{indigo}{RGB}{75,0,139}


\usepackage[pdftex,
colorlinks, % Schrift in Farbe, sonst mit Rahmen
bookmarksnumbered, % Inhaltsverzeichnis mit Numerierung
bookmarksopen, % offnet das Inhaltsverzeichnis
pdfstartview=FitH, % startet mit Seitenbreite
linkcolor=darkblue, % standard red
citecolor=darkred, % standard green
urlcolor=indigo, % standard cyan
filecolor=darkblue, %
pdftitle={Apvlv Manual},
pdfauthor={Alf, Sebastian},
pdfsubject={Alf's PDF Viewer Like Vim},
pdfcreator={vim & pdflatex},
pdfkeywords={open source software documentation},
pdfproducer={pdflatex},
plainpages=false % to avoid warning: pdfTeX warning (ext4): destination with the same identifier (name{page.1}) has been already used
]{hyperref}

% let's agree on a format how we display apvlv's name:
\newcommand{\apvlv}{\textsf{Apvlv{ }}}

\begin{document}

\large

\title{Apvlv - Alf's PDF Viewer Like Vim}
%\author{version 0.1.5}
\author{by Alf \texttt{$<$\href{mailto:naihe2010@126.com}{naihe2010@126.com}$>$}}
\date{\today}
%\date{Apvlv is open source and freely distributable}
\maketitle{}

\begin{center}
Current version: 0.1.4\\
\vspace{1cm}
\apvlv is open source software (GNU GPLv2) and freely distributable.
\vspace{1cm}

\rule{\textwidth}{1pt}
\begin{tabular}{lll}
type & :help info$<$Enter$>$      & for information \\
type & q                          & for exit \\
type & :help command$<$Enter$>$   & for help on a command \\
type & :help setting$<$Enter$>$   & for help on settings \\ % 
\end{tabular}
\rule{\textwidth}{1pt}

\vspace{3cm}
{\small Please visit \apvlv's homepage \texttt{\href{http://naihe2010.github.com/apvlv}{http://naihe2010.github.com/apvlv}} for more information, issues and help.}
\end{center}

\newpage

\section{Introduction}\label{intro}

\apvlv is open source software, and was created by Alf. It is in active development. Now, it is still growing.

As its name suggests, \apvlv allows you to read your PDF/\-DJVU/\-UMD/\-HTML/\-TXT files in Vim-style! A focus is set on simplicity and minimalistic GUI. This way you have more space for the actual document.

\apvlv's key bindings are inspired by the design and high efficiency of Vim commands making its use a joy for all accustomed Vim users. For example, one can use $<$Ctrl-f$>$ to forward page, $<$Ctrl-b$>$ to previous page, 'k','j','h','l' to scroll page up, down, left or right, and so on. 
Furthermore, \apvlv can understand how many times you want to run the command. E.g. typing '20' and  $<$Ctrl-f$>$ will go 20 pages forward.
The only thing you need to do is typing the number before the command. For example, typing '50' and $<$Ctrl-f$>$ will go 50 pages forward, typing '30' and $<$Ctrl-b$>$ will go 30 pages back.
Even more practical is \apvlv's ability to show the content of a directory (press 'O') on your system. You're then able to navigate through folders in Vim-style fashion. 'h' and 'l' collapse or expand a directory and pressing 't' will open the selected document in a new tab.
the table of contents upon pressing 't'. This allows you to navigate through the 

What's more important is that \apvlv supports view of a directory as content of pdf document. Pressing 'k' or 'j' to move selected up or down, 'h' or 'l' to collapse or expand a dir, and press 't' will open the selected document in a new tab.

This documentation introduces you to using \apvlv. Section \ref{gettingstarted} describes installation and invocation of \apvlv. Section \ref{command} summarizes the available commands and key bindings, section \ref{setting} describes the available configurations and section \ref{promtcommand} explains the command prompt (commands that start with ':').
%Do you like it? If yes, continue read the help document.


\newpage

\section{Getting Started}\label{gettingstarted}

\subsection{Installation of \apvlv}\label{sinstall}

\apvlv uses GNU Autotools as it's build system, you just need to type
\begin{verbatim}
# mkdir build
# cd build
# cmake ..
# make
# make install
\end{verbatim}
in a terminal to install it to \texttt{/usr/local}.

If you got error message like \texttt{No package 'poppler-glib'} found, then you might have to install the poppler library by yourself.

If you want to set custom settings before build \apvlv, use 
\begin{verbatim}
# ccmake ..
\end{verbatim}
instead of 
\begin{verbatim}
# cmake ..
\end{verbatim}.

By default, \apvlv does not support UMD/\-DJUV/\-HTML/\-TXT format. If you want apvlv can do this, you must set that options on when execute \texttt{ccmake ..} command.

\subsection{How to start the binary program}\label{sstart}

You can run \apvlv by typing '\texttt{apvlv}' in any terminal which is running under X. To open a specific pdf document, run '\texttt{apvlv $<$documentname$>$}'

If you get an error message like 'command not found', make sure the path in which \apvlv's binary is located is in your "PATH" environment variable. 
If not, run '\texttt{export PATH="/usr/local/bin:\$PATH"}' to append the path.

\newpage

\section{Command}\label{command}

\begin{description}

\item o

display a file chooser dialog to select a PDF/\-DJVU/\-UMD/\-HTML/\-TXT file to open.

\item O

select a directory to display. After you selected the directory within the dialog, press enter and \apvlv will recursively search the path for PDFs/DJVUs/UMD/HTML/TXTs. You will be presented with a vim-style navigation of your folders which allows you to easily access another document.

\item t

same as 'o', but display in a new tab

\item T

same as 'O', but display in a new tab

\item R

reload the current file.

\item r

[count] rotate the document page 

\item G

  go to end of document, or (preceded by [count]) show page [count]

\item gt

show next tab

\item gT

show previous tab

\item $<$PageDown$>$ or $<$C-f$>$

[count] go n page(s) forward

\item $<$PageUp$>$ or
$<$C-b$>$

[count] go n page(s) backward

\item $<$C-d$>$

[count] half page forward

\item $<$C-u$>$

[count] half previous page 

\item H

scroll to head of page

\item M

scroll to center of page

\item L

scroll to end of page

\item s

[count] skip

\item $<$C-p$>$
$<$Up$>$
k

[count] scroll up

\item  $<$C-n$>$ or 
 $<$Down$>$ or 
 $<$C-j$>$ or 
 j

[count] scroll down

\item $<$BackSpace$>$ or 
$<$Left$>$ or 
h

[count] scroll left

\item $<$Space$>$ or 
$<$C-l$>$ or 
l

[count] scroll right

\item /

search for a string. Type and hit $<$enter$>$.

\item ?

search for a string, backwards.

\item f

Toggle full screen mode. % If \apvlv is in full screen mode, switch to normal mode. Other wise, switch to full screen.

\item zi

zoom in.

\item zo

zoom out.

\item zw

zoom to fit width.

\item zh

zoom to fit height (full page).

\item m

Mark the read position and name it by pressing a character. \\
That is, press 'ma' will mark the current position to a, and you can return here by press 'a.

\item '

Goto the position indicated by a character, i.e. press 'a to go to the position a. \\
%The next key be pressed must had been marked before. 
The character has to be marked by 'm' before (see above).

\item ''

Return to the previous position

\item $<$C-w$>$ q
\item $<$C-w$>$ $<$C-Q$>$

Close the current tab (other tabs will not be affected)

\item $<$C-w$>$ $<$C-w$>$

move to the next window (currently broken).

\item $<$C-w$>$ k

move to the up window.

\item $<$C-w$>$ j

move to the down window.

\item $<$C-w$>$ h

move to the left window.

\item $<$C-w$>$ l

move to the right window.

\item $<$C-w$>$ -

make the current window smaller.

\item $<$C-w$>$ +

make the current window bigger.

\end{description}

\noindent All commands can be mapped to other keys. For example, if you put \\
'map $<$C-n$>$ o'\\
in your .apvlvrc. Then, typing $<$Ctrl-n$>$ will run the 'o' command, that is, show a file chooser dialog to select a PDF/DJVU/UMD/HTML/TXT file to open.\\
\noindent Be careful, do NOT map a command to itself! 'map god god' will make the application to loop test the command 'god' for ever.

\newpage

\section{Setting}\label{setting}

\apvlv supports settings set in a file called .apvlvrc.

\begin{description}

\item fullscreen=yes/no

If set yes, \apvlv will be in full screen mode after startup.

\item width=$<$int$>$

When fullscreen is not set to yes, this is the window width in pixels.

\item height=$<$int$>$

When fullscreen is not set to yes, this is the window height in pixels.

\item defaultdir=$<$path$>$

When display the file open dialog ('o'), this is the default directory.

\item zoom < normal | fitwidth | fitheight | =<value> >

Zoom settings can be set in four different modes, select one:
\begin{enumerate}

\item normal

the default zoom value will be set by the application itself.

\item fitwidth

zoom will be set to fit the page width to the window width.

\item fitheight
zoom will set to fit the page height to the window height.

\item custom

set a custom value e.g. zoom=1.0, zoom=1.2, zoom=0.8.

\end{enumerate}

\item content=yes/no

Set if use content view as first

\item continuous=yes/no

set a pdf page continuous or not. This value will be avoid when the autoscrollpage is set to no.

\item continuouspad=2

set a padding in the continuous view of page

\item autoscrollpage=yes/no

set whether auto scroll page when k,j to a page's tail or head

\item autoscrolldoc=yes/no

set if auto scroll doc from 1st page when goto the last page

\item noinfo=yes/no
set whether disable ~/.apvlvinfo

\item pdfcache=4
set pdf object cache size

\item visualmode=no
set not use visual mode to select and copy text or do

\item wrapscan=yes
set wrapscan to search text or not

\item doubleclick

This argument has 4 types.

\begin{enumerate}

\item none

Selection nothing

\item word

Selection a word under the curcor to clipboard

\item line

Selection a line under the curcor to clipboard

\item page

Selection a page under the curcor to clipboard

\item guioptions=< m | T >

Weather show menu and tool bar. m means menu bar, T means tool bar.

\item autoreload

If auto reload document after some seconds

\item reverted

If reverted pdf page

\end{enumerate}

\end{description}

\newpage

\section{Prompt Command}\label{promtcommand}

\begin{description}

\item :h[elp]

display the help pdf document.

\item :h[elp] info

display the help pdf document about the introduction.

\item :h[elp] command

display the help pdf document about the command.

\item :h[help] setting

display the help pdf document about the setting in the .apvlvrc

\item :h[elp] prompt

display the help pdf document about the prompt command.

\item :q[uit]

close the current window.\\
If the window is the top level window, quit the program.

\item o[pen] 'filename'

open a file which named 'filename'.

\item w[rite] 'filename'

save the current document to file which named 'filename'.

\item doc 'filename'

load the 'filename' to current window.

\item :TOtext

translate the current page to a text file.

\item :pr[int]

print the current document.

\item :TOtext 'filename'

translate page to a text file named 'filename'.

\item :tabnew

create a new tab

\item :sp

split the current window into two windows.

\item :vsp

split the current window into two horizon windows.

\item :fp

\item :forwardpage 

go forward some pages.

\item :bp

\item :prewardpage

go preward some page.

\item :g

\item :goto

go to a page.

\item :set [no]cache

set if use cache module. If you don't feel scroll slowly, you don't need set this to on.

\item :z[oom] fitwidth/fitheight/value

zoom to fit width, fit height or a custom value

\item :[number]

go to a page number

\end{description}

\newpage

\section{About}\label{about}

\large
\begin{tabular}{l}
  Website: \texttt{\href{http://naihe2010.github.com/apvlv}{http://naihe2010.github.com/apvlv}} \\
  Author: Alf \texttt{\href{mailto:naihe2010@126.com}{$<$naihe2010@126.com$>$}} \\
Blog: \texttt{\href{http://blog.sina.com.cn/naihe2010}{http://blog.sina.com.cn/naihe2010}} \\
Weibo: \texttt{\href{http://weibo.com/naihe2010}{naihe2010}}
\end{tabular}

\end{document}
