Обновление

This commit is contained in:
Andrei Astafev 2021-05-19 13:51:14 +03:00
parent ce1887a8df
commit 2c7dd2e3da

View File

@ -10,6 +10,9 @@ $if(latex-dir-rtl)$
\PassOptionsToPackage{RTLdocument}{bidi} \PassOptionsToPackage{RTLdocument}{bidi}
$endif$ $endif$
$endif$ $endif$
$if(CJKmainfont)$
\PassOptionsToPackage{space}{xeCJK}
$endif$
% %
\documentclass[ \documentclass[
$if(fontsize)$ $if(fontsize)$
@ -57,7 +60,6 @@ $endfor$
% Prevent slide breaks in the middle of a paragraph % Prevent slide breaks in the middle of a paragraph
\widowpenalties 1 10000 \widowpenalties 1 10000
\raggedbottom \raggedbottom
\usepackage[defaultlines=3,all]{nowidow}
$if(section-titles)$ $if(section-titles)$
\setbeamertemplate{part page}{ \setbeamertemplate{part page}{
\centering \centering
@ -169,6 +171,12 @@ $if(CJKmainfont)$
\fi \fi
$endif$ $endif$
\fi \fi
\setlength{\parindent}{12.5mm}
\usepackage[defaultlines=3,all]{nowidow}
\usepackage[nobottomtitles]{titlesec}
\renewcommand{\bottomtitlespace}{.15\textheight}
$if(beamer)$ $if(beamer)$
$if(theme)$ $if(theme)$
\usetheme[$for(themeoptions)$$themeoptions$$sep$,$endfor$]{$theme$} \usetheme[$for(themeoptions)$$themeoptions$$sep$,$endfor$]{$theme$}
@ -195,14 +203,15 @@ $endif$
\usepackage[$for(microtypeoptions)$$microtypeoptions$$sep$,$endfor$]{microtype} \usepackage[$for(microtypeoptions)$$microtypeoptions$$sep$,$endfor$]{microtype}
\UseMicrotypeSet[protrusion]{basicmath} % disable protrusion for tt fonts \UseMicrotypeSet[protrusion]{basicmath} % disable protrusion for tt fonts
}{} }{}
\usepackage{indentfirst}
$if(indent)$ $if(indent)$
$else$ $else$
\makeatletter \makeatletter
\@ifundefined{KOMAClassName}{% if non-KOMA class \@ifundefined{KOMAClassName}{% if non-KOMA class
\IfFileExists{parskip.sty}{% \IfFileExists{parskip.sty}{%
\usepackage{parskip} \usepackage{parskip}
}{% else }{% else%
\setlength{\parindent}{0pt} \setlength{\parindent}{12.5mm}
\setlength{\parskip}{6pt plus 2pt minus 1pt}} \setlength{\parskip}{6pt plus 2pt minus 1pt}}
}{% if KOMA class }{% if KOMA class
\KOMAoptions{parskip=half}} \KOMAoptions{parskip=half}}
@ -239,7 +248,7 @@ $endif$
} }
\urlstyle{same} % disable monospaced font for URLs \urlstyle{same} % disable monospaced font for URLs
$if(verbatim-in-note)$ $if(verbatim-in-note)$
\VerbatimFootnotes % allows verbatim text in footnotes \VerbatimFootnotes % allow verbatim text in footnotes
$endif$ $endif$
$if(geometry)$ $if(geometry)$
\usepackage[$for(geometry)$$geometry$$sep$,$endfor$]{geometry} \usepackage[$for(geometry)$$geometry$$sep$,$endfor$]{geometry}
@ -262,7 +271,11 @@ $if(highlighting-macros)$
$highlighting-macros$ $highlighting-macros$
$endif$ $endif$
$if(tables)$ $if(tables)$
\usepackage{longtable,booktabs} \usepackage{longtable,booktabs,array}
$if(multirow)$
\usepackage{multirow}
$endif$
\usepackage{calc} % for calculating minipage widths
$if(beamer)$ $if(beamer)$
\usepackage{caption} \usepackage{caption}
% Make caption package work with longtable % Make caption package work with longtable
@ -270,6 +283,11 @@ $if(beamer)$
\def\fnum@table{\tablename~\thetable} \def\fnum@table{\tablename~\thetable}
\makeatother \makeatother
$else$ $else$
% Correct order of tables after \paragraph or \subparagraph
\usepackage{etoolbox}
\makeatletter
\patchcmd\longtable{\par}{\if@noskipsec\mbox{}\fi\par}{}{}
\makeatother
% Allow footnotes in longtable head/foot % Allow footnotes in longtable head/foot
\IfFileExists{footnotehyper.sty}{\usepackage{footnotehyper}}{\usepackage{footnote}} \IfFileExists{footnotehyper.sty}{\usepackage{footnotehyper}}{\usepackage{footnote}}
\makesavenoteenv{longtable} \makesavenoteenv{longtable}
@ -357,6 +375,9 @@ $else$
\usepackage[shorthands=off,russian]{babel} \usepackage[shorthands=off,russian]{babel}
\fi \fi
$endif$ $endif$
\ifluatex
\usepackage{selnolig} % disable illegal ligatures
\fi
$if(dir)$ $if(dir)$
\ifxetex \ifxetex
% Load bidi as late as possible as it modifies e.g. graphicx % Load bidi as late as possible as it modifies e.g. graphicx
@ -380,6 +401,31 @@ $for(bibliography)$
\addbibresource{$bibliography$} \addbibresource{$bibliography$}
$endfor$ $endfor$
$endif$ $endif$
$if(csl-refs)$
\newlength{\cslhangindent}
\setlength{\cslhangindent}{1.5em}
\newlength{\csllabelwidth}
\setlength{\csllabelwidth}{3em}
\newenvironment{CSLReferences}[2] % #1 hanging-ident, #2 entry spacing
{% don't indent paragraphs
\setlength{\parindent}{0pt}
% turn on hanging indent if param 1 is 1
\ifodd #1 \everypar{\setlength{\hangindent}{\cslhangindent}}\ignorespaces\fi
% set entry spacing
\ifnum #2 > 0
\setlength{\parskip}{#2\baselineskip}
\fi
}%
{}
\usepackage{calc}
\newcommand{\CSLBlock}[1]{#1\hfill\break}
\newcommand{\CSLLeftMargin}[1]{\parbox[t]{\csllabelwidth}{#1}}
\newcommand{\CSLRightInline}[1]{\parbox[t]{\linewidth - \csllabelwidth}{#1}\break}
\newcommand{\CSLIndent}[1]{\hspace{\cslhangindent}#1}
$endif$
$if(csquotes)$
\usepackage{csquotes}
$endif$
$if(title)$ $if(title)$
\title{$title$$if(thanks)$\thanks{$thanks$}$endif$} \title{$title$$if(thanks)$\thanks{$thanks$}$endif$}
@ -412,6 +458,16 @@ $if(logo)$
$endif$ $endif$
$endif$ $endif$
\usepackage{float}
\let\origfigure=\figure
\let\endorigfigure=\endfigure
\renewenvironment{figure}[1][]{%
\origfigure[H]
\centering
}{%
\endorigfigure
}
\begin{document} \begin{document}
$if(has-frontmatter)$ $if(has-frontmatter)$
\frontmatter \frontmatter
@ -438,7 +494,7 @@ $if(toc-title)$
\renewcommand*\contentsname{$toc-title$} \renewcommand*\contentsname{$toc-title$}
$endif$ $endif$
$if(beamer)$ $if(beamer)$
\begin{frame} \begin{frame}[allowframebreaks]
$if(toc-title)$ $if(toc-title)$
\frametitle{$toc-title$} \frametitle{$toc-title$}
$endif$ $endif$