-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtimetable.tex
More file actions
203 lines (158 loc) · 7.43 KB
/
timetable.tex
File metadata and controls
203 lines (158 loc) · 7.43 KB
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
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
% !TeX TS-program = lualatex
\documentclass[12pt]{report}
\usepackage{fontspec}
% from https://github.com/AndreyAkinshin/Russian-Phd-LaTeX-Dissertation-Template/
\setmonofont{CMU Typewriter Text}
\newfontfamily\cyrillicfonttt{CMU Typewriter Text}
\defaultfontfeatures{Ligatures=TeX}
\setmainfont{CMU Serif}
\newfontfamily\cyrillicfont{CMU Serif}
\setsansfont{CMU Sans Serif}
\newfontfamily\cyrillicfontsf{CMU Sans Serif}
\usepackage{polyglossia}
\setmainlanguage[babelshorthands=true]{russian}
\setotherlanguage{english}
\usepackage{geometry}
\geometry{
a4paper,
landscape,
left=0.5cm,
right=0.5cm,
top=1.5cm,
bottom=1cm
}
\usepackage{fontawesome5}
\usepackage[usenames,dvipsnames,svgnames]{xcolor}
\usepackage{tikz}
\usetikzlibrary{math, calc, patterns}
\begin{document}
\pagenumbering{gobble}
\centering
\tikzmath{
% Часы и минуты -> минуты
function cft(\hour, \min){return \hour * 60 + \min;};
% Разница между двумя временами в минутах
function difftime(\h1, \m1, \h2, \m2) {return ((\h2 - \h1) * 60 + \m2 - \m1) / 60.;};
% Часы и минуты -> часы с дробной частью
function t2f(\h, \m) {return \h + \m / 60.;};
}
\tikzset{nosep/.style={inner sep=0,outer sep=0}}
% Ширина и высота колонок и ячеек
\newcommand{\xunit}{3.8cm}
\newcommand{\yunit}{1.7cm}
% Первый и последний час
\newcommand{\starthour}{9}
\newcommand{\finishhour}{18}
% Первый и последний день (1 -- 6)
\newcommand{\startdays}{1}
\newcommand{\finishdays}{6}
% Первая и последняя пара (1 -- 5)
\newcommand{\startlesson}{1}
\newcommand{\finishlesson}{5}
% Уровень нижней границы полосы с названиями дней
\newcommand{\dayslevel}{8.9}
\begin{tikzpicture}[x=\xunit,y=-\yunit]
% Названия дней - заголовок таблицы
\begin{scope}[every node/.style={draw,above right,minimum width=\xunit,minimum height=1.7em,align=center,nosep}]
\node at (1, \dayslevel) {Понедельник};
\node at (2, \dayslevel) {Вторник};
\node at (3, \dayslevel) {Среда};
\node at (4, \dayslevel) {Четверг};
\node at (5, \dayslevel) {Пятница};
\node at (6, \dayslevel) {Суббота};
\end{scope}
% Левый столбец с часами
\foreach \x in {\starthour,...,\finishhour}
{
\node[draw,below left,minimum height=\yunit,minimum width=2em,align=center] (hour-{\x}) at (1, \x) {\x};
}
% Ячейки слева с номерами пар и временем
\begin{scope}[every node/.style={draw,above left,minimum height=3em,minimum width={t2f(1, 35)*\yunit},align=center,nosep,
xshift=-2.3em,rotate=90}]
\node (p1) at (\startdays, {t2f( 9, 0)}) {1 пара\\ 9:00 --- 10:35};
\node (p2) at (\startdays, {t2f(10, 50)}) {2 пара\\10:50 --- 12:25};
\node (p3) at (\startdays, {t2f(13, 30)}) {3 пара\\13:30 --- 15:05};
% \node (p3) at (\startdays, {t2f(12, 40)}) {3 пара\\12:40 --- 14:15};
\node (p4) at (\startdays, {t2f(15, 20)}) {4 пара\\15:20 --- 16:55};
\node (p5) at (\startdays, {t2f(17, 5)}) {5 пара\\17:05 --- 18:40};
\end{scope}
% Заштрихованные полосы, соотвествующие парам
\begin{scope}[ultra thick,black!10]
\foreach \x in {\startlesson,...,\finishlesson}{
\fill[pattern=north east lines,opacity=0.3] ( p\x.0 -| \startdays,0 ) rectangle ( p\x.180 -| \finishdays+1,0 );
}
\end{scope}
\tikzmath{
\fhp = \finishhour + 1; % bottom border
\sdp = \startdays + 1; %
\fdp = \finishdays + 1; % right border
}
% Горизонтальные линии - границы часов
\foreach \x in {\starthour,...,\fhp} {\draw[black,dotted] (\startdays, \x) -- (\fdp, \x);}
% Вертикальные линии - границы дней
\foreach \x in {\sdp,...,\fdp}{ \draw (\x, \dayslevel) -- (\x, \fhp); }
\tikzset{
% одна пара по высоте (по умолчанию)
single/.style={minimum height={t2f(1, 35)*\yunit}},
% ранняя смена 1-2 пары чуть длиннее
prac12/.style={minimum height={t2f(3, 30)*\yunit}},
% смена в практикуме 3-4 пары = 3 часа 25 минут
prac34/.style={minimum height={t2f(3, 25)*\yunit}},
% смена 3-4-5 пары
prac345/.style={minimum height={t2f(5, 10)*\yunit}},
% дистанционная пара
dist/.style={dashed},
% ``выключенная'' пара
greyedout/.style={text=black!50},
% ``мигающая'' пара
halfsize/.style={minimum height={t2f(0, 45)*\yunit}}
}
% 8:30 - ранняя смена практикума
\coordinate (prac1) at (1, {t2f(8, 30)});
% дни недели
\coordinate (mon) at (1,0); \coordinate (tue) at (2,0); \coordinate (wed) at (3,0);
\coordinate (thu) at (4,0); \coordinate (fri) at (5,0); \coordinate (sat) at (6,0);
% пары
\coordinate (p1) at (0,{t2f( 9, 0)}); \coordinate (p2) at (0,{t2f(10, 50)});
%\coordinate (p3) at (0,{t2f(12, 40)});
\coordinate (p3) at (0,{t2f(13, 30)});
\coordinate (p4) at (0,{t2f(15, 20)}); \coordinate (p5) at (0,{t2f(17, 5)});
\coordinate (p15) at (0,{t2f( 9, 50)}); \coordinate (p25) at (0,{t2f(11, 40)});
%\coordinate (p3) at (0,{t2f(12, 40)});
\coordinate (p35) at (0,{t2f(14, 20)});
\coordinate (p45) at (0,{t2f(16, 10)}); \coordinate (p55) at (0,{t2f(17, 55)});
\coordinate (p1fnm) at (0,{t2f( 9, 0)});
\coordinate (p2fnm) at (0,{t2f( 10, 45)});
\coordinate (p3fnm) at (0,{t2f( 12, 30)});
% Собственно, пары
\begin{scope}[every node/.style={draw,single,below right,fill=white,minimum width=\xunit,text width=\xunit,align=center,nosep}]
% \node[style, ...] at (day |- time) {...}
% style = single, dist, greyedout, prac12, prac34, halfsize
% day = mon, tue, wed, thu, fri, sat
% time = p1, p2, p3, p4, p5, prac1, p3fnm
\node[single, fill=blue!7] at (wed |- p1fnm) {\textbf{Лекция}\\ Общая физика\\ ~~~ ФНМ};
\node[single, fill=blue!7] at (thu |- p2fnm) {\textbf{Лекция}\\ Общая физика\\ ~~~ ФНМ};
\node[single, fill=blue!7] at (thu |- p3fnm) {\textbf{Семинар}\\ Общая физика\\ ~~~ ФНМ};
\node[single,dashed] at (tue |- p2) {\textbf{Семинар}\\ Оптика\\215\\ 5-26 Ю};
\node[single,dashed] at (sat |- p3) {\textbf{Семинар}\\ Оптика\\215\\ 5-40 Ю};
\node[single,prac12, fill=red!7] at (mon |- p1) {\textbf{Практикум \\Оптика}\\ гр. 215, 217};
%\node[single,dashed] at (tue |- p1) {\textbf{Лекция}\\ Молекулярная физика\\ Клавсюк А. Л.\\ СФА};
%\node[single,dashed] at (sat |- p1) {\textbf{Лекция}\\ Молекулярная физика\\ Клавсюк А. Л.\\ СФА};
%
\node[single,single, fill=yellow!7] at (mon |- p5) {\textbf{Спецпрактикa для 3 курса}\\ 4-28};
%%%%%%%%%%%
%\node[single, fill=green!7] at (tue |- p1) {
% \textbf{Лекция}\\ Механика\\ СФА\\ Клавсюк А. Л.
%};
%
%\node[single, fill=green!7] at (tue |- p4) {
% \textbf{Лекция}\\ Механика\\ СФА\\ Клавсюк А. Л. \\ {\footnotesize нечетные недели}
%};
\end{scope}
% Жирные линии, отделяющие заголовки колонок от таблицы
\draw[thick] (\startdays,\dayslevel) -- (\finishdays+1,\dayslevel);
\draw[thick] (\startdays,\starthour) -- (\startdays,\finishhour+1);
% github
\node[below left,color=black!30,font=\scriptsize] at (\fdp,\fhp) {\faGithub\texttt{/xtotdam/timetable}};
\end{tikzpicture}
\end{document}