4

I am using VS Code with the LaTeX Workshop extension on Ubuntu 18.04. I enabled the "Build on save" option, with the browser as the PDF viewer. It has always worked fine. However, it suddenly has picked up a mildly annoying behavior: when I save any changes to the .tex document, the viewer jumps to the front page of the PDF, so that I have to scroll down to see the changes that I have just made.

Has anyone encountered the same behavior? Do you have any ideas on how to solve it?

3
  • Welcome to TeX.SE!
    – Mensch
    Commented Feb 8, 2023 at 21:30
  • A coauthor had that problem. I think it is to do with a setting that automatically makes the input move with the location of the output. If you turn that feature off then the behavior will stop.
    – JPi
    Commented Feb 8, 2023 at 22:02
  • Thank you both! After rebooting, the behavior stopped. Commented Feb 9, 2023 at 9:44

2 Answers 2

1

Same error for me but did not go away by rebooting or even switching computers. However, I was working on a large file with many graphics and given @JPi hint looked at the options for refreshing.

  • click on Extensions in VS code, scroll till you find LaTeX workshop,
  • select the gears on the upper right for settings.
  • scroll through the setting to find this part and change the number to a larger one. enter image description here Default was 250 milliseconds. Increasing that number not only fixed the page reset problem but also reduced the flickering I was getting as the build would make several passes. Maybe this helps someone with a related issued.
-1

I have a sort of workarround. Here's how you can do it:

  • Open Settings: Go to the settings in VS Code by clicking on the gear icon in the lower left corner and selecting "Settings", or by pressing Ctrl+,.
  • Search for LaTeX Workshop Settings: In the settings search bar, type latex-workshop.
  • Auto Sync Settings: Look for the setting named latex-workshop.synctex.afterBuild.enabled. Make sure this setting is enabled. This setting ensures that the PDF viewer will sync to the location you are working on after a build.
  • Maintain Scroll Position: There is another setting specifically for maintaining the scroll position after compilation. Find latex-workshop.view.outline.sync.viewer and ensure it is enabled. This setting tries to maintain the current page and scroll position when the PDF is refreshed.

I hope this helps.

1
  • Welcome to TeX.SE!
    – Mensch
    Commented May 29 at 10:17

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .