Last active
November 20, 2023 14:35
-
-
Save kongr45gpen/847ce4516c49511e9379f45f9236f20e to your computer and use it in GitHub Desktop.
Some incomprehensible TeX commands for your document preamble that might make your university assignments a bit more fun
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
% | |
% MATHS | |
% | |
\usepackage[table]{xcolor} % loads also »colortbl« | |
\usepackage[many]{tcolorbox} | |
\usepackage{mathtools} | |
\usepackage{amsfonts} | |
\usepackage{amsmath} | |
\usepackage{physics} | |
\usepackage{mathspec} | |
\setallmainfonts(Digits,Latin,Greek){TeX Gyre Pagella Math} | |
\setmathrm{TeX Gyre Pagella} | |
\usepackage{fontspec} | |
%\setmainfont{Tex Gyre Pagella} | |
%\setSansfont{CMU Sans Sans} | |
\setmainfont[ | |
Path=media/, | |
BoldFont=NotoSans-Bold.ttf, | |
ItalicFont=NotoSans-Italic.ttf, | |
BoldItalicFont=NotoSans-BoldItalic.ttf | |
]{NotoSans-Regular.ttf} | |
\setmonofont[ | |
Path=media/, | |
BoldFont=NotoSans-Bold.ttf, | |
]{NotoSans-Regular.ttf} | |
\usepackage{polyglossia} | |
\newfontfamily\greekfonttt[Path=media/,BoldFont=Cousine-Bold.ttf,Script=Greek]{Cousine-Regular.ttf} | |
\newfontfamily\greekfontsf[Script=Greek]{DejaVuSans.ttf} | |
\setmainlanguage[numerals=arabic]{greek} | |
%\setmathfont{Neo Euler} | |
%\setmathrm{Alegreya} | |
%\setmathfont[range=it]{Alegreya-Italic} | |
%\setmathfont[range=bfit]{Alegreya-BoldItalic} | |
\setmathfont[range={}]{TeX Gyre Pagella Math} % empty range to get the correct metrics | |
% | |
% HYPERLINKS | |
% | |
\usepackage{hyperref} | |
\hypersetup{colorlinks,linkcolor={blue!40!black!90!green},citecolor={blue!50!black},urlcolor={cyan!60!blue!70!black}} | |
% | |
% VARIOUS OTHER PACKAGES | |
% | |
\usepackage[left=2cm,right=2cm,top=2cm,bottom=2cm]{geometry} | |
%\usepackage[disable]{todonotes} | |
%\usepackage[normalem]{ulem} | |
%\usepackage{color} | |
%\usepackage{graphicx} | |
%\usepackage{wrapfig} | |
%\usepackage{listings} | |
\usepackage{trace} | |
\renewcommand*{\figurename}{Εικόνα} | |
\usepackage{caption} | |
\usepackage{subcaption} | |
\usepackage[title,page,titletoc]{appendix} | |
%\usepackage{floatrow} | |
\usepackage{xfrac} | |
\usepackage[alsoload=binary]{siunitx} | |
\usepackage{setspace} | |
\usepackage{afterpage} | |
\usepackage{pagecolor} | |
\usepackage{wrapfig} | |
\usepackage{svg} | |
\usepackage[inline]{enumitem} | |
\newcommand\numberthis{\addtocounter{equation}{1}\tag{\theequation}} | |
% | |
% TIKZ | |
% | |
\usepackage{pgfplots} | |
\pgfplotsset{compat=newest} | |
\pgfplotsset{plot coordinates/math parser=false} | |
\usepackage{tikz} %inline graphics | |
\usetikzlibrary{plotmarks,chains,calc,shapes.geometric} | |
\usetikzlibrary{hobby,backgrounds,trees,snakes,shapes.callouts,positioning,pgfplots.groupplots} | |
\usetikzlibrary{shapes.geometric} | |
\usetikzlibrary{decorations.markings} | |
\usetikzlibrary{patterns,shadows} | |
\usepackage[outline]{contour} | |
% | |
% Source: https://tex.stackexchange.com/questions/269080/sketching-an-acoustic-scenario-head-and-loudspeakers-in-tikz | |
% | |
\definecolor{skin}{RGB}{248,198,135} | |
\definecolor{mygreen}{RGB}{66,213,0} | |
\newcounter{speaker} | |
\tikzset{ | |
Speaker/.pic={ | |
\filldraw[fill=gray!40,pic actions] | |
(-15pt,0) -- | |
coordinate[midway] (-front) | |
(15pt,0) -- | |
++([shift={(-6pt,8pt)}]0pt,0pt) coordinate (aux1) -- | |
++(-18pt,0) coordinate (aux2) | |
-- cycle | |
(aux1) -- ++(0,6pt) -- coordinate[midway] (-back) ++(-18pt,0) -- (aux2); | |
}, | |
Human/.pic={ | |
\filldraw[fill=mygreen] | |
(0,0.7cm) ellipse [x radius=10pt,y radius=5pt] | |
(0,-0.7cm) ellipse [x radius=10pt,y radius=5pt]; | |
\filldraw[fill=skin] | |
(0.7,4pt) -- (0.7,-4pt) -- (0.95,0pt) -- cycle; | |
\filldraw[fill=skin] | |
(0,0) ellipse [x radius=0.8cm, y radius=0.7cm]; | |
\filldraw[fill=brown!85!black] | |
(0.5,0.55) arc[start angle=50,end angle=310,x radius=0.8cm, y radius=0.7cm] | |
to[out=60,in=230] cycle; | |
\filldraw[fill=mygreen,rounded corners] | |
(-0.2,0.75) -- (0.2,0.75) -- (0.2,-0.75) -- (-0.2,-0.75) -- cycle; | |
} | |
} | |
\newcommand{\coolgraphic}{\begin{tikzpicture} | |
\foreach \Radius/\Shade in {4.2/10,4.1/20,4/40,3.9/60,3.8/80} | |
\fill[mygreen!\Shade] | |
(0,0) circle [radius=\Radius]; | |
\fill[white] | |
(0,0) circle (3cm); | |
\foreach \Angle [count=\xi] in {0,30,60,140,280} | |
\pic[rotate=\Angle-90] (sp\xi) at (\Angle:3cm) {Speaker}; | |
\draw[dashed] | |
(210:4.2cm) -- (30:4.2cm) | |
(120:4.2cm) -- (300:4.2cm); | |
\pic[rotate=30] {Human}; | |
% draw some arrows from and to the speakers | |
\draw[-latex] (sp1-front) -- ++(-10pt,0pt); | |
\draw[-latex] (sp1-back) -- ++(10pt,0pt); | |
\draw[latex-] (sp3-front) -- ++(240:10pt); | |
\draw[latex-] (sp3-back) -- ++(60:10pt); | |
\end{tikzpicture}} | |
% | |
% MISC | |
% | |
\renewcommand*{\figureautorefname}{Εικόνα} | |
\renewcommand*{\sectionautorefname}{Ενότητα} | |
\renewcommand*{\subsectionautorefname}{Ενότητα} | |
\renewcommand*{\subsubsectionautorefname}{Ενότητα} | |
\renewcommand*{\tableautorefname}{Πίνακας} | |
\newcommand*{\algorithmautorefname}{Αλγόριθμος} | |
\renewcommand{\appendixpagename}{Παραρτήματα} | |
\newcommand{\Παράρτημαautorefname}{Παράρτημα} | |
% | |
% INSTRUCTIONS | |
% | |
\usepackage[format=plain, | |
labelfont={bf,it}, | |
textfont=it]{caption} | |
\usepackage{chngcntr} | |
%\counterwithin{figure}{section} | |
%\counterwithin{table}{section} | |
\renewcommand*{\figurename}{Εικόνα} | |
\addto\captionsgreek{% | |
\renewcommand{\figurename}{Εικόνα}% | |
} | |
% | |
% BACKGROUND | |
% | |
\usepackage[pages=some]{background} | |
\backgroundsetup{ | |
scale=1, | |
color=white, | |
opacity=.5, | |
angle=0, | |
contents={% | |
\includegraphics[height=\paperheight]{background} | |
}% | |
} | |
\DeclareSIUnit\decibel{dB} | |
\DeclareSIUnit\bit{b} | |
\DeclareSIUnit\dbm{dBm} | |
\DeclareSIUnit\dbw{dBW} | |
\DeclareSIUnit\dbi{dBi} | |
\DeclareSIUnit\dbd{dBd} | |
\sisetup{range-phrase=-} | |
\usepackage{listings} | |
\lstset{frame=tb, | |
language=Matlab, | |
aboveskip=1mm, | |
belowskip=1.5mm, | |
xleftmargin=0mm, | |
xrightmargin=0mm, | |
framexleftmargin=0mm, | |
framexrightmargin=0mm, | |
rulesep=0mm, | |
framesep=2mm, | |
framexbottommargin=0mm, | |
framextopmargin=0mm, | |
%frame=none, | |
xleftmargin=\parindent, | |
numbersep=5pt, | |
showstringspaces=false, | |
columns=flexible, | |
keepspaces=true, | |
basicstyle={\footnotesize\ttfamily}, | |
numbers=none, | |
numberstyle=\tiny\color{gray}, | |
keywordstyle=\color{blue}, | |
commentstyle=\color{cyan}, | |
stringstyle=\color{magenta!50!blue}, | |
%breaklines=true, | |
% breakatwhitespace=true, | |
tabsize=3, | |
backgroundcolor=\color{blue!30!gray!20!white} | |
} | |
% My tcolorboxes | |
\tcbset{note/.style={ | |
enhanced, | |
%rightrule=0pt, | |
%toprule=0pt, | |
outer arc=0pt, | |
arc=0pt, | |
colframe=black!90!white, | |
colback=white, | |
attach boxed title to top left, | |
boxed title style={ | |
colback=black!90!white, | |
outer arc=0pt, | |
arc=0pt, | |
top=3pt, | |
bottom=3pt, | |
} | |
} | |
} | |
\usepackage[explicit]{titlesec} | |
\usepackage{ulem} | |
\normalem | |
%\setcounter{secnumdepth}{4} | |
%\titleformat{\paragraph}[runin] | |
%{\normalfont\normalsize\bfseries}{}{15pt}{\uline{\theparagraph\hspace*{1em}#1.}} | |
%\titleformat{name=\paragraph,numberless}[runin] | |
%{\normalfont\normalsize\bfseries}{}{15pt}{\uline{#1.}} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment