learnlatex / learnlatex.github.io

Learn LaTeX online
https://www.learnlatex.org/
Creative Commons Attribution Share Alike 4.0 International
153 stars 54 forks source link

Command reference #162

Open astoff opened 3 years ago

astoff commented 3 years ago

As a seasoned (La)TeX used, I miss a systematic reference for core LaTeX and the most common packages. This would entail a list of command and environment names, their "calling signatures", and a "docstring".

Such a command reference is quite possibly out of scope for Learn LaTeX, but I hope this is still a good place to discuss the idea.

Now, to give a bit more detail: Essentially all TeX-related documentation is in long form. This is very good when one intentionally sits down to learn the tool. It's not so great when you just need a quick reminder of how something works, or if you are a beginner trying to learn as you go. In these scenarios, a documentation system integrated with the text editor (as is now standard for regular programming languages) is ideal.

Ideally, this systematic command reference would be in a structured format rather than free text. It could then also serve a basis for other editor features such as autocompletion and snippet insertion.

I have created some of the data that I envision here in a personal project by scraping various sources, see this file for an example. However, expanding this to a substantial collection of packages clearly requires collective work.

davidcarlisle commented 3 years ago

Yes I agree that something along these lines would be useful. Coincidentally I just added a trial of command completion to the in-page editor here using a minimalist json file https://www.learnlatex.org/assets/scripts/latexcmds.json obviously a mininmal stripped file such as that could be generated from a larger documented file as in your example.

So, I'm not sure having a command reference as a human readable quick reference quite fits the format for the course here but that doesn't mean that it couldn't usefully have a home elsewhere. But the back end data file could be used in the editor as you say.

Also possibly relevant is this list of user-accessible commands in the latex format (although I think it needs extending now we have incorporated the xparse package)

https://github.com/latex3/latex2e/blob/main/base/kernel-external-commands.txt

dbitouze commented 3 years ago

Maybe the .cwl completion files from TeXstudio could be helpful as well.