kyomato/tests/transformed_files/tables_code.txt
2024-08-23 18:50:08 +03:00

185 lines
No EOL
5.5 KiB
Text
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

\documentclass[a4paper]{article}
\usepackage{graphicx, hyperref, xcolor, gensymb, amssymb, mathtools, wrapfig, mathtools, microtype, lastpage, caption, titlesec, paracol, longtable, booktabs, cancel}
\usepackage[T2A, T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[russian, ukrainian]{babel}
\hypersetup{
colorlinks,
linkcolor={blue!20!black},
citecolor={blue!50!black},
urlcolor={blue!80!black}
}
\usepackage[left = 25mm, right = 10mm, top=20mm, bottom=20mm, bindingoffset=0cm]{geometry}
% КОМАНДИ
\newcommand{\fnt}{
\fontshape{n}
\fontsize{14pt} {19pt}
\linespread{0.8}
\selectfont
} % нормативний шрифт
\newcommand{\capfnt}{
\fnt
} % норматичний шрифт для підписів (тимчасово співпадає зі звичайним шрифтом)
\newcommand{\tb}{
\hspace*{10mm}
} % відступ у 5 символів "x" відповідно до ДСТУ
\newcommand{\tbln}{
\newline
\tb
} % те ж саме, але з переносом рядка
\newcommand{\tbsp}{
\vspace*{1ex}
\tbln
} % те ж саме, але з додатковим відступом між рядками
% бібліографія
\usepackage[square,sort,comma,numbers]{natbib}
\renewcommand{\bibsection}{}
\usepackage{totcount}
\newtotcounter{citnum}
% лічильник цитувань
\def\oldbibitem{} \let\oldbibitem=\bibitem
\def\bibitem{\stepcounter{citnum}\oldbibitem}
% лічильник зображень
\newtotcounter{graphnum}
\def\oldincludegraphics{} \let\oldincludegraphics=\includegraphics
\def\includegraphics{\stepcounter{graphnum}\oldincludegraphics}
% лічильник таблиць (НЕАВТОМАТИЧНИЙ!!!)
\newtotcounter{tabnum}
% лічильник додатків (НЕАВТОМАТИЧНИЙ!!!)
\newtotcounter{dodnum}
% нумерація сторінок
\usepackage{fancyhdr}
\pagestyle{fancy}
\fancyhf{}
\renewcommand{\headrulewidth}{0pt}
\setlength{\headheight}{15.3pt}
\fancyhead[R]{\fnt \thepage}
% виноски
\renewcommand{\thefootnote}{\large\arabic{footnote})~}
\renewcommand{\footnoterule}{\rule{20mm}{0.4pt} \vspace*{0.5ex}}
% \newcommand{\vyn}[2]{
% \footnote[#1]{\large #2}
% } % створити виноску
\let\oldFootnote\footnote
\renewcommand{\footnote}[1]{
\oldFootnote{\large #1}
} % перегрузка виноски
\providecommand{\tightlist}{%
\setlength{\itemsep}{0pt}\setlength{\parskip}{0pt}}
% підписи малюнків/таблиць
\captionsetup[figure]{name={\fnt Рисунок~},labelsep=period}
\captionsetup[table]{name={\fnt Таблиця~},labelsep=period}
% markdown strikeouts
\usepackage{soul}
% codeblocks
\usepackage{minted}
% enumeration
\usepackage[shortlabels]{enumitem}
% scaleable font (whatever that means)
\usepackage[normalem]{ulem}
\titleformat*{\section}{\fnt\LARGE\bfseries}
\titleformat*{\subsection}{\fnt\Large\bfseries}
\titleformat*{\subsubsection}{\fnt\Large}
% bra and ket from QM
\usepackage{braket}
\begin{document}
\thispagestyle{empty} % [A]:for cropping
% ------------
% source: https://tex.stackexchange.com/questions/173651/need-help-to-create-such-a-beautiful-title-page
\begingroup
\centering
\obeylines
\topskip 0pt % source: https://tex.stackexchange.com/questions/2326/vertically-center-text-on-a-page
\vspace*{\fill}
\textbf{
\LARGE
\LARGE
\vspace{100pt}
\LARGE
\Large
\Large
\Large
\huge
\vspace{50pt}
\large
\large
\large
\large
\vspace*{\fill}
\hspace{\fill}\large \rule{20mm}{0.4pt}
\vspace{10pt}
}
\endgroup
% ------------
\newpage
\tableofcontents
\newpage
\fnt
Наступний тест. Тут протестуємо таблиці і блоки коду.
\subsection{Таблиці}
\tb Звичайні таблиці; Можуть всередині мати \textbf{формули} чи \textit{посилання} на інші штуки
\begin{table}[h!]
\fnt
\begin{center}
\hskip-1.5cm\begin{tabular}{|c|c|c|}\hline
Storage & Space & Number\\ \hline
\hline
1 & 2 & $3 + e ^{\pi}$\\ \hline
$e$\footnotemark[1]\footnotetext[1]{Це число Ейлера. Воно дуже корисне, \st{але не може бути записане} у вигляді \textit{десяткового} дробу.} & $\cdot \pm 1$ & І тут ще \textit{трохи} тексту \|\\ \hline
\end{tabular}
\stepcounter{tabnum}
\caption{\capfnt Оце приклад таблиці. Як казав мій вчитель: \textbf{ВИКОРИСТОВУЙ БІЛЬШЕ ВИБУХІВКИ} (і "лапок")}
\label{tab:example_1}
\end{center}
\end{table}
\tb Таблиця цілком собі може не мати ідентифікатора або опису:
\begin{table}[h!]
\fnt
\begin{center}
\hskip-1.5cm\begin{tabular}{|c|c|}\hline
Кількість & Роль\\ \hline
\hline
3 діоптрії & 7 галон\\ \hline
rust & \#PANIC!!!\\ \hline
\end{tabular}
\stepcounter{tabnum}\label{tab:table_2}
\end{center}
\end{table}
\subsection{Блоки коду}
\tb Наразі мають досить обмежену підтримку, адже у $\LaTeX$ немає нативного поняття блоків коду.
\tbln На щастя, у \textbf{markdown} таке поняття є\footnotemark[2]\footnotetext[2]{Принаймні, \textit{Obsidian} таке робить}:
\begin{minted}[linenos, mathescape, autogobble, breaklines]{rust}
let x = 5;
let y = x.powi(2);
let z = (y as f64).sqrt();
println!("x = {x}, y = {y}, z = {x}");
\end{minted}
\end{document}