James-Yu / LaTeX-Workshop

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

Use ToC titles of captions for constructing outline #4404

Closed LinqLover closed 2 months ago

LinqLover commented 2 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.

  • I often use long figure captions in my writings that span multiple lines. This can make the outline view in VS Code and most importantly the breadcrumb navigation bar very hard to navigate.

image

The Solution*

Please provide a solution you would like to have.

  • Use the ToC (table of contents) caption of figures/chapters/sections etc. instead of the inline caption. It can be provided via the optional argument of \caption[ToC caption]{inline caption}, \section[ToC title]{inline title}, etc.

Anything Else?

Add any other context about the feature request below.

  • Considering that the outline view mimics to some extent the ToC navigation of a PDF viewer, I would argue that using the ToC titles here would be more correct than the current behavior.
  • (Not reproduced, but another reason to use the optional argument of these commands is to provide a PDF-friendly string without commands such \raisebox that cannot be written into the PDF metadata. For the same reason, the contents of this argument could also be easier to parse for this extension, especially since it currently does not resolve arguments in these commands.)
  • Just another consideration: Would it also be possible to merge figures/chapters/etc. in the generated outline view with their labels, if they have one? If my breadcrumb bar read cha:design > sec:design/agent > subsec:design/agent/interfaces > fig:design/agent/interfaces/inspector, this would be much easier to read for me than Designing our Tool > Semantic Object Interfaces for Exploratory Programming Systems > Figure: Possible integration of a conversational semantic interface into a traditional object inspection tool..
James-Yu commented 2 months ago

Thanks for filing the request. It can be done.

For your another consideration, please file a new feature request. A preface: it can be much harder than thought.

LinqLover commented 2 months ago

With unfortunately some delay: Thanks a lot! When will this be live in the VS Code Marketplace? :)