左边 Vs code 和右边 pdf 窗口自动调整

Great to hear you like the split view! When you drag the divider to the left (making the code window narrower), some LaTeX code lines may indeed become partially hidden or cut off because they are too long to fit in the narrow space.

Here’s how to solve this so you can still see all your code:


✅ Solutions:

1. Enable Word Wrap in VS Code

This will wrap long lines of LaTeX code to the next line within the visible window, so nothing gets cut off.

How to enable:

  • Press: Alt + Z
    (Toggle Word Wrap on/off)

OR

  • Go to View > Appearance > Toggle Word Wrap
  • You can also click the "Wrap" icon in the bottom right corner of VS Code (a small arrow going around a line).

2. Set Word Wrap Always On (Optional)

If you want Word Wrap always enabled for LaTeX, do this:

  • Press Ctrl + , to open Settings.
  • Search: word wrap.
  • Set Editor: Word Wrap to "on".

You can also make it apply only to LaTeX by adding this to your settings.json:

"[latex]": {
    "editor.wordWrap": "on"
}

3. Alternative: Use Minimap or Scroll Horizontally

If you prefer no word wrap, you can:

  • Scroll horizontally (hold Shift + Scroll wheel)
  • Or use the Minimap to jump around.
    Enable it: View > Appearance > Show Minimap

Let me know if you prefer Word Wrap or scrolling, and I can help you fine-tune it!

posted @ 2025-03-20 17:25  LiuH41  阅读(78)  评论(0)    收藏  举报