template_tex/tex/Style.tex
2024-03-06 02:49:41 +03:00

60 lines
3.3 KiB
TeX

% Colors.
\GetEnv[\ColorMain]{DOCUMENT_COLOR}
\definecolor{ColorBlack}{RGB}{0,0,0}
\definecolor{ColorWhite}{RGB}{255,255,255}
\definecolor{ColorLink} {RGB}{46,116,181}
\definecolor{ColorMain} {HTML}{\ColorMain}
\definecolor{ColorGray} {RGB}{127,127,127}
\definecolor{ColorLgray}{RGB}{229,229,229}
\definecolor{ColorRef} {RGB}{53,82,105}
\definecolor{ColorCodeBackground}{RGB}{40,42,54}
\definecolor{ColorCodeText} {RGB}{248,248,242}
\definecolor{ColorCodeString} {RGB}{80,250,123}
\definecolor{ColorCodeLiteral} {RGB}{139,233,253}
\definecolor{ColorCodeProperty} {RGB}{139,233,253}
\definecolor{ColorCodeKeyword} {RGB}{255,184,108}
\definecolor{ColorCodeComment} {RGB}{98,114,164}
% Code block.
\newtcolorbox{CodeBox}[1][]{
colback = ColorCodeBackground,
colframe = ColorCodeBackground,
fontupper = \ttfamily,
nobeforeafter
}
\newenvironment{Code}{\begin{CodeBox}\catcode33=12\obeylines}{\end{CodeBox}}
% Styles.
\newcommand{\ResetStyle}[1]{\fontsize{12}{12}\selectfont\rm\color{ColorBlack}#1} % Reset font style.
\newcommand{\Par} [0]{\par} % Default paragraph break.
\newcommand{\Parn} [0]{\par\noindent} % Default paragraph break without indent.
\newcommand{\Text} [1]{\ResetStyle{#1}} % Default text.
\newcommand{\Itallic} [1]{\textit{#1}} % Itallic text.
\newcommand{\Bold} [1]{\textbf{#1}} % Bold text.
\newcommand{\Semibold} [1]{\fontseries{sb}{\selectfont{#1}}} % Semi-bold text.
\newcommand{\Underline} [1]{\underline{#1}} % Underline text.
\newcommand{\Link} [2]{\href{#2}{\textcolor{ColorLink}{\Underline{#1}}}} % Link webpage.
\newcommand{\Color} [2]{\textcolor{#1}{#2}} % Text color alias.
\newcommand{\Icon} [1]{\raisebox{-1mm}{\includegraphics[height=5mm]{#1}}} % Icons.
\newcommand{\Href} [1]{\hyperlink{#1}{\textcolor{ColorLink}{\Underline{#1}}}} % Reference section.
\newcommand{\TextRef} [1]{\textcolor{ColorRef}{#1}} % Reference text.
\newcommand{\Bullet} [0]{\Icon{IcBullet}\hspace{4mm}} % List bullet symbol.
\newcommand{\Title} [1]{\hypertarget{#1}{}\fontsize{11}{11}%
{\selectfont{\textcolor{ColorMain}{\Semibold{#1}}}}} % Section title.
\newcommand{\BlCompact}[0]{\renewcommand{\baselinestretch}{1.0}\normalsize} % Compact baseline size.
\newcommand{\BlDefault}[0]{\renewcommand{\baselinestretch}{1.5}\normalsize} % Default baseline size.
\newcommand{\CodeString} [1]{\textcolor{ColorCodeString}{#1}} % Color code string.
\newcommand{\CodeLiteral} [1]{\textcolor{ColorCodeLiteral}{#1}} % Color code literal.
\newcommand{\CodeProperty}[1]{\textcolor{ColorCodeProperty}{#1}} % Color code property.
\newcommand{\CodeKeyword} [1]{\textcolor{ColorCodeKeyword}{#1}} % Color code keyword.
\newcommand{\CodeComment} [1]{\textcolor{ColorCodeComment}{#1}} % Color code comment.
% Settings.
\linespread{1.5} % Height between non-breaking lines.
\sloppy % Correct word placement on newline.
\pagestyle{empty} % Suppress default styles, i.e. page numbers.
\BlDefault % Default baseline size.