Initial template

This commit is contained in:
Marcel Radzio 2022-10-17 21:09:45 +02:00
commit a0ea1a3997
12 changed files with 160 additions and 0 deletions

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
build

25
README.md Normal file
View File

@ -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
```

7
Tectonic.toml Normal file
View File

@ -0,0 +1,7 @@
[doc]
name = 'documentation_template'
bundle = 'https://data1.fullyjustified.net/tlextras-2022.0r0.tar'
[[output]]
name = 'default'
type = 'pdf'

1
src/_postamble.tex Normal file
View File

@ -0,0 +1 @@
\end{document}

7
src/_preamble.tex Normal file
View File

@ -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}

BIN
src/assets/nheko.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.4 KiB

6
src/citations.bib Normal file
View File

@ -0,0 +1,6 @@
@article{foo1999,
title = {Title},
author = {Doe, John},
journal = {International Journal of Nonsense},
year = {1999}
}

31
src/class/_config.tex Normal file
View File

@ -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}
}%
}

14
src/class/_packages.tex Normal file
View File

@ -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}%
}%
}

32
src/class/_titlepage.tex Normal file
View File

@ -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}
}

View File

@ -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}

5
src/index.tex Normal file
View File

@ -0,0 +1,5 @@
\chapter{Introduction}
\section{Oh}
\Blindtext
\section{No}
OH NO\cite{foo1999}