\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{Upstream bugs}
\date{}
\author{}
\subtitle{}




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


\begin{document}






  \begin{titlepage}


  \strut\vskip 2em
  \begin{center}

  {\usekomafont{title}{\huge Upstream bugs\par}}%
  \vskip 1em
  
  \vskip 2em
  
  \vskip 1.5em



   
   \vfill



  
    \strut\par
  


  \end{center}


     \end{titlepage}
     
     \cleardoublepage



\tableofcontents
% start a new right-handed page

\cleardoublepage




\textbf{This is a legacy page which only applies to older installations,
with a old TeXlive! installation}


\hairline


The current approach is to patch the files system-wide so on upgrade
these changes will be overwritten by versions shipped by Debian.


The long term plan is to repackage texlive in a minimal package, so we
can ship the latest versions.

\chapter{Russian: undefined \texttt{\textbackslash{}chapterformat}}


On Debian 10 (Buster), Russian documents are hitting this bug:
\href{https://github.com/reutenauer/polyglossia/issues/210}{\texttt{https://github.com/reutenauer/polyglossia/issues/210}}


\begin{alltt}
commit d2f383ee4b84bbed78a618fc1261f7fb3ccf9447
Author: Maksim Zholudev <maximzms@gmail.com>
Date:   Tue Aug 14 08:35:00 2018 +0300

    Fix Russian language for KOMA-Script classes without chapters

diff --git a/tex/gloss-russian.ldf b/tex/gloss-russian.ldf
index d2c86a3..5d207ff 100644
--- a/tex/gloss-russian.ldf
+++ b/tex/gloss-russian.ldf
@@ -170,7 +170,8 @@
 \% The following is based on some ideas from ruscor.sty
 \textbackslash{}def\textbackslash{}russian@capsformat\{\%
    \textbackslash{}ifdef\{\textbackslash{}KOMAScript\}\{\%
-      \textbackslash{}renewcommand\{\textbackslash{}chapterformat\}\{\textbackslash{}prechapter\textbackslash{}thechapter\textbackslash{}postchapter\}\%
+      \textbackslash{}ifdef\{\textbackslash{}chapterformat\}\{\%
+        \textbackslash{}renewcommand\{\textbackslash{}chapterformat\}\{\textbackslash{}prechapter\textbackslash{}thechapter\textbackslash{}postchapter\}\}\{\}\%
       \textbackslash{}renewcommand\{\textbackslash{}sectionformat\}\{\textbackslash{}presection\textbackslash{}thesection\textbackslash{}postsection\}\%
       \textbackslash{}renewcommand\{\textbackslash{}subsectionformat\}\{\textbackslash{}presubsection\textbackslash{}thesubsection\textbackslash{}postsubsection\}\%
       \textbackslash{}renewcommand\{\textbackslash{}subsubsectionformat\}\{\textbackslash{}presubsubsection\textbackslash{}thesubsubsection\textbackslash{}postsubsubsection\}\%
@@ -224,7 +225,8 @@

 \textbackslash{}def\textbackslash{}noextras@russian\{\%
    \textbackslash{}ifdef\{\textbackslash{}KOMAScript\}\{\%
-      \textbackslash{}renewcommand\{\textbackslash{}chapterformat\}\{\textbackslash{}thechapter\textbackslash{}autodot\textbackslash{}enskip\}\%
+      \textbackslash{}ifdef\{\textbackslash{}chapterformat\}\{\%
+        \textbackslash{}renewcommand\{\textbackslash{}chapterformat\}\{\textbackslash{}thechapter\textbackslash{}autodot\textbackslash{}enskip\}\}\{\}\%
       \textbackslash{}renewcommand\{\textbackslash{}sectionformat\}\{\textbackslash{}thesection\textbackslash{}autodot\textbackslash{}enskip\}\%
       \textbackslash{}renewcommand\{\textbackslash{}subsectionformat\}\{\textbackslash{}thesubsection\textbackslash{}autodot\textbackslash{}enskip\}\%
       \textbackslash{}renewcommand\{\textbackslash{}subsubsectionformat\}\{\textbackslash{}thesubsubsection\textbackslash{}autodot\textbackslash{}enskip\}\%
\end{alltt}


You need to patch \texttt{gloss-russian.ldf} file. Save the patch in, e.g.
\texttt{russian.patch} and then as root execute:


\begin{alltt}
patch -p1 /usr/share/texlive/texmf-dist/tex/latex/polyglossia/gloss-russian.ldf russian.patch
\end{alltt}

\chapter{French: missing spacing after punctuation}


The polyglossia package shipped with Debian 9 (Stretch) is hit by this bug: \href{https://tex.stackexchange.com/questions/330844/prevent-line-break-before/330848\#330848}{tex.stackexchange.com} (missing no-break spaces in French punctuation).


You can work around it in two ways:


\begin{itemize}
\item\relax 
Use LuaTeX instead of XeTeX (root users have access to the switch in the admin).



\item\relax 
Patch polyglossia (see below).




\end{itemize}
\section{Patching polyglossia}


\begin{alltt}
--- /usr/share/texlive/texmf-dist/tex/latex/polyglossia/gloss-french.ldf        2016-03-25 23:06:03.000000000 +0100
+++ texmf/tex/latex/polyglossia/gloss-french.ldf        2018-10-14 09:45:47.171843623 +0200
@@ -54,6 +54,13 @@
       \textbackslash{}XeTeXinterchartoks \textbackslash{}french@punctguillend \textbackslash{}french@punctthin = \{\textbackslash{}nobreak\textbackslash{}thinspace\}\% "»;" -> "» ;"
       \textbackslash{}XeTeXinterchartoks \textbackslash{}french@punctguillend \textbackslash{}french@punctthick = \{\textbackslash{}nobreakspace\}\% "»:" -> "» :"
       \textbackslash{}XeTeXinterchartoks \textbackslash{}french@punctthin \textbackslash{}french@punctguillend  = \{\textbackslash{}nobreakspace\}\% "?»" -> "? »"
+
+      \% see https://tex.stackexchange.com/questions/330844/prevent-line-break-before/330848\#330848
+      \textbackslash{}XeTeXinterchartoks 4095 \textbackslash{}french@punctthin = \{\textbackslash{}xpg@unskip\textbackslash{}nobreak\textbackslash{}thinspace\}\%
+      \textbackslash{}XeTeXinterchartoks 4095 \textbackslash{}french@punctthick = \{\textbackslash{}xpg@unskip\textbackslash{}nobreakspace\}\%
+      \textbackslash{}XeTeXinterchartoks 4095 \textbackslash{}french@punctguillend = \{\textbackslash{}xpg@unskip\textbackslash{}nobreakspace\}\% "  »" -> "\textasciitilde{}»"
+      \textbackslash{}XeTeXinterchartoks \textbackslash{}french@punctguillstart 4095 = \{\textbackslash{}nobreakspace\textbackslash{}xpg@nospace\}\% "«  " -> "«\textasciitilde{}"
+
     \textbackslash{}fi
     \}
\end{alltt}


Save the patch in a file, e.g. \texttt{french.patch} and then as root execute:


\begin{alltt}
patch -p1 /usr/share/texlive/texmf-dist/tex/latex/polyglossia/gloss-french.ldf french.patch
\end{alltt}







% 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}




Upstream bugs






\bigskip



   

       

       

       

       

       
   



\bigskip
\textbf{amusewiki.org}


\end{center}

% end final page with colophon


\end{document}


% No format ID passed.



