-
-
Save nptit/424a2829cee8925c891c39b51aa9da28 to your computer and use it in GitHub Desktop.
LaTeX-шаблон для генерации контрольных работ
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
\documentclass[ | |
10pt, | |
twocolumn, | |
landscape, | |
a4paper | |
]{extarticle} | |
\usepackage[ | |
landscape, | |
a4paper, | |
left = 10mm, | |
right = 10mm, | |
top = 5mm, | |
bottom = 5mm, | |
bindingoffset = 0cm, | |
columnsep = 1cm | |
]{geometry} % Пакет для удобного задания размеров страницы, полей и т.д. | |
\usepackage{amsmath,amssymb,amsthm} % Стандартные пакеты математической типографики | |
\usepackage{nopageno} % Не отображаем номера страниц — в вариантах они не нужны | |
\usepackage{indentfirst} % Нормальный отступ у первых строк в разделах | |
\usepackage[utf8]{inputenc} % если файл в другой кодировке, нужно не забыть поменять здесь | |
\usepackage[T2A]{fontenc} % это внутренняя кодировка, её менять незачем | |
\usepackage[russian]{babel} % Стандартный пакет для поддержки русского языка | |
\usepackage{ifthen,calc} % Эти два пакета нужны для генерации вариантов, без них ничего работать не будет | |
\newcounter{taskVariantToPrint} | |
\newcounter{currentTask} | |
\newcounter{currentTaskVariant} | |
\newcounter{currentVariant} | |
\newcommand{\getvariantmod}[1]{\value{currentVariant} - (\value{currentVariant} / #1) * #1} | |
\newcounter{primitiveToPrint} | |
\newcounter{currentPrimitive} | |
\newcommand{\p}[1]{\setcounter{currentPrimitive}{0}\setcounter{primitiveToPrint}{\getvariantmod{#1}}} | |
\renewcommand{\c}[1]{\ifthenelse{\equal{\value{primitiveToPrint}}{\value{currentPrimitive}}}{#1}{}\stepcounter{currentPrimitive}} | |
\newcounter{bpacounter} | |
\newcommand{\pagebreakafter}[1]{ | |
\setcounter{bpacounter}{ 1 + \value{currentVariant} - (\value{currentVariant} / #1) * #1} | |
\ifthenelse{\equal{\value{bpacounter}}{#1}}{\newpage}{} | |
} | |
\newenvironment{task}{ | |
\stepcounter{currentTask} | |
{\bf \noindent{$\arabic{currentTask}.$} }}{\smallskip} | |
\newenvironment{variant}{ | |
\setcounter{currentTask}{0} | |
\begin{samepage} | |
\centerline{\bf Вариант~\addtocounter{currentVariant}{1}\arabic{currentVariant}\addtocounter{currentVariant}{-1}.} | |
}{ | |
\end{samepage}\medskip | |
\stepcounter{currentVariant} | |
} | |
\newcommand{\greeting}{\noindent Пожалуйста, представьтесь: \underline{\hspace{8cm}}\bigskip} | |
\nofiles % просим ТеХ не генерировать лишние файлы типа .aux и других, так меньше мусора остаётся после компиляции | |
\begin{document} | |
\newcommand{\numberOfVariants}{40} % Сюда вписывается число вариантов, которые нужно нагенерировать | |
\whiledo{\value{currentVariant}<\numberOfVariants}{ | |
\input{variant} % Сюда вписывается имя файла, содержащего вариант с условиями | |
} | |
\end{document} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
\begin{variant} | |
\greeting % это приветствие можно убрать | |
\begin{task} | |
При каком слагаемом и в разложении какого выражения (например) возникнет коэффициент, равный $\p3\c{\frac{22!}{7!4!9!}}\c{\frac{20!}{7!8!3!}}\c{\frac{20!}{5!6!7!}}$? | |
\end{task} | |
\begin{task} | |
Укажите, есть ли ошибка (и если есть, то в чём она заключается) в следующей формуле: $\p4% | |
\c{\binom{n}{k}+\binom{n}{k+1}=\binom{n+1}{k}}% | |
\c{\overline{C}_n^k=C_{n-k+1}^k}% | |
\c{A_n^k=n(n-1)\cdot\ldots\cdot(n-k)}% | |
\c{|A\cap B|=|A|+|B|-|A\cup B|}% | |
$. | |
\end{task} | |
\begin{task} | |
Сравните числа: $\p2% | |
\c{\binom{1200}{900}}\c{\binom{1200}{50}},\,\binom{1200}{990}}$. | |
\end{task} | |
\pagebreakafter{4} % здесь указывается, сколько вариантов умещается на одной странице | |
\end{variant} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment