\documentclass[DIV=13,%
               BCOR=0mm,%
               headinclude=false,%
               footinclude=false,open=any,%
               fontsize=10pt,%
               oneside,%
               paper=a5]%
               {scrbook}



\usepackage[noautomatic]{imakeidx}



\usepackage{microtype}
\usepackage{graphicx}
\usepackage{alltt}
\usepackage{verbatim}
\usepackage[shortlabels]{enumitem}
\usepackage{tabularx}
\usepackage[normalem]{ulem}
\def\hsout{\bgroup \ULdepth=-.55ex \ULset}
% https://tex.stackexchange.com/questions/22410/strikethrough-in-section-title
% Unclear if \protect \hsout is needed. Doesn't looks so
\DeclareRobustCommand{\sout}[1]{\texorpdfstring{\hsout{#1}}{#1}}
\usepackage{wrapfig}

% avoid breakage on multiple <br><br> and avoid the next [] to be eaten
\newcommand*{\forcelinebreak}{\strut\\*{}}

\newcommand*{\hairline}{%
  \bigskip%
  \noindent \hrulefill%
  \bigskip%
}

% reverse indentation for biblio and play

\newenvironment*{amusebiblio}{
  \leftskip=\parindent
  \parindent=-\parindent
  \smallskip
  \indent
}{\smallskip}

\newenvironment*{amuseplay}{
  \leftskip=\parindent
  \parindent=-\parindent
  \smallskip
  \indent
}{\smallskip}

\newcommand*{\Slash}{\slash\hspace{0pt}}


% http://tex.stackexchange.com/questions/3033/forcing-linebreaks-in-url
\PassOptionsToPackage{hyphens}{url}\usepackage[hyperfootnotes=false,hidelinks,breaklinks=true]{hyperref}
\usepackage{bookmark}

\usepackage{fontspec}
\usepackage{polyglossia}
\setmainlanguage{english}
\setmainfont{texgyrepagella-regular.otf}[Script=Latin,%
 Ligatures=TeX,%
 Path=/usr/share/texmf/fonts/opentype/public/tex-gyre/,%
 BoldFont=texgyrepagella-bold.otf,%
 BoldItalicFont=texgyrepagella-bolditalic.otf,%
 ItalicFont=texgyrepagella-italic.otf]
\setmonofont{cmuntt.ttf}[Script=Latin,%
 Ligatures=TeX,%
 Scale=MatchLowercase,%
 Path=/usr/share/fonts/truetype/cmu/,%
 BoldFont=cmuntb.ttf,%
 BoldItalicFont=cmuntx.ttf,%
 ItalicFont=cmunit.ttf]
\setsansfont{cmunss.ttf}[Script=Latin,%
 Ligatures=TeX,%
 Scale=MatchLowercase,%
 Path=/usr/share/fonts/truetype/cmu/,%
 BoldFont=cmunsx.ttf,%
 BoldItalicFont=cmunso.ttf,%
 ItalicFont=cmunsi.ttf]
\newfontfamily\englishfont{texgyrepagella-regular.otf}[Script=Latin,%
 Ligatures=TeX,%
 Path=/usr/share/texmf/fonts/opentype/public/tex-gyre/,%
 BoldFont=texgyrepagella-bold.otf,%
 BoldItalicFont=texgyrepagella-bolditalic.otf,%
 ItalicFont=texgyrepagella-italic.otf]



\renewcommand*{\partpagestyle}{empty}


% global style

\pagestyle{plain}




\usepackage{indentfirst}

% remove the numbering
\setcounter{secnumdepth}{-2}

% remove labels from the captions
\renewcommand*{\captionformat}{}
\renewcommand*{\figureformat}{}
\renewcommand*{\tableformat}{}
\KOMAoption{captions}{belowfigure,nooneline}
\addtokomafont{caption}{\centering}







\deffootnote[3em]{0em}{4em}{\textsuperscript{\thefootnotemark}~}


\addtokomafont{disposition}{\rmfamily}
\addtokomafont{descriptionlabel}{\rmfamily}


\frenchspacing
% avoid vertical glue
\raggedbottom

% this will generate overfull boxes, so we need to set a tolerance
% \pretolerance=1000
% pretolerance is what is accepted for a paragraph without
% hyphenation, so it makes sense to be strict here and let the user
% accept tweak the tolerance instead.
\tolerance=200
% Additional tolerance for bad paragraphs only
\setlength{\emergencystretch}{30pt}

% (try to) forbid widows/orphans
\clubpenalty=10000
\widowpenalty=10000





% given that we said footinclude=false, this should be safe
\setlength{\footskip}{2\baselineskip}

\title{Offline tools}
\date{}
\author{}
\subtitle{}




% https://groups.google.com/d/topic/comp.text.tex/6fYmcVMbSbQ/discussion
\hypersetup{%
pdfencoding=auto,
pdftitle={Offline tools},%
pdfauthor={},%
pdfsubject={},%
pdfkeywords={howto; doc}%
}


\begin{document}






  \begin{titlepage}


  \strut\vskip 2em
  \begin{center}

  {\usekomafont{title}{\huge Offline tools\par}}%
  \vskip 1em
  
  \vskip 2em
  
  \vskip 1.5em



   
   \vfill



  
    \strut\par
  


  \end{center}


     \end{titlepage}
     
     \cleardoublepage



\tableofcontents
% start a new right-handed page

\cleardoublepage




Amusewiki stores its files in a plain text lightweight format called
Emacs Muse (actually a dialect of it) and described in depth in the
\href{https://amusewiki.org/library/manual}{manual}. Such files are
always listed in the infobox with the downloads and are labelled as
“plain text source” and have a \texttt{.muse} extension. The same file is
also bundled in the \texttt{.zip}, which also gives you the eventual
attachments.


The format is not couple with the web application, and you can produce
PDF, EPUB, HTML files from Muse files locally.

\chapter{Installation}


The tools are written in Perl. Every GNU\Slash{}Linux operating system comes
with Perl installed. They are supposed to work on Mac and Windows too,
but you have to find your way to get Perl installed (together with a
way to install modules from CPAN, the repository of Perl code, usually
the program called \texttt{App::cpanminus}, which is invoked with the command
\texttt{cpanm}).


Also, if you want (and you probably want) to produce PDF, you need the
installation of a recent \href{http://tug.org/texlive/}{TeX Live distribution}.

\section{Debian and Ubuntu}


The parser, the compiler and the preprocessor are packaged for Debian.
So you could do:


\begin{alltt}
\# add the key
wget -O - https://packages.amusewiki.org/amusewiki.gpg.key \textbar{} apt-key add -
\# add a source list entry
echo 'deb http://packages.amusewiki.org/debian jessie main' > /etc/apt/sources.list.d/amusewiki.list
\# install the tools
apt-get install libtext-amuse-perl libtext-amuse-preprocessor-perl libtext-amuse-compile-perl
\end{alltt}


TeX Live will be pulled in as dependency.

\section{Manually}


Install TeX Live following the instructions in the
\href{http://tug.org/texlive/}{TeX Live homepage}.


Install the Perl modules from CPAN:


\begin{alltt}
cpanm Text::Amuse::Compile Text::Amuse::Preprocessor
\end{alltt}

\chapter{Usage}


One way or another, you should have the executable files
\texttt{muse-compile.pl} and \texttt{muse-preprocessor.pl} installed.


\begin{alltt}
which muse-preprocessor.pl                                                                     │
\# /usr/bin/muse-preprocessor.pl
which muse-compile.pl
\# /usr/bin/muse-compile.pl
\end{alltt}


Typical usage:


\begin{alltt}
\# download the manual to use as sample. Please note the .zip
\# extension, so we get the attachments as well.
wget https://amusewiki.org/library/manual.zip
unzip manual.zip
cd manual
muse-compile.pl --help --verbose
muse-compile.pl --html --epub --pdf manual.muse
\end{alltt}


This command will produce HTML, EPUB and PDF files.


See \texttt{muse-compile.pl --help --verbose} for the full list.


The preprocessor is used if you need to cleanup your document. It has
the same options present in the editing amusewiki page.


\begin{alltt}
muse-preprocessor.pl --help
muse-preprocessor.pl --inplace --show-nbsp --typography \textbackslash{}
                     --links --footnotes manual.muse
\end{alltt}


See also \href{https://amusewiki.org/library/working-with-footnotes}{Working with footnotes}
for an in-depth explanation of the \texttt{--footnotes} switch.


The preprocessor can also convert HTML pages to muse.


\begin{alltt}
html-to-muse.pl https://packages.amusewiki.org/
\end{alltt}


See also \href{https://pandoc.org/}{Pandoc} for the same functionality.
Additionally, with Pandoc you can import\Slash{}export Muse files from and to
a very wide range of formats.







% begin final page

\clearpage



% new page for the colophon

\thispagestyle{empty}

\begin{center}





\bigskip
\includegraphics[width=0.25\textwidth]{logo-amw.pdf}
\bigskip

\end{center}

\strut

\vfill

\begin{center}




Offline tools






\bigskip



   

       

       

       

       

       
   



\bigskip
\textbf{amusewiki.org}


\end{center}

% end final page with colophon


\end{document}


% No format ID passed.



