- Published on
Essential VS Code LaTeX Workshop Keyboard Shortcuts for Faster PDF Workflow
- Authors

- Name
- Md Abdus Samad
If you're writing LaTeX documents in VS Code with the LaTeX Workshop extension, mastering keyboard shortcuts can dramatically speed up your workflow. Here's a comprehensive guide to the most useful shortcuts for building, viewing, and navigating your LaTeX PDFs.
Why Use Keyboard Shortcuts?
When you're deep in writing mode, switching between keyboard and mouse breaks your flow. These shortcuts keep your hands on the keyboard and your mind on the content.
Building & Viewing Your PDF
Core Compilation Shortcuts
Ctrl+Alt+B(Windows/Linux) /Cmd+Option+B(Mac)
Build your LaTeX project. This runs your configured build recipe (usually pdfLaTeX or XeLaTeX).Ctrl+Alt+V/Cmd+Option+V
View the compiled PDF. Opens the PDF viewer if it's not already open, or refreshes if it is.Ctrl+Alt+J/Cmd+Option+J
SyncTeX forward search - jumps from your current cursor position in the.texfile to the corresponding location in the PDF. Incredibly useful for long documents!
Emergency Controls
Ctrl+Alt+XthenCtrl+Alt+V
Kill the current build process and view PDF. Use this when a build hangs or you need to force-stop compilation.
Navigating Between Source and PDF
One of LaTeX Workshop's best features is bidirectional navigation between source and PDF:
PDF → Source (Reverse SyncTeX)
- Right-click in PDF → Select "Go to Source"
Ctrl+Click(orCmd+Click) anywhere in the PDF
Both methods jump back to the corresponding line in your .tex file.
Source → PDF (Forward SyncTeX)
Ctrl+Alt+J/Cmd+Option+J
As mentioned above, this takes you from code to the rendered PDF location.
Essential Editor Shortcuts
File Operations
Ctrl+S/Cmd+S
Save your file. If you enable auto-build (see below), this automatically recompiles your PDF!Ctrl+Shift+P/Cmd+Shift+P
Open Command Palette. Type "LaTeX" to see all available LaTeX Workshop commands.
Code Assistance
Ctrl+Space
Trigger IntelliSense/autocomplete for LaTeX commands, citations, references, and more.Ctrl+//Cmd+/
Comment/uncomment selected lines (adds%in LaTeX).
Managing Your Workspace
Split View Setup
Ctrl+\/Cmd+\
Split the editor vertically. Perfect for placing your PDF viewer side-by-side with your source code.Ctrl+1,Ctrl+2,Ctrl+3
Switch focus between editor groups (e.g., between your.texfile and PDF viewer).Ctrl+W/Cmd+W
Close the current editor tab.
Quick Navigation
Ctrl+P/Cmd+P
Quick open file by name (great for multi-file projects).Ctrl+Tab/Cmd+Tab
Switch between recently opened files.
Pro Tips & Configuration
Enable Auto-Build on Save
Add this to your VS Code settings.json:
{
"latex-workshop.latex.autoBuild.run": "onSave"
}
Now every time you hit Ctrl+S, your PDF automatically rebuilds. No more manual Ctrl+Alt+B!
Customize Your Own Shortcuts
- Open File → Preferences → Keyboard Shortcuts (or
Ctrl+K Ctrl+S) - Search for "latex-workshop"
- Click the pencil icon next to any command to assign your preferred keybinding
Useful Commands to Bind
Consider creating custom shortcuts for:
latex-workshop.clean- Clean auxiliary fileslatex-workshop.citation- Insert citationlatex-workshop.addtexroot- Set main TeX file in multi-file projects
My Recommended Workflow
Here's how I typically work:
- Split editor (
Ctrl+\) with.texon left, PDF preview on right - Enable auto-build on save for instant feedback
- Use SyncTeX (
Ctrl+Alt+J) constantly to check rendered output - Navigate back with
Ctrl+Clickin PDF when reviewing
This keeps both hands on the keyboard and maintains focus on writing.
Troubleshooting
PDF won't update?
- Try
Ctrl+Alt+XthenCtrl+Alt+Vto kill and restart - Check the Output panel (
Ctrl+Shift+U) for build errors
SyncTeX not working?
- Ensure
\synctex=1is in your build recipe - LaTeX Workshop usually handles this automatically
Conclusion
These shortcuts transform VS Code into a powerful LaTeX IDE. The initial learning curve pays off quickly - after a few days, they'll become muscle memory. Start with the core shortcuts (Ctrl+Alt+B, Ctrl+Alt+V, Ctrl+Alt+J) and gradually add more to your repertoire.
Last updated: December 12, 2024