James-Yu / LaTeX-Workshop

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

Enable table of contents for .cls file #4228

Closed SwitWu closed 3 months ago

SwitWu commented 3 months 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.

For a big project such as a thesis template, the developers usually need to write a .cls file with several thousands of code lines. So it is desirable to be able to see the table of contents (or, say, structure) in the .cls file.

For example, one can mark the structure as follows:

% # process class and package options
some source code
% # load class and packages
some source code
% # handle paper size
some source code
% # chapter and section headings
some source code

The Solution*

Please provide a solution you would like to have.

Is it possible for the plugin to recognize these structure markers and automatically make a toc for the developers so that they can jump to the code area they want to edit quickly?

Anything Else?

Add any other context about the feature request below.

James-Yu commented 3 months ago

Unfortunately no, as such markers are not standard LaTeX macros. You may want to resort to other extensions for the feature. This extension can and will only parse TeX macros to construct the structure.

SwitWu commented 3 months ago

Fine. Have a good day