James-Yu / LaTeX-Workshop

Boost LaTeX typesetting efficiency with preview, compile, autocomplete, colorize, and more.
MIT License
10.55k stars 522 forks source link

Provide a way to modify/append tools/recipes #4324

Closed memeplex closed 1 month ago

memeplex commented 1 month ago

Please fill the following fields with a star (*) and provide as much related information as possible.

Pre-checks*

Please change the following [ ] to [x] for confirmation.

  • [x] The feature request has not been suggested in this repository.

The Missed*

Is your feature request related to a problem? Please provide a clear and concise description of what the problem is.

Currently to allow for shell escape (a very popular request) I can:

  1. Use latexmk with a .latexmkrc file in my project
  2. Use magic commands at the top of my file
  3. Use a custom build
  4. Redefine the entire tool chain of LW

1 is restricted to latexmk, 2 and 3 aren't as flexible and convenient as recipes that appear in the sidebar and allow to try different engines and tools. If I want to take advantage of all the definitions already included with LW, 4 forces me to copy&paste more than a hundred lines to my settings just to add a parameter.

The Solution*

Please provide a solution you would like to have.

I know VSCode is a bit inflexible in this regard, but perhaps you can add lists of tools and recipes that get merged with the base ones instead of just entirely overriding them? I believe that dictionaries do get merged but I can't recall right now and, in any case, changing the current lists to dicts wouldn't be backwards compatible. Alternatively, provide a way to pass additional args from the magic line to selected tools?

Thanks for this high quality tool.

James-Yu commented 1 month ago

Thanks for the feature request. I do think extending existing tools can be useful. However, current vscode config restricts that the configs defined in user files will override the default value. This means that extending default tools has to be defined in a new config, e.g., latex-workshop.latex.extendedtools.

However, that will confuse general users as the default latex-workshop.latex.tools also exists there, and these two configs are essentially serving the same feature. Compared with the current implementation, I would choose to avoid making possible confusions to users. Sorry to turn this FR down.