commit a0ea1a3997a31a0bfc498da514b4abd7534926f0 Author: MTRNord Date: Mon Oct 17 21:09:45 2022 +0200 Initial template diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..378eac2 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +build diff --git a/README.md b/README.md new file mode 100644 index 0000000..0b5a6d4 --- /dev/null +++ b/README.md @@ -0,0 +1,25 @@ +# How to use + +## Install tectonic + +The package is designed for usage with [tectonic](https://tectonic-typesetting.github.io/en-US/). +However it also should work in normal latex environments. + +## Create a new project + +```bash +tectonic -X new my-project +``` + +## Copy the files + +To use the package copy the `class` folder and the `citations.bib` to your working directory. +Then take a look at `_preamble.tex` on how to set the variables needed. The Logo is optional + +## Compile + +To compile the document use the following command: + +```bash +tectonic -X build +``` diff --git a/Tectonic.toml b/Tectonic.toml new file mode 100644 index 0000000..b10edd7 --- /dev/null +++ b/Tectonic.toml @@ -0,0 +1,7 @@ +[doc] +name = 'documentation_template' +bundle = 'https://data1.fullyjustified.net/tlextras-2022.0r0.tar' + +[[output]] +name = 'default' +type = 'pdf' diff --git a/src/_postamble.tex b/src/_postamble.tex new file mode 100644 index 0000000..6b47932 --- /dev/null +++ b/src/_postamble.tex @@ -0,0 +1 @@ +\end{document} diff --git a/src/_preamble.tex b/src/_preamble.tex new file mode 100644 index 0000000..f5ce965 --- /dev/null +++ b/src/_preamble.tex @@ -0,0 +1,7 @@ +\documentclass{class/documentation} +\usepackage{blindtext} +\def\title{Nheko} +\def\author{Marcel Radzio} +\def\company{Nheko Team} +\def\logoImage{assets/nheko.png} +\begin{document} diff --git a/src/assets/nheko.png b/src/assets/nheko.png new file mode 100644 index 0000000..d098a62 Binary files /dev/null and b/src/assets/nheko.png differ diff --git a/src/citations.bib b/src/citations.bib new file mode 100644 index 0000000..aa97069 --- /dev/null +++ b/src/citations.bib @@ -0,0 +1,6 @@ +@article{foo1999, + title = {Title}, + author = {Doe, John}, + journal = {International Journal of Nonsense}, + year = {1999} +} diff --git a/src/class/_config.tex b/src/class/_config.tex new file mode 100644 index 0000000..4cacdf1 --- /dev/null +++ b/src/class/_config.tex @@ -0,0 +1,31 @@ +\usepackage{fontspec} +\setmainfont{texgyrepagella}[ + Extension = .otf, + UprightFont = *-regular, + BoldFont = *-bold, + ItalicFont = *-italic, + BoldItalicFont = *-bolditalic, +] + + +\renewcommand{\date}[1]{\def\date{#1}} +\date{\today} + +%%%%%%%%%%% INFOS %%%%%%%%%%%%% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% logo on header +\newcommand{\logoImage}[1]{\def\logoImage{#1}} +% the title of the software +\renewcommand{\title}[1]{\def\title{#1}} +% the author of the document +\renewcommand{\author}[1]{\def\author{#1}} +% the author of the client +\newcommand{\company}[1]{\def\company{#1}} +\def\copyright{% the copyright of the document, by default CC-BY-CC — leave it empty if don't need it + {\tiny % + \title~©~\the\year{},~\company,~by \textbf{\author}~is under licence :~% + \href{https://creativecommons.org/licenses/by-nc/4.0/?ref=chooser-v1}{\faCreativeCommons~\faCreativeCommonsBy~\faCreativeCommonsNc} + }% +} + + diff --git a/src/class/_packages.tex b/src/class/_packages.tex new file mode 100644 index 0000000..e922bf7 --- /dev/null +++ b/src/class/_packages.tex @@ -0,0 +1,14 @@ +\usepackage[headsepline, plainheadsepline]{scrlayer-scrpage} +\usepackage{graphicx} +\usepackage{changepage} +\usepackage{nameref} + +\newcounter{secautolabel} +\AddtoDoHook{heading/endgroup}{\setautolabel} +\newcommand*{\setautolabel}[1]{% + \stepcounter{secautolabel}% + \label{sec:autolabel:\thesecautolabel}% + \expandafter\xdef\csname #1title\endcsname{% + \noexpand\nameref{sec:autolabel:\thesecautolabel}% + }% +} diff --git a/src/class/_titlepage.tex b/src/class/_titlepage.tex new file mode 100644 index 0000000..d4a12d3 --- /dev/null +++ b/src/class/_titlepage.tex @@ -0,0 +1,32 @@ +\renewcommand*{\maketitle}{% + % taken and shortened from /usr/share/texmf/tex/latex/koma-script/scrartcl.cls + \begin{titlepage} + + \def\tempa{}% + \ifx\tempa\logoImage + % no log + \else + \begin{flushright} + \includegraphics[height=2cm]{\logoImage} + \end{flushright} + \fi + + \vspace*{\fill} + + \begin{adjustwidth}{7cm}{0.5cm} + \textbf{\LARGE\title}\\ + {\small{}made by \company}\\ + \end{adjustwidth} + + \begin{adjustwidth}{7cm}{0.5cm} + Documentation written by \author + \end{adjustwidth} + + \vspace*{5cm} + \vspace*{\fill} + + \begin{flushright} + Last updated: \textbf{\large\date} + \end{flushright} + \end{titlepage} +} diff --git a/src/class/documentation.cls b/src/class/documentation.cls new file mode 100644 index 0000000..f9412c9 --- /dev/null +++ b/src/class/documentation.cls @@ -0,0 +1,31 @@ +%general config +\NeedsTeXFormat{LaTeX2e} +\LoadClass[12pt,a4paper]{scrbook} +\ProvidesClass{class/documentation}[2022/10/17 v0.1.0 Documentation class] + + +\input{class/_packages.tex} +\input{class/_config.tex} +\input{class/_titlepage.tex} + + +\pagestyle{scrheadings} +\AtBeginDocument{ + \maketitle + \clearpage + \tableofcontents + + \ohead{\title} + %\chead{\chaptertitle} + \ihead{\chaptertitle} + \clearpage +} + +\AtEndDocument{ + \cleardoublepage + \printbibliography +} + +% biblatex is special as it does some weird things +\usepackage[style=numeric]{biblatex} +\addbibresource{citations.bib} diff --git a/src/index.tex b/src/index.tex new file mode 100644 index 0000000..3ae81d6 --- /dev/null +++ b/src/index.tex @@ -0,0 +1,5 @@ +\chapter{Introduction} +\section{Oh} +\Blindtext +\section{No} +OH NO\cite{foo1999}