@@ -0,0 +1,425 @@
1+\NeedsTeXFormat{LaTeX2e}
2+
3+\ProvidesClass{TechDoc}
4+
5+\LoadClass[a4paper, 12pt]{article}
6+
7+\RequirePackage{geometry}
8+\RequirePackage{listings}
9+\RequirePackage{fancyhdr}
10+\RequirePackage{setspace}
11+\RequirePackage{titlesec}
12+\RequirePackage{graphicx}
13+\RequirePackage[T2A]{fontenc}
14+\RequirePackage[utf8]{inputenc}
15+\RequirePackage[unicode]{hyperref}
16+\RequirePackage{array}
17+\RequirePackage{color}
18+\RequirePackage{textcomp}
19+\RequirePackage{lastpage}
20+\RequirePackage{longtable}
21+\RequirePackage{multirow}
22+\RequirePackage{indentfirst}
23+\RequirePackage{enumitem}
24+\RequirePackage{tocloft}
25+\RequirePackage{caption}
26+
27+\setcounter{secnumdepth}{4}
28+
29+\titleformat{\paragraph}
30+{\normalfont\normalsize\bfseries}{\theparagraph}{0mm}{.~}
31+\titlespacing*{\paragraph}
32+{0pt}{3.25ex plus 1ex minus .2ex}{1.5ex plus .2ex}
33+
34+%% Languages
35+
36+\AddEnumerateCounter{\asbuk}{\@asbuk}{\cyrm}
37+\renewcommand{\theenumi}{(\asbuk{enumi})}
38+\renewcommand{\labelenumi}{\asbuk{enumi})}
39+
40+
41+\setenumerate[1]{label={\arabic*)}}
42+\setenumerate[2]{label={\asbuk*)}}
43+\setenumerate[3]{label={\roman*)}}
44+
45+
46+\DeclareUnicodeCharacter{306}{{\color{red} \textbf{По всей видимости либо ты откуда-то не очень хорошо скопировал, либо у тиебя с вводом что-то не то потому что буква Й у тебя состоит из двух скаляров юникода. Удали этот Й и напечатай его заново. (Выйди и зайди норимально)} }}
47+
48+\RequirePackage[main=russian,english]{babel}
49+
50+\titlelabel{\thetitle.~}
51+
52+\lstset{
53+ basicstyle=\small\ttfamily,
54+ tabsize=4,
55+ breaklines=true,
56+ columns=flexible
57+}
58+
59+\hypersetup{
60+ colorlinks,
61+ citecolor=black,
62+ filecolor=black,
63+ linkcolor=black,
64+ urlcolor=black,
65+ unicode=true
66+}
67+
68+\geometry{left=20mm, right=10mm, top=25mm, bottom=25mm, headheight=25mm}
69+
70+ %% Header
71+
72+\pagestyle{fancy}
73+\fancyhf{}
74+\fancyhead[C]{
75+\begin{tabular}{c}
76+ \thepage \\ \@documentCode
77+\end{tabular}
78+}
79+\renewcommand\headrulewidth{0pt}
80+
81+\cfoot{
82+\vspace{-7mm}
83+\footnotesize{
84+\begin{tabular}{|p{0.30\linewidth}|p{0.14\linewidth}|p{0.15\linewidth}|p{0.14\linewidth}|p{0.14\linewidth}|}
85+ \hline
86+ & & & & \\ \hline
87+ Изм. & Лист & \textnumero~докум. & Подп. & Дата\\
88+ \hline
89+ \footnotesize{\@documentCode}& & & &\\
90+ \hline
91+ Инв. \textnumero~подл. & Подп. и дата & Взам. инв. \textnumero & Инв. \textnumero~дубл.& Подп. и дата \\
92+ \hline
93+ \end{tabular}
94+}
95+}
96+
97+\setcounter{page}{2}
98+
99+%% TOC
100+
101+\tocloftpagestyle{fancy}
102+\renewcommand{\cftsecleader}{\cftdotfill{\cftdotsep}}
103+
104+\setcounter{tocdepth}{2}
105+
106+%% Title page
107+
108+\renewcommand{\@title}{\color{red}{TODO}}
109+\renewcommand{\title}[1]{
110+ \renewcommand{\@title}{#1}
111+}
112+
113+\newcommand{\@institute}{правительство российской федерации\\
114+ национальный исследовательский университет \\
115+ «высшая школа экономики»}
116+\newcommand{\institute}[1]{
117+ \renewcommand{\@institute}{#1}
118+}
119+
120+\newcommand{\@faculty}{Факультет компьютерных наук\\
121+ Департамент программной инженерии}
122+\newcommand{\faculty}[1]{
123+ \renewcommand{\@faculty}{#1}
124+}
125+
126+\newcommand{\@academicTeacherTitle}{{\color{red}{TODO}}}
127+\newcommand{\@academicTeacherName}{{\color{red}{TODO}}}
128+\newcommand{\academicTeacher}[2]{
129+ \renewcommand{\@academicTeacherTitle}{#1}
130+ \renewcommand{\@academicTeacherName}{#2}
131+}
132+
133+\newcommand{\@academicSupervisorName}{В. В. Шилов}
134+\newcommand{\@academicSupervisorTitle}{Академический руководитель образовательной программы «Программная инженерия»
135+ профессор департамента программной инженерии, канд. техн. наук}
136+\newcommand{\academicSupervisor}[2]{
137+ \renewcommand{\@academicSupervisorTitle}{#1}
138+ \renewcommand{\@academicSupervisorName}{#2}
139+}
140+
141+\newcommand{\@documentTitle}{{\color{red}{TODO}}}
142+\newcommand{\documentTitle}[1]{
143+ \renewcommand{\@documentTitle}{#1}
144+}
145+
146+\newcommand{\@documentCode}{{\color{red}{TODO}}}
147+\newcommand{\documentCode}[1]{
148+ \renewcommand{\@documentCode}{#1}
149+}
150+
151+\renewcommand{\@author}{{\color{red}{TODO}}}
152+\newcommand{\@authorTitle}{{\color{red}{TODO}}}
153+\renewcommand{\author}[2]{
154+ \renewcommand{\@authorTitle}{#1}
155+ \renewcommand{\@author}{#2}
156+}
157+
158+\newcommand{\@year}{2018}
159+\renewcommand{\year}[1]{
160+ \renewcommand{\@year}{#1}
161+}
162+
163+\newcommand{\@city}{Москва}
164+\newcommand{\city}[1]{
165+ \renewcommand{\@city}{#1}
166+}
167+
168+\newcommand{\@titleTable}{
169+\reversemarginpar\marginpar{\rotatebox{90}{\begin{tabular}{|l|l|l|l|l|}
170+ \hline
171+ Инв. \textnumero~подл & Подп. и дата & Взам. инв. \textnumero& Инв. \textnumero~дубл.&Подп. и дата\\
172+ \hline
173+ & & & & \\
174+ \hline
175+\end{tabular}}}
176+}
177+
178+\titleformat{\subsection}{\normalfont\large\bfseries\raggedright}{\thesubsection.~}{0mm}{}
179+\titleformat{\subsubsection}{\normalfont\normalsize\bfseries\raggedright}{\thesubsubsection.~}{0mm}{}
180+\titleformat{\paragraph}{\normalfont\normalsize\bfseries\raggedright}{\theparagraph.~}{0mm}{}
181+
182+\newcommand{\@startAdditions}{
183+ \setcounter{section}{0}
184+ \renewcommand{\sectionbreak}{}
185+ \titleformat{\section}[block]{\Large\bfseries\filcenter}{}{0mm}{}
186+ \renewcommand{\@startAdditions}{}
187+}
188+
189+\newcounter{@tempSection}
190+
191+\newcommand{\addition}[1]{%
192+ \clearpage
193+ \newpage
194+ \@startAdditions
195+ \stepcounter{section}
196+ \begin{flushright}
197+ \Large \textbf{\textsc{приложение \arabic{section}}}
198+ \end{flushright}
199+ \setcounter{@tempSection}{\arabic{section}}
200+ \setcounter{secnumdepth}{0}
201+ \section[Приложение \arabic{@tempSection}]{#1}
202+ \setcounter{secnumdepth}{4}
203+}
204+
205+\newcolumntype{P}[1]{>{\centering\arraybackslash}p{#1}}
206+
207+\newcommand{\@LU}{
208+ \begin{center}
209+ \textsc{\textbf{\@institute}}
210+ \par\vspace{5mm}
211+ \upshape\mdseries
212+ \@faculty
213+
214+ \par\vspace{10mm}
215+
216+ \begin{tabular}[h!]{P{0.45\textwidth} P{0.45\textwidth}}
217+
218+ \textit{СОГЛАСОВАНО} & \textsl{УТВЕРЖДАЮ}\\
219+ & \\
220+ \@academicTeacherTitle & \@academicSupervisorTitle \\
221+ & \\
222+ \underline{\hspace{4cm}} \@academicTeacherName & \underline{\hspace{4cm}} \@academicSupervisorName \\
223+ <<\underline{\hspace{1cm}}>> \underline{\hspace{3cm}} \@year{} г. & <<\underline{\hspace{1cm}}>> \underline{\hspace{3cm}} \@year{} г.\\
224+ \end{tabular}
225+
226+
227+ \vspace{15mm}
228+ {\LARGE{\textsc{\textbf{\MakeLowercase{\@title}}}}}
229+
230+ \vspace{6mm}
231+
232+ \textbf{\@documentTitle}
233+
234+ \vspace{6mm}
235+
236+ \textbf{\textsc{Лист Утверждения}}
237+
238+ \vspace{6mm}
239+
240+ \textbf{\@documentCode{}-ЛУ}
241+
242+ \end{center}
243+
244+
245+ \vfill
246+ \hfill
247+ \begin{tabular}{c}
248+ \\
249+ Исполнитель: \@authorTitle
250+ \\
251+ \underline{\hspace{4cm}} \@author
252+ \\
253+ <<\underline{\hspace{1cm}}>> \underline{\hspace{4cm}} \@year~г.
254+ \end{tabular}
255+
256+ \@titleTable
257+
258+ \vspace{30mm}
259+
260+ \begin{center}
261+ \@city~\@year
262+ \end{center}
263+
264+ \vspace{-20mm}
265+}
266+
267+\newcommand{\noLU}{
268+ \renewcommand{\@LU}{}
269+}
270+
271+\renewcommand{\maketitle}{
272+ \pagestyle{empty}
273+ \clearpage
274+
275+ \begin{titlepage}
276+
277+ \@LU
278+
279+ \newpage
280+
281+ \textbf{\textsc{Утверждён}}
282+
283+ \textbf{\@documentCode{}-ЛУ}
284+
285+ \vspace{40mm}
286+
287+ \begin{center}
288+ {\LARGE{\textsc{\textbf{\MakeLowercase{\@title}}}}}
289+
290+ \vspace{6mm}
291+
292+ \textbf{\@documentTitle}
293+
294+ \vspace{6mm}
295+
296+ \textbf{\@documentCode}
297+
298+ \vspace{6mm}
299+
300+ \textbf{Листов \pageref{LastPage}}
301+
302+ \end{center}
303+
304+ \vfill
305+
306+ \@titleTable
307+
308+ \vspace{80mm}
309+
310+ \begin{center}
311+ \@city~\@year
312+ \end{center}
313+
314+ \vspace{-20mm}
315+
316+ \end{titlepage}
317+
318+ \pagestyle{fancy}
319+
320+ \setcounter{page}{2}
321+}
322+
323+
324+\newcommand{\registrationList}{%
325+ \clearpage
326+ \newpage
327+
328+ \@startAdditions
329+
330+ \setcounter{secnumdepth}{0}
331+ \section{Лист регистрации изменений}
332+ \setcounter{secnumdepth}{4}
333+
334+ \begin{tabular}{|p{0.05\linewidth}|p{0.04\linewidth}|p{0.06\linewidth}|p{0.06\linewidth}|p{0.06\linewidth}|p{0.1\linewidth}|p{0.1\linewidth}|p{0.12\linewidth}|p{0.05\linewidth}|p{0.05\linewidth}|}
335+
336+ \hline
337+ \multirow{2}{*}{Изм.} & \multicolumn{4}{c|}{Номера листов} & Всего листов в документе & \textnumero{} доку-мента & Входящий \textnumero{} сопрово-дит.~докум. и дата & Под-пись & Дата \\ [5ex] \cline{2-5}
338+ & из-ме-нен-ных & заме-нен-ных & но-вых & аннул-лиро-ван-ных & & & & & \\[10ex]
339+ \hline
340+ & & & & & & & & & \\[5ex]
341+ \hline
342+ & & & & & & & & & \\[5ex]
343+ \hline
344+ & & & & & & & & & \\[5ex]
345+ \hline
346+ & & & & & & & & & \\[5ex]
347+ \hline
348+ & & & & & & & & & \\[5ex]
349+ \hline
350+ & & & & & & & & & \\[5ex]
351+ \hline
352+ & & & & & & & & & \\[5ex]
353+ \hline
354+ & & & & & & & & & \\[5ex]
355+ \hline
356+ & & & & & & & & & \\[5ex]
357+ \hline
358+ & & & & & & & & & \\[5ex]
359+ \hline
360+ & & & & & & & & & \\[5ex]
361+ \hline
362+ & & & & & & & & & \\[5ex]
363+ \hline
364+ & & & & & & & & & \\[5ex]
365+ \hline
366+ \end{tabular}
367+}
368+
369+
370+%% Code
371+
372+\newcommand{\programmingLanguage}[1]{
373+ \lstset{language=#1}
374+}
375+
376+%% [#1]: ref id
377+%% #2: file
378+%% #3: caption
379+\newcommand{\floatCode}[3][]{
380+\begin{figure}[hbp]
381+ \lstinputlisting [frame=single] {#2}
382+ \ifblank{#3}{}{\caption{#3}}
383+ \ifblank{#1}{}{\label{#1}}
384+\end{figure}
385+}
386+
387+\newcommand{\code}[1]{%
388+ \lstinputlisting[frame=single,basicstyle=\footnotesize\ttfamily]{#1}
389+}
390+
391+% [#1]: caption
392+% #2: file
393+% #3: label
394+\newcommand{\image}[3][]{
395+\begin{figure}[hbp]
396+ \includegraphics{#2}
397+ \ifblank{#1}{}{\caption{#1}}
398+ \ifblank{#3}{}{\label{#3}}
399+\end{figure}
400+}
401+
402+\newcommand{\img}[1]{%
403+ \begin{figure}[b]%
404+ \centering%
405+ \includegraphics[width=0.6\textwidth,height=0.6\textheight,keepaspectratio]{#1}%
406+ \caption{}%
407+ \label{#1}%
408+ \end{figure}%
409+ \ref{#1}%
410+}
411+\newcommand{\imgs}[2]{%
412+ \begin{figure}[bp]%
413+ \centering%
414+ \includegraphics[width=0.45\textwidth,height=0.45\textwidth,keepaspectratio]{#1}%
415+ \hspace{0.05\textwidth}%
416+ \includegraphics[width=0.45\textwidth,height=0.45\textwidth,keepaspectratio]{#2}%
417+ \caption{}%
418+ \label{#1=#2}%
419+ \end{figure}%
420+ \ref{#1=#2}%
421+}
422+
423+\titleformat{\section}[block]{\Large\bfseries\filcenter}{\thesection.}{0mm}{~}
424+
425+\newcommand{\sectionbreak}{\clearpage}