% !TEX program = latexmk
\documentclass[openany, twoside, b5paper]{book}

\usepackage[b5paper]{geometry}
\usepackage{polski}
\usepackage[polish]{babel}
\brokenpenalty=1000
\clubpenalty=1000
\widowpenalty=1000

\usepackage{microtype} % Improves spacing
\usepackage{graphicx}
\graphicspath{ {../images/} }

\usepackage{fancyhdr}
\fancyhead{}
\fancyhead[L]{\textsf{\rightmark}} % Top left header
\fancyhead[R]{\textsf{\leftmark}} % Top right header
\renewcommand{\headrulewidth}{1.4pt} % Rule under the header
\fancyfoot{}
\fancyfoot[LO,RE]{\textbf{\textsf{\thepage}}} % Bottom center footer
\renewcommand{\footrulewidth}{1.4pt} % Rule under the footer
\pagestyle{fancy} % Use the custom headers and footers throughout the document

\usepackage{libertine}

\usepackage{titlesec}
\newcommand{\sectionbreak}{\clearpage}

\usepackage{multicol}
\usepackage{dictionary}
\usepackage{enumitem}
\usepackage{setspace}
\usepackage{booktabs}
\usepackage{hyperref}

\usepackage{leipzig}
\usepackage{gb4e}\noautomath
\usepackage{typgloss}

%\setcounter{secnumdepth}{2}
%\setcounter{tocdepth}{2}

\makeglossaries
\newleipzig{an}{an}{animated}
\newleipzig{nan}{nan}{non-animated}
\newleipzig{hort}{hort}{hortative}
\newleipzig{exh}{exh}{exhortative}
\newleipzig{chr}{chr}{cohortative}
\newleipzig{opt}{opt}{optative}
\newleipzig{for}{for}{formal}
\newleipzig{ven}{ven}{venitive}
\newleipzig{dim}{dim}{diminutive}
\newleipzig{ord}{ord}{ordinal numeral}
\newleipzig{supl}{supl}{superlative}

\begin{document}

\author{Koolder mal Erlehirni}
\title{Mały słownik androyasańsko-polski}

\frontmatter

\begin{titlepage} % Suppresses displaying the page number on the title page and the subsequent page counts as page 1
    \newcommand*{\plogo}{\fbox{$\mathcal{AND}$}} % Generic dummy publisher logo
    
	\raggedleft % Right align the title page
	
	\rule{1pt}{\textheight} % Vertical line
	\hspace{0.05\textwidth} % Whitespace between the vertical line and title page text
	\parbox[b]{0.75\textwidth}{ % Paragraph box for holding the title page text, adjust the width to move the title page left or right on the page
		
        {\Huge\bfseries Mały słownik\\ androyasańsko-polski}
        {\large\textit{Oraz polsko-androyasański}}\\[4\baselineskip]
		{\Large\textsc{koolder mal erlehirni}} % Author name, lower case for consistent small caps
        
        \bigskip

        \includegraphics[width=2cm]{androyas-flag}
        \includegraphics[width=2cm]{pl-flag}

        \vspace{0.5\textheight} % Whitespace between the title block and the publisher        
		
		{\noindent Royal Androyas Publishing~~\plogo}\\[\baselineskip] % Publisher and logo
	}

\end{titlepage}

\clearpage
\input{colophon.tex}

\tableofcontents

\mainmatter
\chapter{Wprowadzenie}
\input{introduction.tex}
\input{history.tex}
\input{description.tex}

\chapter{Słownik androyasańsko-polski}
\input{ap.tex}

\chapter{Słownik polsko-androyasański}
\input{pa.tex}

\chapter{Dodatkowe przykłady tłumaczeń}
\input{examples.tex}

\backmatter
% bibliography, glossary and index would go here.

\end{document}