James-Yu / LaTeX-Workshop

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

No outline in tex, sometimes an outline in bib and markdown, and no hint why. #3435

Closed rat10 closed 2 years ago

rat10 commented 2 years ago

The Outline window says "No symbols found in document 'example.tex'" but I have no idea why.

I had a system crash yesterday while editing a markdown file side by side to my main latex file. After restart I updated VSCode from 1.66 to 1.70 before re-opening the project. Before the crash the outline worked just fine, but after restart/update it doesn't.

I fixed all errors that were reported from building the PDF. Outlines of other files in the same project - a bibliography, a markdown document - are sometimes shown, sometimes not. I did numerous restarts, edit/save/reloads etc, all to no avail. I loaded the the document in TeXStudio and sure enough an outline is shown.

Any hints?

James-Yu commented 2 years ago

Can you please provide a minimal working example that can consistently reproduce the bug? Thanks.

rat10 commented 2 years ago

It is a 700k document but after some minimizing I may have discovered the culprit:\verbatimfont{\small}. Commenting it out loads the outline.

This is the whole document:


\documentclass[a4paper,10pt]{report}
\usepackage{verbatim}

\title{Test}
\author{Test Test}

\begin{document}
\maketitle
\tableofcontents

\verbatimfont{\small}

\part{Part 1}
test
    \chapter{Chapter 1}
    test
        \section{Section 1}
        test
            \subsection{Test}
            test

\end{document}
jlelong commented 2 years ago

latex-utensils cannot parse \verbatimfont{\small} and returns an error

SyntaxError at line: 1, column: 21.
Expected "#", "$", "%", "&", "\0", "\\", "\n", "\r", "\r\n", "^", "_", "{", "~", "
", "
", [ \t], end of input, or special command but "}" found.

@tamuratak can you investigate this issue?

rat10 commented 2 years ago

Interesting... maybe some more background is helpful:

tamuratak commented 2 years ago

Fixed in https://github.com/tamuratak/latex-utensils/commit/7a3c9eb56d486f576a85b0c50f93b910c0d21d8a

decoomanj commented 2 years ago

Since you're trying to open a large document, it could maybe be related to: https://github.com/James-Yu/LaTeX-Workshop/discussions/3399

rat10 commented 2 years ago

Since you're trying to open a large document, it could maybe be related to: #3399

I don't think so. See the minimal example above that reproducibly triggers the bug. I arrived there in many steps of shortening the original document which all had absolutely no effect. B.t.w. I agree with the author of https://github.com/James-Yu/LaTeX-Workshop/discussions/3399 that long documents are sometimes necessary. In my current work I have lots of cross-references and discuss cross-cutting concerns. I'd rather do without the outline than split it into different docs.

rat10 commented 2 years ago

Just want to confirm that it works. Thanks! I wasn't sure how to update and hesitated a bit...It isn't super reliable though. It takes a few seconds to re-build the outline. Adding the following snippet \section[test]{another test} makes the outline disappear again, and then reappear after a very long time - about some minutes. Removing the snippet again and a few seconds later it rebuilds. It seems however that the outline takes longer and longer to re-cover from such experiments. I can't reproduce this in the short example above but only with my big, 10 k lines file.

An unrelated question: do these curly braces in front of each entry have a special purpose or are they just decoration? Before there was another symbol, right?

James-Yu commented 2 years ago

It seems however that the outline takes longer and longer to re-cover from such experiments. I can't reproduce this in the short example above but only with my big, 10 k lines file.

You may consider trying the new view.outline.fastparse.enabled.

An unrelated question: do these curly braces in front of each entry have a special purpose or are they just decoration? Before there was another symbol, right?

It’s for the new sticky scrolling of vscode.