No description
- TeX 75.6%
- Perl 20.3%
- Nix 3.6%
- Shell 0.5%
| shared | ||
| templates | ||
| flake.nix | ||
| README.md | ||
| sync.sh | ||
LaTeX Templates
This repository contains Nix flake templates for LaTeX projects.
Available Templates
latex-paper: A standard LaTeX paper template using the KOMA-Scriptscrartclclass, with custom macro/style configurations (hiromacros.sty,hirostyle.sty,commonmacros.sty).paper-on-the-loop-bath: A LaTeX paper template using the American Physical Societyrevtex4-2document class, with specialized style configurations for the loop bath project (conversationalcomments.sty,poormanssubfig.sty).
Initialization
To initialize a new project from a template, run the following command in an empty directory:
nix flake init -t path/to/code/latex_templates#<template-name>
Replace <template-name> with either latex-paper or paper-on-the-loop-bath.
Development and Building
Once initialized, the following workflows are supported in the project directory:
- Entering the development environment:
Alternatively, ifnix developdirenvis installed:direnv allow - Formatting LaTeX files:
tex-fmt index.tex - Compiling the document continuously with livereload:
latexmk -pvc index.tex - Building the PDF in a clean sandbox:
The compiled PDF is output tonix buildresult/index.pdf.
Repository Structure and Synchronization
shared/: Contains configuration files shared across all templates (.envrc,.gitignore,flake.nix,latexmkrc,tex-fmt.toml,references.bib).templates/: Contains the specific template directories.sync.sh: Copies files fromshared/to the template directories to ensure consistency.
To update shared configurations across all templates, modify the files in shared/ and execute the synchronization script:
./sync.sh