Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Suggestion Detail for equation references behave weirdly. #4156

Closed
4 tasks done
Alex2134556 opened this issue Feb 6, 2024 · 8 comments
Closed
4 tasks done

Suggestion Detail for equation references behave weirdly. #4156

Alex2134556 opened this issue Feb 6, 2024 · 8 comments

Comments

@Alex2134556
Copy link

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.

  • The issue has not been reported in this repository.
  • The issue remains after disabling all other extensions and restarting Visual Studio Code.
  • The FAQ cannot address the issue.
  • The issue is not related to compiling a document, or the document can be successfully compiled in the OS terminal but not in Visual Studio Code with this extension.

Environment*

Please write exact version numbers instead of descriptors such as latest.

  • Operating System: Sonoma 14.3
  • Visual Studio Code Version: 1.86.0
  • LaTeX Workshop Version: 9.18
  • TeX Distribution Version: Tex Live 2023

The Issue*

Please briefly describe the issue you come across.

  • The suggestion detail for references of equations is either incomplete or it shows the code instead of the equation:
    image
    image

Reproduction Steps

Please list out the steps to reproduce your bug. Include relevant environmental variables or any other configuration.

  1. I used the following code:
\documentclass[11pt]{article}

\begin{document}  
\begin{equation}\label{eq:for W}
    W= w=w=w=w=w=w=w=w=w=w=w=w=w=ww=w=w=w
\end{equation} 

abcd 


For \(f = g\) 
\begin{equation}\label{eq:f=g}
    f  = g
\end{equation}
\end{document} 

Now writing \ref{eq} either next to abcd or below abcd should reproduce the error.

Logs

LaTeX Workshop Output*

Here are the Latex Workshop logs

[15:24:14.182][Extension] Initializing LaTeX Workshop.
[15:24:14.287][Build][Recipe] Set $LATEXWORKSHOP_DOCKER_LATEX: ""
[15:24:14.309][Server] Creating LaTeX Workshop http and websocket server.
[15:24:14.352][Format][Bib] Bibtex format config: {"tab":"  ","case":"lowercase","left":"{","right":"}","trailingComma":false,"sort":["key"],"alignOnEqual":true,"sortFields":false,"fieldsOrder":[],"firstEntries":["string","xdata"]}
[15:24:14.375][Server] Server successfully started: {"address":"127.0.0.1","family":"IPv4","port":63664} .
[15:24:14.382][Extension] Extension root: /Users/fr872/.vscode/extensions/james-yu.latex-workshop-9.18.0
[15:24:14.382][Extension] $PATH: /usr/local/opt/openssl/bin:/opt/homebrew/bin:/opt/homebrew/sbin:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin:/Library/TeX/texbin
[15:24:14.382][Extension] $SHELL: /bin/zsh
[15:24:14.382][Extension] $LANG: undefined
[15:24:14.382][Extension] $LC_ALL: undefined
[15:24:14.383][Extension] process.platform: darwin
[15:24:14.383][Extension] process.arch: arm64
[15:24:14.383][Extension] vscode.env.appName: Visual Studio Code
[15:24:14.383][Extension] vscode.env.remoteName: undefined
[15:24:14.383][Extension] vscode.env.uiKind: 1
[15:24:14.384][Config] latex-workshop.latex.build.forceRecipeUsage: false .
[15:24:14.385][Config] latex-workshop.latex.autoBuild.run: "onSave" .
[15:24:14.385][Config] latex-workshop.latex.autoBuild.cleanAndRetry.enabled: false .
[15:24:14.385][Config] latex-workshop.latex.autoClean.run: "onSucceeded" .
[15:24:14.385][Config] latex-workshop.latex.clean.subfolder.enabled: true .
[15:24:14.385][Config] latex-workshop.latex.clean.fileTypes: ["%DOCFILE%.bbl","%DOCFILE%.blg","%DOCFILE%.idx","%DOCFILE%.ind","%DOCFILE%.lof","%DOCFILE%.lot","%DOCFILE%.out","%DOCFILE%.toc","%DOCFILE%.acn","%DOCFILE%.acr","%DOCFILE%.alg","%DOCFILE%.glg","%DOCFILE%.glo","%DOCFILE%.gls","%DOCFILE%.fls","%DOCFILE%.log","%DOCFILE%.fdb_latexmk","%DOCFILE%.snm","%DOCFILE%.synctex(busy)","%DOCFILE%.synctex.gz(busy)","%DOCFILE%.nav","%DOCFILE%.vrb"] .
[15:24:14.385][Config] latex-workshop.latex.clean.method: "glob" .
[15:24:14.386][Config] latex-workshop.view.pdf.viewer: "external" .
[15:24:14.386][Config] latex-workshop.view.pdf.external.viewer.command: "/Applications/Skim.app/Contents/SharedSupport/displayline" .
[15:24:14.386][Config] latex-workshop.view.pdf.external.viewer.args: ["0","%PDF%"] .
[15:24:14.387][Config] latex-workshop.view.pdf.external.synctex.command: "/Applications/Skim.app/Contents/SharedSupport/displayline" .
[15:24:14.389][Config] latex-workshop.check.duplicatedLabels.enabled: false .
[15:24:14.392][Config] latex-workshop.intellisense.citation.type: "browser" .
[15:24:14.392][Config] latex-workshop.intellisense.citation.format: ["title","journal","publisher","booktitle","year"] .
[15:24:14.392][Config] latex-workshop.intellisense.triggers.latex: ["{,"] .
[15:24:14.392][Config] latex-workshop.intellisense.atSuggestion.trigger.latex: "" .
[15:24:14.393][Config] latex-workshop.message.badbox.show: false .
[15:24:14.400][Extension] Trigger characters for intellisense of LaTeX documents: ["\\",",","{,"]
[15:24:14.400][Root] Current workspace folders: undefined
[15:24:14.401][Extension] LaTeX Workshop initialized.
[15:24:14.401][Root] Found root file from active editor: /Users/fr872/Desktop/General.tex
[15:24:14.401][Root] Root file changed: from /Users/fr872/Desktop/General.tex to /Users/fr872/Desktop/General.tex, langID latex . Refresh dependencies
[15:24:14.401][Event] ROOT_FILE_CHANGED: "/Users/fr872/Desktop/General.tex"
[15:24:14.401][Cacher][Watcher] Reset.
[15:24:14.401][Cacher][Watcher] Reset.
[15:24:14.401][Cacher][Watcher] Reset.
[15:24:14.403][Cacher] Adding /Users/fr872/Desktop/General.tex .
[15:24:14.404][Cacher][Watcher] Watched /Users/fr872/Desktop/General.tex with a new watcher on /Users/fr872/Desktop .
[15:24:14.404][Event] FILE_WATCHED: "/Users/fr872/Desktop/General.tex"
[15:24:14.404][Cacher] Caching /Users/fr872/Desktop/General.tex .
[15:24:14.405][Cacher] Updated inputs of /Users/fr872/Desktop/General.tex .
[15:24:14.405][Cacher] Parse LaTeX AST: /Users/fr872/Desktop/General.tex .
[15:24:14.405][Event] ROOT_FILE_SEARCHED
[15:24:14.409][Server] valdOrigin is http://127.0.0.1:63664
[15:24:14.552][Cacher] Parsed LaTeX AST: /Users/fr872/Desktop/General.tex .
[15:24:14.552][File] Calling kpsewhich to resolve article.cls .
[15:24:14.633][Cacher] Updated elements in 81.11 ms: /Users/fr872/Desktop/General.tex .
[15:24:14.633][Event] FILE_PARSED: "/Users/fr872/Desktop/General.tex"
[15:24:14.634][Structure] Structure force updated with 0 root sections for /Users/fr872/Desktop/General.tex .
[15:24:14.635][Event] STRUCTURE_UPDATED
[15:29:49.030][Commander] SHOWLOG command invoked: compiler
[15:29:52.318][Event] STRUCTURE_UPDATED
@Alex2134556 Alex2134556 changed the title Suggestion Detail for Equation references behave weirdly. Suggestion Detail for equation references behave weirdly. Feb 6, 2024
@James-Yu
Copy link
Owner

James-Yu commented Feb 7, 2024

Unfortunately, I don't see any issue on my side. I'm afraid I cannot fix your issue unless there is a way to reproduce the bug.
截屏2024-02-07 23 02 41
截屏2024-02-07 23 02 37

@James-Yu James-Yu closed this as completed Feb 7, 2024
@James-Yu
Copy link
Owner

James-Yu commented Feb 7, 2024

By the way, for the overlength equation, that was a limit by vscode that the preview cannot horizontally scroll. We cannot fix that.

@Alex2134556
Copy link
Author

Alex2134556 commented Feb 7, 2024

@James-Yu To reproduce the error, first write it next to abcd (you will get the correct output). Then remove, go the next line and write ref{eq:} again. Here is a recording:

Screen.Recording.2024-02-07.at.7.23.09.PM.mov

@James-Yu
Copy link
Owner

James-Yu commented Feb 9, 2024

This is because the caching of the file is not done on the new content. You can choose to save the file to trigger a caching, or enable aggressive caching in the config to auto-cache upon keypress.

@James-Yu
Copy link
Owner

James-Yu commented Feb 9, 2024

See latex-workshop.intellisense.update.aggressive.enabled and latex-workshop.intellisense.update.delay.

@Alex2134556
Copy link
Author

Alex2134556 commented Feb 23, 2024

@James-Yu Regarding the issue about the overlength equation, I have noticed that sometimes the hover box is large enough to display a long equation in its entirety and sometime its very short. Is it possible to have the box be always large enough (not to require scrolling but say min{1/2 the window screen, equation size}) as you state that this is a limit by vscode? Even having a setting to fix the box size to be very large, regardless of equation size, would also be sufficient.

@James-Yu
Copy link
Owner

No afaik.

@Alex2134556
Copy link
Author

Alex2134556 commented Feb 23, 2024

@James-Yu I see, the reason I was wondering about this was because if I write a new equation and then hover for the reference, it gives me a long box.
But then if I compile and then check the reference, it shortens the reference box (but now include the equation number).
My guess is that before compilation, there is no equation number so it behaves normally but after compilation, the equation number is also added, which might be causing weird behavior with \hfill commands (or whatever that forces the equation number to appear right-justified), in which case, vscode defaults to a default size box (confirmed by hovering post-compilation on a small and big equation).

Screen.Recording.2024-02-23.at.8.46.22.PM.mov

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 25, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants