303 lines
No EOL
9.7 KiB
Text
303 lines
No EOL
9.7 KiB
Text
\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
|
||
This test is dedicated to attempts of parser deception, i.e. usage of special symbols in wrong places to see if parser recognizes them as control symbols. There we go:
|
||
\section{Page dividers}
|
||
|
||
\tb Page dividers are represented by ------
|
||
\tbln If the line above has dashes ^^^^^^ here, it probably works alright.
|
||
\tbln Here's a genuine divider
|
||
\clearpage
|
||
|
||
\tb Fun fact: there can be a paragraph right after it!
|
||
\clearpage
|
||
Some text, cause why not
|
||
\tbln But this \textbf{DOES} look cursed, don't do it.
|
||
\section{Headers}
|
||
|
||
\tb Headers are most recognizable by '\#'-symbol. For it to actually represent a header, it needs to at the beginning of the line and there should be no more than 6 of them. \textbf{ANYTHING} up to the end of line will be included into a header, then.
|
||
\tbln Example:
|
||
\textbf{This is a long, yet formally correct header. You can add $equations$ and *formatting* here, but I provide no guarantees as of the way these would display in final document.}
|
||
|
||
\tb Here's an example of incorrect header:
|
||
\tbln \#\#\#\#\#\# This header is considered incorrect for this application, and will be parsed as regular paragraph instead
|
||
\tbln Another example of incorrect header, featuring 7 hash-symbols:
|
||
\tbln \#\#\#\#\#\#\# This will be parsed as a regular paragraph
|
||
\section{Equations}
|
||
|
||
\tb There are two types of equations in markdown/latex: inline mathmode and display mathmode
|
||
\tbln Both of them are defined by $-symbols. However, they must be paired to actually represent these. Here are examples:
|
||
\tbln Inline: $y = x ^ 2$
|
||
\tbln Display:
|
||
\begin{equation}
|
||
y = x ^ 2
|
||
\end{equation}
|
||
|
||
\tb Note that display mathmode should ALWAYS start from a new line for this application.
|
||
\tbln Basically, there's not much to deceive for: you can do that:
|
||
\tbln $
|
||
\tbln $
|
||
\tbln (the above should not be mathmode), and that's it, basically :sad:
|
||
\section{Table}
|
||
|
||
\tb Tables are defined by |-symbol. But the actual table will happen only if they are the first thing on the line.
|
||
\tbln Due to current implementation, there's no cure apart from display mathmode and code:
|
||
\tbln (this should be display mathmode):
|
||
\begin{equation}
|
||
|x|
|
||
\end{equation}
|
||
|
||
\tb (this should be a code block):
|
||
\begin{minted}[linenos, mathescape, autogobble, breaklines]{bash}
|
||
head /dev/random
|
||
| cat
|
||
\end{minted}
|
||
|
||
|
||
\section{Figure}
|
||
|
||
\tb Figure is defined by a ![[ sequence at a start of the line. Same points should be uphold here:
|
||
\begin{equation}
|
||
![[
|
||
\end{equation}
|
||
|
||
\begin{minted}[linenos, mathescape, autogobble, breaklines]{text}
|
||
![[
|
||
\end{minted}
|
||
|
||
|
||
\section{References}
|
||
|
||
\tb These start with []
|
||
\subsection{Hyperrefs}
|
||
|
||
\tb These are followed by parentheses (). Nothing is allowed between them, thus
|
||
\tbln Here's a correct href: \href{https://youtu.be/rickroll_link_lol}{my gh page}
|
||
\tbln Here are incorrect refs:
|
||
\tbln [my gh page] (https://youtu.be/rickroll\textit{link}lol)
|
||
\tbln [my gh page]
|
||
\tbln (https://youtu.be/rickroll\textit{link}lol)
|
||
\subsection{Footnote refs}
|
||
|
||
\tb These are started by [^.
|
||
\tbln Here are correct footnote refs: \footnotemark[1], \footnotemark[2]
|
||
\tbln Here are incorrect ones: [^1, ^1],
|
||
\tbln [^
|
||
\tbln 1
|
||
\tbln ]
|
||
\tbln So on
|
||
\subsection{Object refs}
|
||
|
||
\tb These refer to objects like figures, tables and equations.
|
||
\tbln Started by [@.
|
||
\tbln Here's a correct ref: \ref{fig:experiment_schema}
|
||
\tbln Here's are bad ones: [@ fig:1, @ source3],
|
||
\tbln [@
|
||
\tbln eq2
|
||
\tbln ]
|
||
\tbln \textbf{NOTE}: despite object types being prepended with 'eq', 'fig' or 'tab' in refs, you \textit{can} use regular latex to define your custom refs. In fact, LaTeX doesn't care about all of these at all; I'm doing these transformations just for my own comfort, as I've been doing this manually.
|
||
\section{Formatting}
|
||
|
||
\tb This object's type is deprecated and will be removed soon.
|
||
\tbln It starts and ends with
|
||
\begin{itemize}
|
||
\item * or \_
|
||
\item ** or \_\_
|
||
\item ~~
|
||
\end{itemize}
|
||
\tb \textbf{WARN}: As of now, these \textit{might} cause cause massive problems if encountered at the start of the line.
|
||
\tbln Basically, parsers for these tokens attempt parse everything up until they find a closing token. But if they are inserted in a middle of the text, then it's ok - they will be limited by current paragraph, and (most likely) will find no match inside it, if their use was unintended.
|
||
\section{Footnote content}
|
||
|
||
\tb These start with '\footnotemark[3]:' and proceed to the end of line.
|
||
\tbln Example of valid content:
|
||
\tbln Example of invalid content:
|
||
\tbln [^source2: This is invalid content\footnotemark[4]\footnotetext[4]{Explanation of source2.} : This is invalid content \footnotemark[4]: This is invalid content
|
||
\tbln They also must start at the beginning of the line. If fact, this: \footnotemark[4]: Some content
|
||
\tbln Is expected to be a footnote ref with a colon.
|
||
\section{Code blocks}
|
||
|
||
\tb There are two fundamental types of code blocks: normal code block and \textbf{Ayano} code block.
|
||
\subsection{Normal code block}
|
||
|
||
\tb These start and end with '```' on a newline. There can be \textbf{practically anything} inside. Example:
|
||
\begin{minted}[linenos, mathescape, autogobble, breaklines]{java}
|
||
int x = 2;
|
||
int y = 4;
|
||
int[] arr = new int[2];
|
||
arr[0] = x;
|
||
arr[1] = 4;
|
||
\end{minted}
|
||
|
||
|
||
\tb There can be anything after code block had closed:
|
||
\begin{minted}[linenos, mathescape, autogobble, breaklines]{lua(Idk why vscode detects this block closing as a valid lua syntax)}
|
||
local x = 'matt'
|
||
local y = 'y'
|
||
local z = x .. y -- matty!!
|
||
\end{minted}
|
||
|
||
Here's some text that's ok to be here
|
||
\tbln There can't be any spaces before delimiting ```s:
|
||
\tbln ```python
|
||
\tbln \# This here is not really a python block
|
||
\tbln x = 2
|
||
\tbln print(x)
|
||
\tbln ```
|
||
\subsection{Ayano code block}
|
||
|
||
\tb \textit{because Ayano loves Kyoko}
|
||
\tbln This object looks and behaves just like normal code block, but is only limited to \textit{python} language, can have spacial arguments in a language line, may leave something behind in the document. For example:
|
||
\tbln This Ayano block will leave plain "2" behind it:2
|
||
\tbln Akin to normal blocks, it's ok to leave something trailing:
|
||
\begin{minted}[linenos, mathescape, autogobble, breaklines]{ayano}
|
||
2
|
||
\end{minted}
|
||
|
||
This text is ok to be here
|
||
\tbln And these are invalid Ayano blocks:
|
||
\begin{minted}[linenos, mathescape, autogobble, breaklines]{ayano}
|
||
2
|
||
\end{minted}
|
||
|
||
|
||
\tb ```ayano
|
||
\tbln 2
|
||
\tbln ```
|
||
|
||
\end{document} |