# Utility scripts

This directory contains a few utility scripts that may be useful over the life of your document.

- `atlaslatex_update.sh` to update your `atlaslatex` version;
- `atlaslatex_selfupdate.sh` to update `atlaslatex_update.sh`;
- `atlaslatex_util.py` to create new documents;
- `atlaslatex_2020.sh` to change how the class and style files are found
    for old documents.

It is a good idea to keep your `atlaslatex` version up to date.
You can use the script `atlaslatex_update.sh` to do this.
From the main directory of the document give the command:

```shell
./scripts/atlaslatex_update.sh
```

If for some reason this does not work properly, precede the command with `bash`:
`bash scripts/atlaslatex_update.sh`.

If `atlaslatex_update.sh` has been updated since it was created,
you will be asked to run `atlaslatex_selfupdate.sh` first.

Both scripts need to clone the latest `atlaslatex` version.
By default they do this with `ssh`, which is the `-s` option.
Pass the `-h` option to use `https` or the `-k` option to use Kerberos.

For each document that will be updated,
you will be shown a `diff` between the current and new versions,
and should then decide if you want to have the new version.

## `atlaslatex_util.py`

The script `atlaslatex_util.py` can be used to create new documents
instead of using `make newpaper` etc.
Use of this script is probably necessary when running on a Windows machine,
as here may be problems with `rm`, `mkdir`, `sed` etc. there.

In the future it is planned to include the equivalent of `atlaslatex_update.sh`,
but this has not yet (2026-04-23) been implemented.

## Old documents (2020 and earlier)

If you are starting from a document created before the start of 2021,
as it entails a few changes to the main document file,
I recommend the following procedure to update your document:

- Make sure all authors have pushed their latest changes and make sure your document compiles.
- Get the latest version of the `atlaslatex_update.sh` and `atlaslatex_2020.sh` scripts from the scripts directory of the atlaslatex Git repository.
- Run the `atlaslatex_selfupdate.sh` script in your main directory.
- Run the `atlaslatex_update.sh` script in your main directory.
- Decide if you want to update the bib files. If you are doing something like a paper resubmission, you maybe should not update them.
- Run the `atlaslatex_2020.sh` script in your main directory.
- Check that your document still compiles. The resulting PDF file should be the same as it was before the update.
- Commit and push the changes, and ask your authors to pull them.
