From 17d7ff129c0a28393c08bf4b7992eb29b3d4245d Mon Sep 17 00:00:00 2001 From: Niccolo Borgioli Date: Tue, 4 Apr 2023 13:12:59 +0200 Subject: [PATCH] latex --- pages/_meta.json | 3 ++- pages/latex.md | 12 ++++++++++++ pages/latex/acronyms.md | 14 ++++++++++++++ pages/latex/bibliography.md | 34 ++++++++++++++++++++++++++++++++++ pages/latex/code.md | 13 +++++++++++++ pages/latex/footnotes.md | 11 +++++++++++ pages/latex/images.md | 19 +++++++++++++++++++ pages/latex/links.md | 13 +++++++++++++ pages/latex/lists.md | 17 +++++++++++++++++ pages/latex/tables.md | 35 +++++++++++++++++++++++++++++++++++ pages/latex/tu-dresden.md | 33 +++++++++++++++++++++++++++++++++ 11 files changed, 203 insertions(+), 1 deletion(-) create mode 100755 pages/latex.md create mode 100755 pages/latex/acronyms.md create mode 100755 pages/latex/bibliography.md create mode 100755 pages/latex/code.md create mode 100755 pages/latex/footnotes.md create mode 100755 pages/latex/images.md create mode 100755 pages/latex/links.md create mode 100755 pages/latex/lists.md create mode 100755 pages/latex/tables.md create mode 100755 pages/latex/tu-dresden.md diff --git a/pages/_meta.json b/pages/_meta.json index a73e602..5816701 100644 --- a/pages/_meta.json +++ b/pages/_meta.json @@ -2,5 +2,6 @@ "index": "Intro", "cli": "CLI", "git": "Git", - "dev_ops": "Dev Ops" + "dev_ops": "Dev Ops", + "latex": "LaTeX" } diff --git a/pages/latex.md b/pages/latex.md new file mode 100755 index 0000000..c3dd7ca --- /dev/null +++ b/pages/latex.md @@ -0,0 +1,12 @@ +# LaTeX + +This is a collection of different LaTeX snippets for different use-cases. + +## Building + +I exclusively [Tectonic](https://tectonic-typesetting.github.io/en-US/) as build engine, as it is a modern alternative to the "OGs". +Most importantly, it supports lazy loading of dependencies, so the install size is tiny (in comparison). + +## Pipeline + +To build Latex in a GitHub Action, see [here](dev_ops/github-actions/latex) diff --git a/pages/latex/acronyms.md b/pages/latex/acronyms.md new file mode 100755 index 0000000..99f114e --- /dev/null +++ b/pages/latex/acronyms.md @@ -0,0 +1,14 @@ +# Acronyms + +```latex +\usepackage{acro} + +\DeclareAcronym{dtn}{ + short = DTN , + long = Delay / Disruption Tollerant Networking , +} + +\ac{tcp} + +\printacronyms +``` \ No newline at end of file diff --git a/pages/latex/bibliography.md b/pages/latex/bibliography.md new file mode 100755 index 0000000..7a4afbe --- /dev/null +++ b/pages/latex/bibliography.md @@ -0,0 +1,34 @@ +# Bibliography + +```latex +\usepackage[backend=bibtex8, style=ieee]{biblatex} +\addbibresource{db.bib} + +\cite{jedari2018survey} + +\medskip +\printbibliography +``` + +```latex +@article{jedari2018survey, + title = {A survey on human-centric communications in non-cooperative wireless relay networks}, + author = {Jedari, Behrouz and Xia, Feng and Ning, Zhaolong}, + journal = {IEEE Communications Surveys \& Tutorials}, + volume = {20}, + number = {2}, + pages = {914--944}, + year = {2018}, + publisher = {IEEE} +} +``` + +For the backend `biber` should be the one used if versions compatiblity is not an issue + +- [Styles](https://www.overleaf.com/learn/latex/Biblatex_citation_styles#Citation_styles) +- [Intro](https://www.overleaf.com/learn/latex/Bibliography_management_with_biblatex#Introduction) + +### RFC + +- [https://datatracker.ietf.org/doc/html/draft-carpenter-rfc-citation-recs-01#section-5.2](https://datatracker.ietf.org/doc/html/draft-carpenter-rfc-citation-recs-01#section-5.2) +- [https://notesofaprogrammer.blogspot.com/2014/11/bibtex-entries-for-ietf-rfcs-and.html](https://notesofaprogrammer.blogspot.com/2014/11/bibtex-entries-for-ietf-rfcs-and.html) \ No newline at end of file diff --git a/pages/latex/code.md b/pages/latex/code.md new file mode 100755 index 0000000..e2e912f --- /dev/null +++ b/pages/latex/code.md @@ -0,0 +1,13 @@ +# Code + +```latex +% Inline +Version: \verb|1.2.3| + +% Block +\begin{verbatim*} +Text enclosed inside \texttt{verbatim} environment +is printed directly +and all \LaTeX{} commands are ignored. +\end{verbatim*} +``` \ No newline at end of file diff --git a/pages/latex/footnotes.md b/pages/latex/footnotes.md new file mode 100755 index 0000000..e2ac1fb --- /dev/null +++ b/pages/latex/footnotes.md @@ -0,0 +1,11 @@ +# Footnotes + +```latex +% Simple +Something\footnote{This is a footnote} + +% With link +Kubernetes\footnote{\url{https://kubernetes.io/}} +``` + +[https://www.overleaf.com/learn/latex/Footnotes](https://www.overleaf.com/learn/latex/Footnotes#Introduction_to_LaTeX.27s_main_footnote_commands) \ No newline at end of file diff --git a/pages/latex/images.md b/pages/latex/images.md new file mode 100755 index 0000000..30ee9b4 --- /dev/null +++ b/pages/latex/images.md @@ -0,0 +1,19 @@ +# Images + +```latex +\usepackage{graphicx} + +% Relative to .tex file +\graphicspath{ {../images/} } + +\begin{figure}[h] + \label{fig:cat} + \caption{Miaaauu} + \centering + \includegraphics[width=0.6\textwidth]{cat.png} +\end{figure} + +Some cat here! \ref{fig:cat} +``` + +[https://www.overleaf.com/learn/latex/Inserting_Images](https://www.overleaf.com/learn/latex/Inserting_Images) \ No newline at end of file diff --git a/pages/latex/links.md b/pages/latex/links.md new file mode 100755 index 0000000..d7b5e80 --- /dev/null +++ b/pages/latex/links.md @@ -0,0 +1,13 @@ +# Links + +```latex +\usepackage{hyperref} + +\href{http://www.overleaf.com}{Something Linky} + +\url{http://www.overleaf.com} +``` + +Also required for linked TOC. + +[https://www.overleaf.com/learn/latex/Hyperlinks#Linking_web_addresses](https://www.overleaf.com/learn/latex/Hyperlinks#Linking_web_addresses) \ No newline at end of file diff --git a/pages/latex/lists.md b/pages/latex/lists.md new file mode 100755 index 0000000..2ebd086 --- /dev/null +++ b/pages/latex/lists.md @@ -0,0 +1,17 @@ +# Lists + +```latex +% Items +\begin{itemize} + \item a + \item b +\end{itemize} + +% Numbered +\begin{enumerate} + \item One + \item Two +\end{enumerate} +``` + +[https://www.overleaf.com/learn/latex/Lists](https://www.overleaf.com/learn/latex/Lists) \ No newline at end of file diff --git a/pages/latex/tables.md b/pages/latex/tables.md new file mode 100755 index 0000000..b776789 --- /dev/null +++ b/pages/latex/tables.md @@ -0,0 +1,35 @@ +# Tables + +```latex +\begin{tabular}{ l|r } + \label{item:dtn-simulators-chosen} + Name & Language \\ + \hline + The One \cite{sim-theone} & \verb|Java| \\ + OPS \cite{sim-ops} & \verb|C++| \\ + ns3-dtn-bit \cite{sim-ns3} & \verb|C++| \\ + dtnsim \cite{sim-dtnsim} & \verb|Python| \\ + DTN \cite{sim-dtn} & \verb|C#| \\ +\end{tabular} +``` + +```latex +begin{table}[h!] + \centering + \begin{tabular}{|c c c c|} + \hline + Col1 & Col2 & Col2 & Col3 \\ + \hline\hline + 1 & 6 & 87837 & 787 \\ + 2 & 7 & 78 & 5415 \\ + 3 & 545 & 778 & 7507 \\ + 4 & 545 & 18744 & 7560 \\ + 5 & 88 & 788 & 6344 \\ + \hline + \end{tabular} + \caption{Table to test captions and labels.} + \label{table:1} +\end{table} +``` + +[https://www.overleaf.com/learn/latex/Tables#Tables_with_fixed_length](https://www.overleaf.com/learn/latex/Tables#Tables_with_fixed_length) \ No newline at end of file diff --git a/pages/latex/tu-dresden.md b/pages/latex/tu-dresden.md new file mode 100755 index 0000000..ae0f9b1 --- /dev/null +++ b/pages/latex/tu-dresden.md @@ -0,0 +1,33 @@ +# TU Dresden + +```latex +\documentclass{tudscrartcl} + +\iftutex + \usepackage{fontspec} +\else + \usepackage[T1]{fontenc} +\fi + +\begin{document} + +% Title +\faculty{Faculty of Computer Science} +\institute{Institute of Systems Architecture} +\chair{Chair of Computer Networks} +\extraheadline{Source: \href{https://github.com/cupcakearmy/master-thesis/}{github.com/cupcakearmy/master-thesis/}} +\author{Niccolo Borgioli} +\date{\today} +\title{Comparison of DTN simulators} +\maketitle + +\tableofcontents + +\section{Introduction} + +Foo bar + +\end{document} +``` + +[Docs](https://mirror.foobar.to/CTAN/macros/latex/contrib/tudscr/doc/tudscr.pdf) \ No newline at end of file