aboutsummaryrefslogtreecommitdiffstats
path: root/latex
diff options
context:
space:
mode:
authorBenedikt Peetz <benedikt.peetz@b-peetz.de>2024-03-31 23:10:25 +0200
committerBenedikt Peetz <benedikt.peetz@b-peetz.de>2024-04-01 00:00:00 +0200
commitff14f9474303784518589fd0ea1ad4b44dbc7161 (patch)
treef57e0192e5d0b8461aa306fd52a9d102fb927508 /latex
parentfeat(rust): Update to my SOTA (diff)
downloadflake-templates-ff14f9474303784518589fd0ea1ad4b44dbc7161.zip
feat(latex): Update to my current SOTA
Diffstat (limited to '')
-rw-r--r--latex/.envrc2
-rw-r--r--latex/.gitignore5
-rw-r--r--latex/cog.toml28
-rw-r--r--latex/content/static/title.tex12
-rw-r--r--latex/main.tex22
-rw-r--r--templates/latex/LICENSE (renamed from latex/LICENSE)0
-rw-r--r--templates/latex/LICENSE.spdx (renamed from latex/LICENSE.spdx)2
-rw-r--r--templates/latex/flake.nix (renamed from latex/flake.nix)91
-rw-r--r--templates/latex/headers/preamble.tex (renamed from latex/headers/preamble.tex)62
-rw-r--r--templates/latex/headers/preamble_local.tex (renamed from latex/headers/preamble_local.tex)0
10 files changed, 97 insertions, 127 deletions
diff --git a/latex/.envrc b/latex/.envrc
deleted file mode 100644
index 1d383f2..0000000
--- a/latex/.envrc
+++ /dev/null
@@ -1,2 +0,0 @@
-use flake | use nix
-watch flake.nix
diff --git a/latex/.gitignore b/latex/.gitignore
deleted file mode 100644
index 099b827..0000000
--- a/latex/.gitignore
+++ /dev/null
@@ -1,5 +0,0 @@
-# build dirs
-/result
-/build
-
-.direnv
diff --git a/latex/cog.toml b/latex/cog.toml
deleted file mode 100644
index 316fb11..0000000
--- a/latex/cog.toml
+++ /dev/null
@@ -1,28 +0,0 @@
-from_latest_tag = false
-tag_prefix = "v"
-ignore_merge_commits = false
-pre_package_bump_hooks = []
-post_package_bump_hooks = []
-
-branch_whitelist = [
- "prime",
-]
-
-pre_bump_hooks = [
- "nix build", # verify the project builds
- "flake_version_update --version v{{version}} --input-file flake.nix",
-]
-post_bump_hooks = [
- "git push",
- "git push origin v{{version}}", # push the new tag to origin
-]
-
-[commit_types]
-
-[changelog]
-path = "NEWS.md"
-authors = []
-
-[bump_profiles]
-
-[packages]
diff --git a/latex/content/static/title.tex b/latex/content/static/title.tex
deleted file mode 100644
index aaf4c6e..0000000
--- a/latex/content/static/title.tex
+++ /dev/null
@@ -1,12 +0,0 @@
-% LTeX: language=de-DE
-
-\maketitle
-\tableofcontents
-\vspace*{\fill}
-\makeatletter
-Copyright \textcopyright{} \@authors{} \@years{}\\
-\ \\
-Dieses Werk ist lizenziert unter den Bedingungen der CC BY-SA 4.0.
-Der Lizenztext ist online unter \url{http://creativecommons.org/licenses/by-sa/4.0/legalcode} abrufbar.
-\makeatother
-\clearpage
diff --git a/latex/main.tex b/latex/main.tex
deleted file mode 100644
index 8130689..0000000
--- a/latex/main.tex
+++ /dev/null
@@ -1,22 +0,0 @@
-%\documentclass[a4paper, 12pt, nosolutions]{report}
-\documentclass[a4paper, 12pt]{report}
-% LTeX: language=de-DE
-\input{headers/preamble.tex}
-\input{headers/preamble_local.tex}
-
-
-\title{\textbf{TODO}}
-\author{name}
-\authors{name\inst}
-\years{2023}
-\date{\DTMToday}
-
-\includeonly{}
-
-\begin{document}
- \input{content/static/title}
-
- % NEXT_CHAPTER
-
- \printbibliography\relax
-\end{document}
diff --git a/latex/LICENSE b/templates/latex/LICENSE
index dbb2b35..dbb2b35 100644
--- a/latex/LICENSE
+++ b/templates/latex/LICENSE
diff --git a/latex/LICENSE.spdx b/templates/latex/LICENSE.spdx
index 082e0dc..20d2ea0 100644
--- a/latex/LICENSE.spdx
+++ b/templates/latex/LICENSE.spdx
@@ -4,4 +4,4 @@ Creator: TODO
PackageName: TODO
PackageOriginator: TODO
PackageHomePage: TODO
-PackageLicenseDeclared: CC BY-SA 4.0
+PackageLicenseDeclared: CC-BY-SA-4.0
diff --git a/latex/flake.nix b/templates/latex/flake.nix
index 52f7353..ca4edeb 100644
--- a/latex/flake.nix
+++ b/templates/latex/flake.nix
@@ -1,64 +1,71 @@
{
- description = ""; # TODO
+ description = "TODO";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
- # inputs for following
- systems = {
- url = "github:nix-systems/x86_64-linux"; # only evaluate for this system
- };
- flake-compat = {
- url = "github:edolstra/flake-compat";
- flake = false;
- };
- crane = {
- url = "github:ipetkov/crane";
+
+ treefmt-nix = {
+ url = "github:numtide/treefmt-nix";
inputs = {
nixpkgs.follows = "nixpkgs";
- flake-compat.follows = "flake-compat";
- flake-utils.follows = "flake-utils";
- rust-overlay.follows = "rust-overlay";
};
};
- flake-utils = {
- url = "github:numtide/flake-utils";
+ flake_version_update = {
+ url = "git+https://codeberg.org/soispha/flake_version_update.git";
inputs = {
systems.follows = "systems";
+ nixpkgs.follows = "nixpkgs";
+ flake-utils.follows = "flake-utils";
};
};
- rust-overlay = {
- url = "github:oxalica/rust-overlay";
+ lpm = {
+ url = "git+https://codeberg.org/Soispha/lpm.git";
inputs = {
nixpkgs.follows = "nixpkgs";
+ flake-compat.follows = "flake-compat";
flake-utils.follows = "flake-utils";
+ rust-overlay.follows = "rust-overlay";
+ crane.follows = "crane";
+ systems.follows = "systems";
};
};
- # bins
- flake_version_update = {
- url = "git+https://codeberg.org/soispha/flake_version_update.git";
+ # inputs for following
+ systems = {
+ url = "github:nix-systems/x86_64-linux"; # only evaluate for this system
+ };
+ flake-compat = {
+ url = "github:edolstra/flake-compat";
+ flake = false;
+ };
+ flake-utils = {
+ url = "github:numtide/flake-utils";
inputs = {
systems.follows = "systems";
+ };
+ };
+ crane = {
+ url = "github:ipetkov/crane";
+ inputs = {
nixpkgs.follows = "nixpkgs";
- flake-utils.follows = "flake-utils";
};
};
- lpm = {
- url = "git+https://codeberg.org/Soispha/lpm.git";
+ rust-overlay = {
+ url = "github:oxalica/rust-overlay";
inputs = {
nixpkgs.follows = "nixpkgs";
- flake-compat.follows = "flake-compat";
flake-utils.follows = "flake-utils";
- rust-overlay.follows = "rust-overlay";
};
};
};
outputs = {
+ self,
nixpkgs,
flake-utils,
- flake_version_update,
+ treefmt-nix,
lpm,
+ flake_version_update,
...
}:
flake-utils.lib.eachDefaultSystem (system: let
@@ -69,9 +76,11 @@
# TODO reduce to the needed ones
texlive = pkgs.texlive.combined.scheme-full;
- in {
- packages.default = pkgs.stdenv.mkDerivation {
- pname = ""; # TODO
+
+ treefmtEval = import ./treefmt.nix {inherit treefmt-nix pkgs;};
+
+ build = pkgs.stdenv.mkDerivation {
+ pname = "TODO";
inherit version;
src = ./.;
@@ -79,17 +88,33 @@
texlive
];
+ # Run local
+ preferLocalBuild = true;
+ allowSubstitutes = false;
+
buildPhase = ''
- latexmk -file-line-error main.tex
+ # TODO: I have no idea, why calling it with `./build.sh` does not work <2024-03-20>
+ bash ./build.sh
'';
installPhase = ''
- install -D $scr/build/*.pdf $out/;
+ install -D ./build/main.pdf $out/TODO;
'';
};
+ in {
+ packages.default = build;
+
+ checks = {
+ inherit build;
+ formatting = treefmtEval.config.build.check self;
+ };
+
+ formatter = treefmtEval.config.build.wrapper;
+
devShells.default = pkgs.mkShell {
packages = with pkgs; [
cocogitto
+ licensure
flake_version_update.packages."${system}".default
lpm.packages."${system}".default
texlive
@@ -99,5 +124,3 @@
};
});
}
-# vim: ts=2
-
diff --git a/latex/headers/preamble.tex b/templates/latex/headers/preamble.tex
index 9620808..bc8aa8a 100644
--- a/latex/headers/preamble.tex
+++ b/templates/latex/headers/preamble.tex
@@ -9,14 +9,29 @@
% \usepackage{textcomp} % support for yen and so on, not needed since latex2e(2020)
% references
-\usepackage[ngerman]{babel} % For German language support, with reformed orthography!
+\usepackage[british]{babel} % For English language support, with reformed orthography!
+% \usepackage[brithish]{babel} % For English language support, with reformed orthography!
\usepackage{csquotes} % required by biblatex
% \usepackage{biber} % required by biblatex
+
+% \usepackage{biblatex-dw}
\usepackage[backend=biber,
- style=numeric,
- autocite=superscript
+ style=footnote-dw,
+ %
+ pageref=true,
+ annotation=true,
+ library=true,
+ %
+ % style=numeric,
+ autocite=superscript,
+ % FIXME: Keep this here? <2024-03-20>
+ doi=true,
+ isbn=true,
+ loccittracker=true,
+ opcittracker=true
]{biblatex} % For bibtex references
-\addbibresource{resources/reference}
+\addbibresource{resources/reference.bib}
+% \renewcommand{\autocite}[1]{\footcite{#1}\supercite{#1}}
% \bibliography{res/reference} % Set the location of the references
% dates, time
@@ -63,23 +78,24 @@
\usepackage{emptypage} % no page numbers and headings on empty pages
% \usepackage[a4paper, left=2cm, right=2cm, top=2cm, bottom=2cm]{geometry} % For nice margins
% \usepackage{xspace} % Adds a space when it thinks it is necessary
-% \usepackage{blindtext} % blindtext
+\usepackage{blindtext} % blindtext
% tikz style config
\tikzset{help_lines/.style={step=.5cm,gray!50,very thin}}
% notes
-\usepackage{todonotes}
+% \usepackage{todonotes}
% links
% \usepackage[hidelinks]{hyperref} % Links in the pdf
+\usepackage[nospace]{varioref}
\usepackage[pdflang=de-DE]{hyperref}
-\hypersetup{
- colorlinks,
- linkcolor={black},
- citecolor={black},
- urlcolor={blue!80!black}
- }
+% \hypersetup{
+% colorlinks,
+% linkcolor={black},
+% citecolor={black},
+% urlcolor={blue!80!black}
+% }
% \usepackage{stmaryrd} % for \lightning
@@ -215,15 +231,15 @@
\DTMnewdatestyle{margindate}{
\renewcommand*\DTMdisplaydate[4]{
- \MakeLowercase{\DTMgermanshortweekdayname{##4}}\space
+ \MakeLowercase{\DTMshortweekdayname{##4}}\space
\number##3\relax\space
- \MakeLowercase{\DTMgermanshortmonthname{##2}}\space
+ \MakeLowercase{\DTMshortmonthname{##2}}\space
\DTMtwodigits{\DTMtwodigits{##1}}
}
\renewcommand*\DTMDisplaydate[4]{
- \DTMgermanshortweekdayname{##4}\space
+ \DTMshortweekdayname{##4}\space
##3\space
- \DTMgermanshortmonthname{##2}\space
+ \DTMshortmonthname{##2}\space
\DTMtwodigits{\DTMtwodigits{##1}}
}
}
@@ -247,13 +263,13 @@
\margindate{#2}
}
-\pagestyle{fancy}
-\fancyhf{}
-\fancyhead[LE, RO]{}
-\fancyhead[RO, LE]{\@lesson}
-\fancyhead[RE, LO]{}
-\fancyfoot[LE, RO]{\thepage}
-\fancyfoot[C]{\leftmark}
+% \pagestyle{fancy}
+% \fancyhf{}
+% \fancyhead[LE, RO]{}
+% \fancyhead[RO, LE]{\@lesson}
+% \fancyhead[RE, LO]{}
+% \fancyfoot[LE, RO]{\thepage}
+% \fancyfoot[C]{\leftmark}
% Parameters
diff --git a/latex/headers/preamble_local.tex b/templates/latex/headers/preamble_local.tex
index e69de29..e69de29 100644
--- a/latex/headers/preamble_local.tex
+++ b/templates/latex/headers/preamble_local.tex