# Save actions

Field formats can be tidied up when saving the library. That ensures your entries to have consistent formatting. In **Library → Library properties**, check **Enable save actions**. You can now select the actions to be carried out using the 2 drop-down menus located under the table. Each action is defined by:

* an entry field (upon which the action will be applied).
* the type of action to be carried out (such as *HTML to LaTeX*, which converts HTML code to LaTeX code, as described in the window).

A click on the "circular arrow" icon enables a set of recommended formatting actions (the set of actions will depend on your library type: BibTeX or BibLaTeX).​

## List of formatting actions

### Clear

Clears the field completely.

### Escape underscores

Escape underscores

### Escape ampersands

Escapes ampersands.

* `Text & with &ampersands` ⇒ `Text \& with \&ampersands`

### HTML to LaTeX

Converts HTML code to LaTeX code.

### Cleanup URL link

Cleanup URL links.

* `http%3A%2F%2Fwikipedia.org` ⇒ `http://wikipedia.org`

### HTML to Unicode

Converts HTML code to Unicode.

### LaTeX cleanup

Cleans up LaTeX code:

* Escape percent character (e.g.`50% ⇒ 50\%)`
* Remove redundant `$`, `{`, and `}` (but not if the `}` is part of a command argument​)
* Move numbers, `+`, `-`, `/`, and brackets into equations
* Move numbers followed by a space left of `$` inside the equation (e.g. `0.35 $\mu$m`)
* Replace all `@@` with `$`
* Replace multiple spaces with a single space

### Normalize date

Normalizes the date to ISO date format. Format date string to yyyy-mm-dd or yyyy-mm. Keeps the existing String if it does not match one of the following formats:

* "M/y" (covers 9/15, 9/2015, and 09/2015)
* "MMMM (dd), yyyy" (covers September 1, 2015 and September, 2015)
* "yyyy-MM-dd" (covers 2009-1-15)
* "d.M.uuuu" (covers 15.1.2015)

### Normalize month

Normalize month to Bib(la)TeX standard abbreviation.

### Normalize names of persons

Normalizes lists of persons to the Bib(la)TeX standard. This separates authors by "and"s with first names after last name separated by a comma; first names are not abbreviated.

* "John Smith" ⇒ "Smith, John"
* "John Smith and Black Brown, Peter" ⇒ "Smith, John and Black Brown, Peter"
* "John von Neumann and John Smith and Black Brown, Peter" ⇒ "von Neumann, John and Smith, John and Black Brown, Peter".

### Normalize page numbers

Normalize pages to Bib(la)TeX standard. Format page numbers, separated either by commas or double-hyphens. Converts the range number format to page\_number--page\_number. Removes unwanted literals except for letters, numbers, and -+ signs. Keeps the existing String if the resulting field does not match the expected Regex.

```
1-2 ⇒ 1--2
1,2,3 ⇒ 1,2,3
{1}-{2} ⇒ 1--2
43+ ⇒ 43+
Invalid ⇒ Invalid
```

### Ordinals to LaTeX superscript

Converts ordinals to LaTeX superscripts, e.g. 1st, 2nd or 3rd. Will replace ordinal numbers even if they are semantically wrong, e.g. 21rd

* 1st Conf. Cloud Computing -> 1\textsuperscript{st} Conf. Cloud Computing

### Remove enclosing braces

Removes braces encapsulating the complete field content.

### Shorten DOI

Shortens DOI to more human-readable form using <http://shortdoi.org>.

### Unicode to LaTeX

Converts Unicode characters to LaTeX encoding.

### LaTeX to Unicode

Converts LaTeX to Unicode characters if possible.

* `$\acute{\omega}$` ⇒ `ώ`

### Units to LaTeX

Converts units to LaTeX formatting. This includes:

* Add braces around the unit to keep case.
* Replace hyphen with non-break hyphen
* Replace space with a hard space

### Unprotect terms

Remove protective braces from words.

* `{In} {CDMA}` ⇒ `In CDMA`

### Capitalize

Changes the first letter of all words to capital case and the remaining letters to lower case.

### Lower case

Changes all letters to lower case.

### Sentence case

Capitalize the first word, changes other words to lower case.

### Title case

Capitalize all words, but converts articles, prepositions, and conjunctions to lower case.

### Upper case

Changes all letters to upper case.

### Minify list of person names

Shortens lists of persons if there are more than 2 persons to "et al.".

## Save actions as modifiers

The field formatters listed above can also be used as modifiers in [citation key patterns](https://docs.jabref.org/setup/citationkeypatterns) using their keys listed below.

| Save action                                                     | Key                       |
| --------------------------------------------------------------- | ------------------------- |
| [Clear](#clear)                                                 | `clear`                   |
| [Escape underscores](#escape-underscores)                       | `escapeUnderscores`       |
| [Escape ampersands](#escape-ampersands)                         | `escapeAmpersands`        |
| [HTML to LaTeX](#html-to-latex)                                 | `html_to_latex`           |
| [Cleanup URL link](#cleanup-url-link)                           | `cleanup_url`             |
| [HTML to Unicode](#html-to-unicode)                             | `html_to_unicode`         |
| [LaTeX cleanup](#latex-cleanup)                                 | `latex_cleanup`           |
| [Normalize date](#normalize-date)                               | `normalize_date`          |
| [Normalize month](#normalize-month)                             | `normalize_month`         |
| [Normalize names of persons](#normalize-names-of-persons)       | `normalize_names`         |
| [Normalize page numbers](#normalize-page-numbers)               | `normalize_page_numbers`  |
| [Ordinals to LaTeX superscript](#ordinals-to-latex-superscript) | `ordinals_to_superscript` |
| [Remove enclosing braces](#remove-enclosing-braces)             | `remove_braces`           |
| [Shorten DOI](#shorten-doi)                                     | `short_doi`               |
| [Unicode to LaTeX](#unicode-to-latex)                           | `unicode_to_latex`        |
| [Latex to Unicode](#latex-to-unicode)                           | `latex_to_unicode`        |
| [Units to LaTeX](#units-to-latex)                               | `units_to_latex`          |
| [Unprotect terms](#unprotect-terms)                             | `unprotect_terms`         |
| [Capitalize](#capitalize)                                       | `capitalize`              |
| [Lower case](#lower-case)                                       | `lower_case`              |
| [Sentence case](#sentence-case)                                 | `sentence_case`           |
| [Title case](#title-case)                                       | `title_case`              |
| [Upper case](#upper-case)                                       | `upper_case`              |
| [Minify list of person names](#minify-list-of-person-names)     | `minify_name_list`        |


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.jabref.org/finding-sorting-and-cleaning-entries/saveactions.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
