\PassOptionsToPackage{unicode}{hyperref}
\documentclass[paper=B5,DIV=calc,parskip=half]{scrartcl}
\usepackage{ifluatex}
\ifluatex
\usepackage{luatex85}
\fi

\usepackage{fontspec}
\setmainfont[Ligatures={TeX,Common}]{Charis SIL}
\setsansfont[Ligatures={TeX,Common}, Scale=MatchLowercase]{TeX Gyre Heros}
\setmonofont[Ligatures=,Scale=MatchLowercase]{DejaVu Sans Mono}

\usepackage{listings}
\usepackage{enumitem}
%\usepackage{enumitem-zref}
\usepackage{polyglossia}
\setmainlanguage[]{english}

\usepackage{uspace}
\usepackage[autostyle]{csquotes}

\author{Václav Haisman\texorpdfstring{%
    \\{\small\href{mailto:vhaisman+uspace@gmail.com?subject=[uspace]}{vhaisman@gmail.com}}}{}}
\date{\today}
\title{\texttt{uspace} user manual}
\subtitle{v0.05}

\usepackage{xcolor}
\usepackage{multicol}
\usepackage{microtype}
\usepackage{metalogo}
\usepackage{hologo}

\usepackage{bookmark}
\hypersetup{
  colorlinks,
  linkcolor={red!50!black},
  citecolor={blue!50!black},
  urlcolor={blue!80!black},
  breaklinks=true}
\urlstyle{same}  % don't use monospace font for urls
\usepackage{footnotehyper}
\makesavenoteenv{labeling}

\setlength{\emergencystretch}{3em}  % prevent overfull lines

\lstdefinestyle{myLatexStyle}{
  language=[LaTeX]{Tex},
  basicstyle=\ttfamily
}

\lstset{style=myLatexStyle}

\newcommand{\zwsp}{\textsc{zero width space}}
\newcommand{\nnbsp}{\textsc{narrow no-break space}}
\newcommand{\nbsp}{\textsc{non-breaking space}}
\newcommand{\shy}{\textsc{soft hyphen}}
\newcommand{\enquad}{\textsc{en quad}}
\newcommand{\enspaceC}{\textsc{en space}}
\newcommand{\emquad}{\textsc{em quad}}
\newcommand{\emspaceC}{\textsc{em space}}
\newcommand{\threePerEm}{\textsc{three-per-em space}}
\newcommand{\fourPerEm}{\textsc{four-per-em space}}
\newcommand{\sixPerEm}{\textsc{six-per-em space}}
\newcommand{\figuresp}{\textsc{figure space}}
\newcommand{\punctsp}{\textsc{punctuation space}}
\newcommand{\thinsp}{\textsc{thin space}}
\newcommand{\hairsp}{\textsc{hair space}}
\newcommand{\medmathsp}{\textsc{medium math space}}
\newcommand{\linesep}{\textsc{line separator}}
\newcommand{\nel}{\textsc{next line (nel)}}
\newcommand{\parasep}{\textsc{paragraph separator}}

\begin{document}
\begin{titlepage}
  \maketitle
\end{titlepage}

\tableofcontents

\section{Introduction}%
%
This \LaTeX{} package gives useful meaning to various Unicode space
characters so that they fulfill their intended function when used in \LaTeX{}
source. It uses \lstinline|\newunicodechar| macro to do it. Its source is
hosted on GitHub in
\texttt{\href{https://github.com/wilx/project-uspace}{wilx/project-uspace}}
repository.

Here is a list of the implemented characters
and their implementations:\nobreak%
\begin{labeling}[\quad]{\nnbsp{} (\texttt{U+202F})}
\item[\zwsp{} (\texttt{U+200B})] \lstinline|\hspace{0pt}|
\item[\nnbsp{} (\texttt{U+202F})] \lstinline|\leavevmode\,|
\item[\nbsp{\footnotemark[1]} (\texttt{U+00A0})] \lstinline|~|
\item[\shy{\footnotemark[1]} (\texttt{U+00AD})] \lstinline|\-|
\item[\emquad{\footnotemark[2]} (\texttt{U+2001})] \lstinline|\quad|
\item[\emspaceC{\footnotemark[2]} (\texttt{U+2003})] \lstinline|\quad|
\item[\enquad{\footnotemark[3]} (\texttt{U+2000})] \lstinline|\enskip|
\item[\enspaceC{\footnotemark[3]} (\texttt{U+2002})] \lstinline|\enskip|
\item[\threePerEm{} (\texttt{U+2004})] \lstinline|\hspace{0.33333em}|
\item[\fourPerEm{} (\texttt{U+2005})] \lstinline|\hspace{0.25em}|
\item[\sixPerEm{} (\texttt{U+2006})] \lstinline|\hspace{0.16667em}|
\item[\figuresp{} (\texttt{U+2007})] \lstinline|\leavevmode\hphantom{0}|
\item[\punctsp{} (\texttt{U+2008})] \lstinline|\hspace{\fontcharwd \font `\,}|
\item[\thinsp{} (\texttt{U+2009})] \lstinline|\leavevmode\allowbreak\,|
\item[\hairsp{} (\texttt{U+200A})] \lstinline|\hspace{0.08333em}|
\item[\medmathsp{} (\texttt{U+205F})] \lstinline|\hspace{0.22222em}|
\item[\linesep{} (\texttt{U+2028})] \lstinline|\newline|
\item[\nel{} (\texttt{U+0085})] \lstinline|\newline|
\item[\parasep{} (\texttt{U+2029})] \lstinline|\csname par\endcsname|
\end{labeling}
\footnotetext[1]{This already defined for \hologo{pdfLaTeX} because we use
  \lstinline|inputenc| with \lstinline|utf8| option when compiling with
  \hologo{pdfLaTeX}, therefore this is only defined for \LuaLaTeX{} and
  \XeLaTeX{}.}
\footnotetext[2]{According to Unicode, these two are canonically
  equivalent. See \url{http://unicode.org/notes/tn5/}
  for explanation of the term.}
\footnotetext[3]{These two are also canonically equivalent. See previous
  footnote.}


\section{History}%
%
This package would not be what it is without help and comments from people of
\href{http://chat.stackexchange.com/rooms/41/tex-latex-and-friends}{\TeX{},
  \LaTeX{} and Friends} StackExchange chat room and the
\href{http://tex.stackexchange.com/}{\TeX.SE} site itself.

\begin{description}[style=nextline, labelwidth=4.5em, leftmargin=!,
  labelindent=0em]
  \item[\texttt{v0.05}] Add implementation for \medmathsp{}.
  \item[\texttt{v0.04}] Add implementation for \linesep{}, \nel{}
    and \parasep{}.
  \item[\texttt{v0.03}] Change implementation for \punctsp{} and \thinsp{} to
    fix issues with line wrapping when using these characters.
  \item[\texttt{v0.02}] Round lengths to five digits after decimal
    point. List also Unicode code point values beside character names.
  \item[\texttt{v0.01}] First published version of this package.
\end{description}

\end{document}