Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- snippet inithw "Homework preamble"
- % --------------------------------------------------------------
- % This is all preamble stuff that you don't have to worry about.
- % Head down to where it says "Start here"
- % --------------------------------------------------------------
- \documentclass[12pt]{article}
- %Russian-specific packages
- %--------------------------------------
- \usepackage[T2A]{fontenc}
- \usepackage[utf8]{inputenc}
- \usepackage[russian]{babel}
- %--------------------------------------
- \usepackage[margin=1in]{geometry}
- \usepackage{amsmath,amsthm,amssymb}
- \newcommand{\N}{\mathbb{N}}
- \newcommand{\Z}{\mathbb{Z}}
- \newcommand{\R}{\mathbb{R}}
- \newenvironment{theorem}[2][Теорема]{\begin{trivlist}
- \item[\hskip \labelsep {\bfseries #1}\hskip \labelsep {\bfseries #2.}]}{\end{trivlist}}
- \newenvironment{lemma}[2][Лемма]{\begin{trivlist}
- \item[\hskip \labelsep {\bfseries #1}\hskip \labelsep {\bfseries #2.}]}{\end{trivlist}}
- \newenvironment{exercise}[2][Упражнение]{\begin{trivlist}
- \item[\hskip \labelsep {\bfseries #1}\hskip \labelsep {\bfseries #2.}]}{\end{trivlist}}
- \newenvironment{problem}[2][Задача]{\begin{trivlist}
- \item[\hskip \labelsep {\bfseries #1}\hskip \labelsep {\bfseries #2.}]}{\end{trivlist}}
- \newenvironment{statement}[2][Утв.]{\begin{trivlist}
- \item[\hskip \labelsep {\bfseries #1}\hskip \labelsep {\bfseries #2.}]}{\end{trivlist}}
- \newenvironment{corollary}[2][Следствие]{\begin{trivlist}
- \item[\hskip \labelsep {\bfseries #1}\hskip \labelsep {\bfseries #2.}]}{\end{trivlist}}
- \newenvironment{solution}{\begin{proof}[Решение]}{\end{proof}}
- \begin{document}
- % --------------------------------------------------------------
- % Start here
- % --------------------------------------------------------------
- \title{$1}
- \author{Шишацкий Михаил, 932}
- \date{date$2}
- \maketitle
- $0
- % --------------------------------------------------------------
- % You don't have to mess with anything below this line.
- % --------------------------------------------------------------
- \end{document}
- endsnippet
- snippet today "Date"
- `date +%F`
- endsnippet
- snippet box "Box"
- `!p snip.rv = '┌' + '─' * (len(t[1]) + 2) + '┐'`
- │ $1 │
- `!p snip.rv = '└' + '─' * (len(t[1]) + 2) + '┘'`
- $0
- endsnippet
- snippet beg "begin{} / end{}" bA
- \begin{$1}$2
- $0
- \end{$1}
- endsnippet
- snippet mk "Math" wA
- $${1}$`!p
- if t[2] and t[2][0] not in [',', '.', '?', '-', ' ']:
- snip.rv = ' '
- else:
- snip.rv = ''
- `$2
- endsnippet
- snippet dm "Math" wA
- \[
- $1
- .\] $0
- endsnippet
- snippet '([A-Za-z])(\d)' "auto subscript" wrA
- `!p snip.rv = match.group(1)`_`!p snip.rv = match.group(2)`
- endsnippet
- snippet '([A-Za-z])_(\d\d)' "auto subscript2" wrA
- `!p snip.rv = match.group(1)`_{`!p snip.rv = match.group(2)`}
- endsnippet
- snippet sr "^2" iA
- ^2
- endsnippet
- snippet cb "^3" iA
- ^3
- endsnippet
- snippet compl "complement" iA
- ^{c}
- endsnippet
- snippet td "superscript" iA
- ^{$1}$0
- endsnippet
- snippet // "Fraction" iA
- \\frac{$1}{$2}$0
- endsnippet
- snippet '((\d+)|(\d*)(\\)?([A-Za-z]+)((\^|_)(\{\d+\}|\d))*)/' "Fraction" wrA
- \\frac{`!p snip.rv = match.group(1)`}{$1}$0
- endsnippet
- priority 1000
- snippet '^.*\)/' "() Fraction" wrA
- `!p
- stripped = match.string[:-1]
- depth = 0
- i = len(stripped) - 1
- while True:
- if stripped[i] == ')': depth += 1
- if stripped[i] == '(': depth -= 1
- if depth == 0: break;
- i -= 1
- snip.rv = stripped[0:i] + "\\frac{" + stripped[i+1:-1] + "}"
- `{$1}$0
- endsnippet
- snippet / "Fraction" iA
- \\frac{${VISUAL}}{$1}$0
- endsnippet
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement