<div align="center">
  <img alt="Static Badge" src="https://img.shields.io/badge/LuaTeX-blue?style=for-the-badge&logo=lua&logoColor=darkblue&logoSize=auto&labelColor=white&color=darkblue">
  <img alt="CTAN License" src="https://img.shields.io/ctan/l/fits-astro?style=for-the-badge&color=salmon">
  <img alt="CTAN Version" src="https://img.shields.io/ctan/v/fits-astro?style=for-the-badge&color=rebeccapurple">
  <img alt="GitHub Issues or Pull Requests" src="https://img.shields.io/github/issues/TeXackers/fits-astro?style=for-the-badge">
  <img alt="GitHub Repo stars" src="https://img.shields.io/github/stars/TeXackers/fits-astro?style=for-the-badge&logo=github&logoSize=auto&color=mediumseagreen">
  <br><br>
  <img alt="GitHub Actions Workflow Status" src="https://img.shields.io/github/actions/workflow/status/TeXackers/fits-astro/ci-compilation.yaml?style=plastic&label=documentation%20build">
  <br><br>
  <a href="https://mirror.apps.cam.ac.uk/pub/tex-archive/macros/luatex/generic/fits-astro/fits-astro.pdf">Explore the docs</a>
  ·
  <a href="https://github.com/TeXackers/fits-astro/issues/new?labels=bug&template=bug-report---.md">Report Bug</a>
  ·
  <a href="https://github.com/TeXackers/fits-astro/issues/new?labels=enhancement&template=feature-request---.md">Request Feature</a>
</div>

---

## About The Project

This package provides a simple interface to read Flexible Image Transport System (FITS) files and access their header to retrieve information. It allows the user to typeset a key’s value directly in the document or store it in a macro for further processing.

> [!IMPORTANT]
> You need to compile with Lua(La)TeX.

### Built With

![Static Badge](https://img.shields.io/badge/l3build-royalblue?style=for-the-badge&logoColor=white&logoSize=auto)
![Static Badge](https://img.shields.io/badge/github_actions-grey?style=for-the-badge&logo=github%20actions&logoColor=white&logoSize=auto&color=2A2A2A)
![Static Badge](https://img.shields.io/badge/gemini_API-blue?style=for-the-badge&logo=google%20gemini&logoColor=white&logoSize=auto&color=%238E75B2)

## Installation

The latest version can be found on its [CTAN page](https://ctan.org/pkg/fits-astro). Simply download the `*.dtx` files and `fits-astro.ins` file. Then, run

```
pdf(la)tex|xe(la)tex|lua(la)tex fits-astro.ins
```

and place the resultant `.sty` file in your working directory or in your texmf tree.

> [!NOTE]
> To compile the documentations, you need to run `fits-astro-fr|en.dtx` with **LuaLaTeX**.

Alternatively, if you're using a TeX distribution, you can run:

##### For TeXlive

```
tlmgr install fits-astro
```

##### For MikTeX

```
mpm --install=fits-astro
```

## Usage

The package provides a set of macros to retrieve and manipulate the key-value pairs FITS file headers. A file can be loaded in the following two ways:

```LaTeX
\loadheader\HEADER{my_file.fits}
\loadheader{HEADER}{my_file.fits}
```

From there, any key can be accessed using the identification you used:

```LaTeX
\headerkey\HEADER{EXPTIME}
\headerkey{HEADER}{EXPTIME}
```

The values can also be stored in macros for further processing.

*For more examples, please refer to the documentation:*

## Contributing

Contributions are always welcome. Check the `CONTRIBUTING.md` file for more information.

## License

This work may be distributed and/or modified under the conditions of The [LaTeX Project Public License v1.3c](https://www.latex-project.org/lppl/lppl-1-3c.pdf) or later.

This work has the LPPL status *maintained*. The current maintainer of this work is Valentin Dao.

This work consists of the file listed in the `MANIFEST.md` file.

See `LICENSE` for more information.

## Contact

Valentin Dao: [email](mailto:vdao.texdev@gmail.com)
