This repository has been archived by the owner on Aug 9, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlabreport.cls
105 lines (87 loc) · 3.04 KB
/
labreport.cls
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
% vim: syntax=tex
\NeedsTeXFormat{LaTeX2e}
\ProvidesClass{labreport}
% Options:
% * listings — use the `listings` package
\newif\ifListings
\Listingsfalse
\DeclareOption{listings}{\Listingstrue}
% * en — use the English version of the title page
\newif\ifEnglish
\Englishfalse
\DeclareOption{en}{\Englishtrue}
\ProcessOptions\relax
\LoadClass[12pt, a4paper]{article}
\RequirePackage[a4paper, includeheadfoot, mag=1000,
headsep=0.8cm, footskip=0.8cm,
left=2cm, right=1.5cm, top=1.5cm, bottom=1.5cm]{geometry}
% Set up fonts & language support
\RequirePackage{fontspec, unicode-math}
\setmainfont[Ligatures=TeX]{CMU Serif}
\setmonofont{CMU Typewriter Text}
\RequirePackage[english, russian]{babel}
% Indent first paragraph
\RequirePackage{indentfirst}
\setlength{\parskip}{5pt}
% Logo
\RequirePackage{graphicx}
\ifListings
\RequirePackage[dvipsnames]{xcolor}
\RequirePackage{listings}
\fi
\newcommand{\organization}[1]{\renewcommand{\titleorganization}{#1}}
\newcommand{\departmentsubject}[2]{
\renewcommand{\titledepartment}{#1}
\renewcommand{\titlesubject}{\uppercase{#2}}
}
\newcommand{\titleparts}[2]{
\renewcommand{\titlemain}{#1}
\renewcommand{\titlesub}{#2}
}
\newcommand{\students}[1]{\renewcommand{\titlestudents}{#1}}
\newcommand{\group}[1]{\renewcommand{\titlegroup}{#1}}
\ifEnglish
\newcommand{\titlelogo}{
\includegraphics[trim=0 -0.85cm 0 2.6cm, width=9cm]{itmo-en.pdf}}
\newcommand{\titleorganization}{National Research University ITMO}
\newcommand{\titledepartment}{Department of Computational Technologies}
\newcommand{\titlesubject}{\uppercase{Subject name}}
\newcommand{\titlemain}{Lab Work \#1}
\newcommand{\titlesub}{Lab topic}
\newcommand{\titlestudents}{First Name Last Name}
\newcommand{\titlegroup}{Group P3202}
\newcommand{\titlecity}{Saint Petersburg}
\else
\newcommand{\titlelogo}{
\includegraphics[trim=0 0 0 3cm, width=10cm]{itmo-ru.pdf}}
\newcommand{\titleorganization}{ФГАОУ ВО «Санкт-Петербургский национальный исследовательский университет информационных технологий, механики и оптики»}
\newcommand{\titledepartment}{Кафедра вычислительной техники}
\newcommand{\titlesubject}{\uppercase{Название предмета}}
\newcommand{\titlemain}{Лабораторная работа №1}
\newcommand{\titlesub}{Вариант 1010}
\newcommand{\titlestudents}{Фамилия Имя Отчество}
\newcommand{\titlegroup}{Группа P3202}
\newcommand{\titlecity}{Санкт-Петербург}
\fi
% Title page template
\newcommand{\maketitlepage}[0]{
\begin{titlepage}
\begin{center}
\titlelogo\\
\textsc{
\titleorganization\\[4mm]
\titledepartment\\[1.8cm]
}
\noindent\rule{\textwidth}{0.8pt}\\[8mm]
\textbf{\titlesubject}\\[8mm]
\textbf{\titlemain}\\[2mm]
\titlesub\\[6mm]
\noindent\rule{\textwidth}{0.8pt}\\[1.8cm]
\titlestudents\\[2mm]
\titlegroup
\vfill
\titlecity\\[2mm]
\the\year
\end{center}
\end{titlepage}
}