generated from me/guix-latex-template
Initial commit
This commit is contained in:
commit
ecdd410658
8 changed files with 129 additions and 0 deletions
14
.gitignore
vendored
Normal file
14
.gitignore
vendored
Normal file
|
@ -0,0 +1,14 @@
|
||||||
|
*.eps
|
||||||
|
*.go
|
||||||
|
*.log
|
||||||
|
*.mo
|
||||||
|
*.pdf
|
||||||
|
*.png
|
||||||
|
*.tar.xz
|
||||||
|
*.tmp
|
||||||
|
*~
|
||||||
|
.#*
|
||||||
|
\#*\#
|
||||||
|
,*
|
||||||
|
.DS_Store
|
||||||
|
out
|
3
.guix-channel
Normal file
3
.guix-channel
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
(channel
|
||||||
|
(version 0)
|
||||||
|
(directory ".guix/modules"))
|
27
.guix/modules/template-package.scm
Normal file
27
.guix/modules/template-package.scm
Normal file
|
@ -0,0 +1,27 @@
|
||||||
|
(add-to-load-path ".")
|
||||||
|
(define-module (template-package)
|
||||||
|
#:use-module (gnu packages tex)
|
||||||
|
#:use-module (guix)
|
||||||
|
#:use-module (guix build-system gnu)
|
||||||
|
#:use-module ((guix licenses) #:prefix license:)
|
||||||
|
#:use-module (guix git-download))
|
||||||
|
|
||||||
|
(define vcs-file?
|
||||||
|
;; Return true if the given file is under version control.
|
||||||
|
(or (git-predicate (current-source-directory))
|
||||||
|
(const #t)))
|
||||||
|
|
||||||
|
(define-public template
|
||||||
|
(package
|
||||||
|
(name "template")
|
||||||
|
(version "0.1-git")
|
||||||
|
(source (local-file "../.." "template-checkout"
|
||||||
|
#:recursive? #t
|
||||||
|
#:select? vcs-file?))
|
||||||
|
(build-system gnu-build-system)
|
||||||
|
(native-inputs
|
||||||
|
`(typst))
|
||||||
|
(synopsis "Guix template for LaTeX projects")
|
||||||
|
(description "Guix template for LaTeX projects")
|
||||||
|
(home-page "https://git.sudoer777.dev/me/guix-latex-template")
|
||||||
|
(license license:expat)))
|
11
Justfile
Normal file
11
Justfile
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
default:
|
||||||
|
guix time-machine --channels=./channels.scm.lock -- shell --container --emulate-fhs --manifest=./manifest.scm -- sh -c "mkdir -p ./out && lualatex -output-directory=./out ./src/document.tex"
|
||||||
|
|
||||||
|
dev:
|
||||||
|
guix time-machine --channels=./channels.scm.lock -- shell --manifest=./manifest.scm
|
||||||
|
|
||||||
|
update:
|
||||||
|
guix time-machine --channels=./channels.scm -- describe --format=channels > ./channels.scm.lock
|
||||||
|
|
||||||
|
run: default
|
||||||
|
xdg-open ./out/document.pdf
|
9
README.md
Normal file
9
README.md
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
# Guix LaTeX project template
|
||||||
|
|
||||||
|
1. Modify `./guix/modules/template-package.scm` (defines the project), `./channels.scm` (for project dependencies), and `./manifest.scm` (for development environment) to your requirements.
|
||||||
|
|
||||||
|
1. Install `just` by adding to your Guix Home configuration or running `guix install just`.
|
||||||
|
|
||||||
|
1. Run `just update` to update the dependencies.
|
||||||
|
|
||||||
|
1. Run `just` to generate the document. Run `just run` to generate then open the document. Run `just dev` to open a shell environment with the document's dependencies.
|
27
channels.scm
Normal file
27
channels.scm
Normal file
|
@ -0,0 +1,27 @@
|
||||||
|
(list (channel
|
||||||
|
(name 'guix)
|
||||||
|
(url "https://git.savannah.gnu.org/git/guix.git")
|
||||||
|
(branch "master")
|
||||||
|
(introduction
|
||||||
|
(make-channel-introduction
|
||||||
|
"9edb3f66fd807b096b48283debdcddccfea34bad"
|
||||||
|
(openpgp-fingerprint
|
||||||
|
"BBB0 2DDF 2CEA F6A8 0D1D E643 A2A0 6DF2 A33A 54FA"))))
|
||||||
|
(channel
|
||||||
|
(name 'kbg)
|
||||||
|
(url "https://git.sr.ht/~kennyballou/guix-channel")
|
||||||
|
(branch "master")
|
||||||
|
(introduction
|
||||||
|
(make-channel-introduction
|
||||||
|
"b9d0b8041d28ebd9f85cb041aa3f2235c8b39417"
|
||||||
|
(openpgp-fingerprint
|
||||||
|
"10F4 14AB D526 0D0E 2372 8C08 FE55 890B 57AE DCE5"))))
|
||||||
|
(channel
|
||||||
|
(name 'saayix)
|
||||||
|
(url "https://codeberg.org/look/saayix")
|
||||||
|
(branch "main")
|
||||||
|
(introduction
|
||||||
|
(make-channel-introduction
|
||||||
|
"12540f593092e9a177eb8a974a57bb4892327752"
|
||||||
|
(openpgp-fingerprint
|
||||||
|
"3FFA 7335 973E 0A49 47FC 0A8C 38D5 96BE 07D3 34AB")))))
|
5
manifest.scm
Normal file
5
manifest.scm
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
(add-to-load-path ".guix/modules")
|
||||||
|
(use-modules (template-package)
|
||||||
|
(gnu packages tex))
|
||||||
|
|
||||||
|
(packages->manifest (list texlive-scheme-basic texlive-cm-super texlive-hyperref texlive-etoolbox texlive-pgf texlive-geometry coreutils ltex-ls texlab))
|
33
src/document.tex
Normal file
33
src/document.tex
Normal file
|
@ -0,0 +1,33 @@
|
||||||
|
% This is a comment in LaTeX
|
||||||
|
|
||||||
|
% Preamble: This is where you define the document class, packages, and other settings
|
||||||
|
\documentclass{article}
|
||||||
|
\usepackage[utf8]{inputenc}
|
||||||
|
\usepackage{amsmath}
|
||||||
|
\usepackage{hyperref}
|
||||||
|
\usepackage[margin=2cm]{geometry}
|
||||||
|
|
||||||
|
% Document environment: This is where you write the content of your document
|
||||||
|
\begin{document}
|
||||||
|
|
||||||
|
% Title and author
|
||||||
|
\title{My Simple LaTeX Document}
|
||||||
|
\author{Your Name}
|
||||||
|
\date{\today}
|
||||||
|
\maketitle
|
||||||
|
|
||||||
|
% Introduction
|
||||||
|
\section{Introduction}
|
||||||
|
This is a simple LaTeX document.
|
||||||
|
|
||||||
|
% Math example
|
||||||
|
\section{Math Example}
|
||||||
|
The quadratic formula is given by:
|
||||||
|
$$x = \frac{-b \pm \sqrt{b^2 - 4ac}}{2a}$$
|
||||||
|
|
||||||
|
% Conclusion
|
||||||
|
\section{Conclusion}
|
||||||
|
This is the end of my simple LaTeX document.
|
||||||
|
|
||||||
|
\end{document}
|
||||||
|
|
Loading…
Add table
Reference in a new issue