TeXMan is a LaTeX template manager. Its goal is to a customizable template manager to quickly create documents.
The configuration file is placed in $XDG_CONFIG_HOME/texman/texman.toml
. Here
is a sample configuration file.
template_dir = "$HOME/Documents/Templates"
There will be a default in /etc/texman.conf
soon.
Profiles are the way you can reuse templates that are very frequent. For example, I have a profile set for different classes with different but static teammates. I is convienient to simply call TeXMan and have my homework ready to go.
Profile files use the TOML syntax. The only required key is the Regex to parse token with. Ex.
regex = "<<(.*?)>>"
will match <<TOKEN>>
. You can then add all the tokens you want as variable inside
the profile file. If TeXMan matches a <<TOKEN>>
but with no defined variable
inside the profile file, it will simply output TOKEN
in its place.
regex = "<<(.*?)>>"
NAME1 = "Dimitri Bonanni-Surprenant"
NAME2 = "Teammate"
CLASS = "Relativité Générale"
CODE = "PHQ615"
PROF = "The Teacher"
UNIVERSITY = "The university"
EMBLEM = "The Emplem File to use"
FACULTY = "Science"
DEPARTEMENT = "Physics"
Variable names could be lower case.
TeXMan is written in Rust, a Rust compiler is
needed. Cargo is the recommended way to
compile this project, as there are many dependencies inside the Cargo.toml
.
For Arch users, there is a PKGBUILD
available in the repository. For instruction
on how to use such file, please refer to the arch-linux wiki.
The file
available on the main branch main be outdated with the wrong version number and
md5sums, but there are tested ones in each release version. If you wish to use
the developpement branch, simply update version in the Cargo.toml
and publish.sh
,
then run the publish.sh
script. This will build the relevant archive to make
the package.
To install TeXMan on a Unix based system, simply
make
sudo make DESTDIR="/" install
To understand where this installs the program, you can refer to the Makefile.
You can specify another place to install TeXMan by specifying another DESTDIR
.
This package will not be followed by your package manager when installed this way.
Once installation properly done, verify that texman
is in your
path. Then, you can use TeXMan with templates present in your specified template
directory.
Assuming you have the template homework
inside your template directory, with
profiles default.profile
and quantum.profile
;
- You can apply the template to a directory with the default profile
texman spawn homework <OUT_DIR>
- You can apply the profile
quantum
texman spawn homework <OUT_DIR> -p quantum
- You can list the available templates inside your template directory with
texman template -l
Available Templates:
"homework"
- You can list the available profiles inside the
homework
template with
texman template -p homework
Available Profiles:
"default.profile"
"quantum.profile"
- Have a customizable regex to replace token.
- [] Have sensible defaults in
/etc/texman.conf
- [] Support parameter tokens.
- [] Support variable number of file. (Ex. the are 3 questions in a homework, spawn 3 files.)
- [] Setup Docker test environnement (or other test environnement, I don't think cargo test will be sufficient in this case.)