# Change default formatter settings for LaTeX \(\#28727\) · gitcafe/zed

[View on GitCafe](https://git.cafe/gitcafe/zed/commit/522abe8e599cdf832b7ede4135d8581c7329be82)

Repository: [gitcafe/zed](https://git.cafe/gitcafe/zed)

Visibility: public

Requested revision: 522abe8e599cdf832b7ede4135d8581c7329be82

Requested commit: 522abe8e599cdf832b7ede4135d8581c7329be82

Commit: 522abe8e599cdf832b7ede4135d8581c7329be82

Tree: 8767662258d5c3529ea64b27c6a238501ea9fcd2

Author: Luke Naylor

Committer: GitHub

## Message

```
Change default formatter settings for LaTeX (#28727)

Closes: https://github.com/rzukic/zed-latex/issues/77 

## Default formatter: `latexindent`
Before, formatting was delegated to the language server, which just ran
a `latexindent` executable. There was no benefit to running it through
the language server over running it as an "external" formatter in zed.
In fact this was an issue because there was no way to provide an
explicit path for the executable (causing above extension issue). Having
the default settings configure the formatter directly gives more control
to user and removes the number of indirections making it clearer how to
tweak things like the executable path, or extra CLI args, etc...

## Alternative: `prettier`
Default settings have also been added to allow prettier as the formatter
(by just setting `"formatter": "prettier"` in the "LaTeX" language
settings). This was not possible before because an extra line needed to
be added to the `prettier` crate (similarly to what was done for
https://github.com/zed-industries/zed/issues/19024) to find the plugin
correctly.
> [!NOTE]
> The `prettier-plugin-latex` node module also contained a
`dist/standalone.js` but using that instead of
`dist/prettier-plugin-latex.js` gave an error, and indeed the latter
worked as intended (along with its questionable choices for formatting).

Release Notes:

- LaTeX: added default `latexindent` formatter settings without relying
on `texlab`, as well as allowing `prettier` to be chosen for formatting

---------

Co-authored-by: Peter Tripp <peter@zed.dev>
```

## Parents

- [5ae8c4cf09b7e5a012a924c257588bf4697365c4](https://git.cafe/gitcafe/zed/commit/5ae8c4cf09b7e5a012a924c257588bf4697365c4?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zed/tree/522abe8e599cdf832b7ede4135d8581c7329be82?format=markdown)
