\documentclass[a4paper,oneside]{book} %\documentclass{book} %\usepackage{fontspec} %\setmainfont{DejaVu Sans} %\setmonofont{DejaVu Sans Mono} \usepackage{polyglossia} \ifdefined\ENGLISH \setmainfont[Ligatures=TeX]{CMU Serif} %\setmainfont[Ligatures=TeX]{DejaVu Serif} \newcommand{\MonoFontMain}{CMU Typewriter Text} \newcommand{\MonoFontForBoxChars}{DejaVu Sans Mono} \setmonofont{\MonoFontMain} \setmainlanguage{english} %\setotherlanguage{russian} \fi \ifdefined\RUSSIAN \setmainfont[Ligatures=TeX]{CMU Serif} \newfontfamily{\cyrillicfonttt}{CMU Typewriter Text} \setmainlanguage{russian} \setotherlanguage{english} %\newfontfamily{\cyrillicfonttt}{DejaVu Sans Mono} \fi \usepackage{cmap} %\usepackage[russian,english]{babel} %\usepackage[T2A]{fontenc} %\usepackage[default]{sourcesanspro} \usepackage{amsmath, amssymb, graphics, setspace} \usepackage{MnSymbol} \undef\mathdollar \usepackage[table]{xcolor}% http://ctan.org/pkg/xcolor \usepackage{listings} \usepackage{longtable} \usepackage{pmboxdraw} \usepackage{url} %\usepackage[cm]{fullpage} % https://ctan.org/pkg/fullpage this makes small margins! \usepackage{graphicx} \usepackage{framed} \usepackage{color} \usepackage{float} \usepackage{tikz} \usepackage{shorttoc} \usepackage[footnote,printonlyused,withpage]{acronym} \usetikzlibrary{arrows,shapes,positioning} \usepackage[nottoc]{tocbibind} %\usepackage{esint} %\usepackage{charter} %\usepackage[charter]{mathdesign} \usepackage[]{hyperref} % should be last \usepackage{epigraph} \usepackage{subcaption} \usepackage{fancyhdr} \usepackage{pdfpages} \usepackage{svg} % fancyhdr ============================================================================================================================= \pagestyle{fancy} \setlength{\headheight}{13pt} % https://tex.stackexchange.com/questions/10043/page-number-position \fancyhf{} \fancyhead[R]{\thepage} % suppress chapter name, add page number (upper right corner) \ifdefined\ENGLISH \cfoot{\small If you enjoy the material on this page, found it interesting/useful, please \href{https://yurichev.com/tmp/stat.txt?book=SSBE&date=\today&page=\thepage}{click here}. I need this for statistics and feedback. If you noticed a typo/bug/error or have any suggestions, do not hesitate to drop me a note: \href{https://yurichev.com/contact.html}{my emails}. Thanks in advance!\normalsize} % https://tex.stackexchange.com/questions/13406/how-to-add-a-horizontal-line-above-the-footer-with-fancyhdr \renewcommand{\footrulewidth}{0.4pt} \fi % ====================================================================================================================================== \definecolor{lstbgcolor}{rgb}{0.94,0.94,0.94} \definecolor{light-gray}{gray}{0.87} \newcommand{\TT}[1]{\texttt{#1}} %\newcommand*{\TT}[1]{\colorbox{light-gray}{\texttt{#1}}} \EN{\newcommand{\TITLE}{SAT/SMT by Example}} \RU{\newcommand{\TITLE}{SAT/SMT в примерах}} \EN{\newcommand{\AUTHOR}{Dennis Yurichev}} \RU{\newcommand{\AUTHOR}{Денис Юричев}} \definecolor{linkcolor}{RGB}{10,0,190} \hypersetup{ pdftex, colorlinks=true, allcolors=linkcolor, %allcolors=darkblue, pdfauthor={\AUTHOR}, pdftitle={\TITLE}, pdfpagemode=None } \lstset{ %backgroundcolor=\color{lstbgcolor}, %backgroundcolor=\color{light-gray}, %basicstyle=\ttfamily\small, basicstyle=\ttfamily\normalsize, % and this is OK, don't change. see PDF in 100% in Okular %basicstyle=\ttfamily\large, %basicstyle=\ttfamily\footnotesize, literate={~} {$\sim$}{1}, breaklines=true, prebreak=\raisebox{0ex}[0ex][0ex]{\ensuremath{\rhookswarrow}}, postbreak=\raisebox{0ex}[0ex][0ex]{\ensuremath{\rcurvearrowse\space}}, frame=single, %columns=fullflexible,keepspaces, columns=keepspaces, escapeinside=§§, inputencoding=utf8 } \definecolor{digits}{RGB}{0,0,0} \definecolor{colkw}{RGB}{0,0,0} %\definecolor{colstr}{RGB}{80,80,80} %\definecolor{colid}{RGB}{80,80,80} \definecolor{colstr}{RGB}{0,0,0} \definecolor{colid}{RGB}{0,0,0} \definecolor{colcomment}{RGB}{130,130,130} %\definecolor{colcomment}{RGB}{170,170,170} \definecolor{colbg}{RGB}{255,255,255} \lstdefinestyle{custompy}{ language=Python, showstringspaces=false, backgroundcolor=\color{colbg}, keywordstyle=\color{colkw}, commentstyle=\color{colcomment}, identifierstyle=\color{colid}, stringstyle=\color{colstr} } \lstdefinestyle{customc}{ language=C, showstringspaces=false, backgroundcolor=\color{colbg}, keywordstyle=\color{colkw}, commentstyle=\color{colcomment}, identifierstyle=\color{colid}, stringstyle=\color{colstr} } \lstdefinestyle{customsmt}{ morecomment=[l]{;}, showstringspaces=false, backgroundcolor=\color{colbg}, keywordstyle=\color{colkw}, commentstyle=\color{colcomment}, identifierstyle=\color{colid}, stringstyle=\color{colstr} } \lstdefinestyle{customsat}{ morecomment=[l]{c\ }, showstringspaces=false, backgroundcolor=\color{colbg}, keywordstyle=\color{colkw}, commentstyle=\color{colcomment}, identifierstyle=\color{colid}, stringstyle=\color{colstr} } % с fullflexible в русской версии "+-----+" выглядит длиннее! ХЗ, почему \newcommand{\myhrule}{\begin{center}\rule{0.5\textwidth}{.4pt}\end{center}} % http://tex.stackexchange.com/questions/32160/new-line-after-paragraph \newcommand{\myparagraph}[1]{\paragraph{#1}\mbox{}\\} \newcommand{\mysubparagraph}[1]{\subparagraph{#1}\mbox{}\\} \input{myheadings} \author{\AUTHOR} \title{\TITLE} \newcommand{\RepoURL}{https://smt.st/current_tree} \newcommand{\MKURL}{https://smt.st/MK85} \newcommand{\KRBook}{Brian W. Kernighan, Dennis M. Ritchie, \emph{The C Programming Language}, 2ed, (1988)} \newenvironment{my_quote}{% \begin{oframed}% \begin{quote}% \small}{\normalsize% \end{quote}% \end{oframed}} % https://tex.stackexchange.com/questions/20640/how-to-add-border-for-an-image % this is better than (too-thin) \frame{} \newcommand{\myfbox}[1]{\setlength{\fboxsep}{0pt}\setlength{\fboxrule}{1pt}\fbox{#1}} \begin{document} %\input{1st_page} \begin{titlepage} \input{cover} \end{titlepage} \maketitle \shorttoc{Abridged contents}{0} \tableofcontents \newcommand{\MathForProg}{Untitled collection of math notes\footnote{\url{https://xn--mxacd.xn--qxam/math-prog.pdf}}} \newcommand{\CURPATH}{NOTHING} % chapters: \input{parts} \input{acronyms} \end{document}