# tensorstyles

<!-- Logo -->
<!-- <p align="center">
   <a href="https://gitlab.com/RomainNOEL/tensorstyles">
      <img src="support/logo.png" width="100" alt="logo">
   </a>
</p> -->

<!-- BADGES -->
<p align="center">
   <a href="https://ctan.org/pkg/tensorstyles"><img src="https://img.shields.io/ctan/v/tensorstyles?logo=LaTeX&logoColor=%23008080&color=%23008080"/></a>
   <a href="https://gitlab.com/RomainNOEL/tensorstyles/-/release/"><img src="https://img.shields.io/badge/Latest_Release-v1.0.1.4-FC6D26?logo=Gitlab&logoColor=%#FC6D26"/></a>
   <a href="https://gitlab.com/RomainNOEL/tensorstyles/-/pipelines?page=1&scope=all&ref=main"><img src="https://img.shields.io/gitlab/pipeline-status/RomainNOEL%2Ftensorstyles?branch=main&logo=githubactions&label=pipeline"/></a>
   <a href="https://gitlab.com/RomainNOEL/tensorstyles/-/blob/main/LICENSE.txt"><img src="https://img.shields.io/badge/License-LPPL_1.3c-blue?logo=opensourceinitiative"/></a>
   <a href="https://gitlab.com/api/v4/projects/46402127/jobs/artifacts/main/raw/tensorstyles.pdf?job=deploy-files"><img src="https://img.shields.io/badge/Documentation-PDF_online-green?logo=readthedocs"/></a>
   <a href="https://www.repostatus.org/lifecycle"><img src="https://img.shields.io/badge/repo_status-active-FC6D26?logo=framework&color=#F10001"/></a>
</p>
<!-- Latest_Release-v1.0.1.4    Date: 2026-04-28 -->


## What is tensorstyles ?
The `tensorstyles` is a `LaTeX(3)` package to display tensors (including vector, matrix, etc.) separating them from their form.


## Table of Contents
[[_TOC_]]


## Why this package ?
They are different notation conventions for tensors.
And according to the context (or the local rules) one would like to switch between conventions: keeping the meaning of each tensor, just changing the display.
So, this package is here to print tensors independently from their meaning in a very customizable way.


## Some of the features included
- can change globally the options by default of a command or only for a command call
- can set delimiters (bracket, brace, etc.) and scale them (auto or set manually)
- can adapt to `mleftright` (a package that improve `\left(` and `\right)` and their variant)
- generate new commands as a variant from defined categories


## See it in action
Here is a latex code:
```latex
\documentclass{article}
\usepackage{tensorstyles}
\begin{document}
   % \tensor{<order>}{<variable>}
   $\tensor{2}{t}$
\end{document}
```
is yielding the following:
<img src="support/tensor_full.png" width="100">


## Documentation
The complete `pdf` documentation can be found through an [artefact](https://gitlab.com/api/v4/projects/46402127/jobs/artifacts/main/raw/tensorstyles.pdf?job=deploy-files).


## How to install ?
Several possibilities are available and tested:
- download the `.sty` released zip files,
- build from sources using `l3build`,
- download or update from [CTAN](https://ctan.org/pkg/tensorstyles),
<!-- - fork a example from [Overleaf](https://www.overleaf.com/read/ybdcnjxjrwgq#3ae7f9) . -->

### Download from release
The zip file containing the `.sty` files is downloadable through our latest [release link](https://gitlab.com/RomainNOEL/tensorstyles/-/releases/)

### Build from sources
You can also install the theme from sources, in which case you need a working LaTeX installation with `l3build` installed.
Then just follow these steps:
```bash
git clone https://gitlab.com/RomainNOEL/tensorstyles.git
cd tensorstyles
l3build install
```

Additionally you can use the other `l3build` target:
- `l3build unpack` builds the theme style files.
- `l3build doc` builds this documentation manual and the examples.
- `l3build check` builds the theme and manual.
- `l3build install` installs the theme into your local texmf folder.
- **STOP** unless you want remove it.
- `l3build uninstall` removes the theme from your local texmf folder.
- `l3build clean` removes the files generated by `l3build`.

### Download from CTAN
The CTAN repository is available through the tensorstyles [package](https://ctan.org/pkg/tensorstyles), so you can install it using your favorite LaTeX package manager. For example, with `tlmgr`:
```bash
tlmgr install tensorstyles
```


## License
The LaTeX Project Public License, version 1.3c [(LPPL1.3c)](/LICENSE.txt)


## Project status & contributions
The status of the project is "maintained".
The changelog file is tracking the [changes](https://gitlab.com/RomainNOEL/tensorstyles/-/blob/main/CHANGELOG.md?ref_type=heads) made across versions.
However, if you have a bit of free time and good will to help the maintenance, it will be very appreciated and welcomed.
If you intend to contribute to this project, you can read the dedicated [document](https://gitlab.com/RomainNOEL/tensorstyles/-/blob/main/CONTRIBUTING.md?ref_type=heads).

Contributors:
- Maelwen THOMAS
- Laurent NAVARRO
