SumatraPDF SyncTeX Not Working: How to Fix PDF and Source Sync

  • Confirm SyncTeX output exists and matches the PDF being viewed.
  • Fix forward and inverse search commands without changing unrelated settings.
  • Use a minimal project to isolate build, path, or viewer problems.

When SumatraPDF opens your PDF correctly but cannot jump between the PDF and its LaTeX source, the problem is usually not PDF rendering. The most common causes are a build that did not generate SyncTeX data, stale synchronization files, mismatched source and output paths, an incorrect editor command, or multiple SumatraPDF instances using different documents. This guide walks through those causes in a practical order so you can identify the failing link without reinstalling everything or repeatedly changing unrelated settings.

LaTeX source and PDF pages connected by forward and inverse synchronization paths.

1. Confirm the SyncTeX Symptom With a Minimal Test

Before editing commands or deleting settings, determine which part of synchronization is failing. SyncTeX supports two related but separate actions:

  • Forward search opens the PDF at the location corresponding to a source line.
  • Inverse search opens your editor at the source line corresponding to a PDF location.

Test both directions independently. In many SumatraPDF configurations, inverse search is triggered by double-clicking a location in the PDF. Some editor integrations may use a modified click or provide their own command, so check the editor's documented shortcut if double-clicking does nothing.

For forward search, place the cursor beside an obvious sentence in the LaTeX source and run the editor's forward-search or view-PDF command. Success means SumatraPDF becomes active and displays approximately the corresponding PDF location. SyncTeX positions are not always pixel-perfect, especially around floats, equations, or generated material, but the jump should reach the correct page or nearby text.

1.1 Build a minimal project with SyncTeX enabled

Create a temporary folder with a file named test.tex containing a small document:

\documentclass{article}
\begin{document}
First test paragraph.

Second test paragraph for synchronization.
\end{document}

Compile it with the same LaTeX engine used by your normal project, but make sure SyncTeX generation is enabled. A direct command can look like this:

pdflatex -synctex=1 test.tex

The equivalent option works with common engines such as XeLaTeX and LuaLaTeX. Graphical editors often expose it as a setting named SyncTeX, source synchronization, or an additional compiler argument.

After compilation, the folder should contain test.pdf and normally test.synctex.gz. An uncompressed test.synctex file can also be valid. If the minimal project synchronizes correctly, SumatraPDF and the basic editor integration work. Stop changing global settings and investigate the original project's build directory, paths, or stale files instead.

2. Verify the PDF and SyncTeX Files Belong Together

SumatraPDF needs synchronization data generated for the exact PDF being viewed. A PDF can open normally even when its associated SyncTeX file is absent, outdated, or belongs to another build.

2.1 Check the synchronization file beside the output

Locate the PDF that SumatraPDF is actually displaying. Look for a file with the same base name:

  • manual.pdf with manual.synctex.gz
  • manual.pdf with manual.synctex

If neither file exists, enable SyncTeX in the compiler configuration and rebuild. If the file appears after compilation, test synchronization immediately. That is the expected success condition, and there is no reason to alter SumatraPDF's advanced settings yet.

If your editor builds into a separate output folder, the PDF and synchronization file may both be under a directory such as build or out. Ensure the editor opens that output PDF rather than an older copy beside the source.

2.2 Confirm source, PDF, and build paths

Path mismatches commonly occur after renaming or moving a project. The SyncTeX data records information about the source files used during compilation. Copying only the PDF and .synctex.gz file to another directory does not reliably repair references to moved sources.

Use these checks:

  • Confirm the editor is compiling the source file you currently have open.
  • Confirm SumatraPDF's title bar or document properties show the expected PDF path.
  • Check whether another PDF with the same name exists in the source, build, download, or temporary folder.
  • Avoid testing through a shortcut that points to an old output location.
  • If the project was moved, rebuild it from its new location instead of reusing old build artifacts.

After a move, delete ordinary generated files through your editor's clean command, then perform a complete rebuild. Do not delete source files, bibliography databases, figures, or other project assets. Success means a newly timestamped PDF and SyncTeX file are created in the intended output directory and jumps begin targeting the current source tree.

3. Check Editor Integration and the SumatraPDF Command

Forward search is usually initiated by the LaTeX editor, while inverse search requires SumatraPDF to know how to launch that editor. Because these directions use different commands, one can work while the other fails.

3.1 Validate the forward-search command

A typical external-viewer command follows this pattern:

SumatraPDF.exe -reuse-instance "C:\path\to\main.pdf" -forward-search "C:\path\to\chapter.tex" 120

Your editor normally substitutes the actual PDF, source filename, and current line number. Do not paste the example paths literally. Use the editor's own placeholders, which vary between TeXstudio, TeXworks, WinEdt, Vim, Emacs, Visual Studio Code extensions, and other tools.

Check that the configured executable points to the SumatraPDF installation you actually use. On Windows, it is easy to have both an installed copy and a portable copy. If the editor launches one executable while you manually open the PDF in another, forward search may appear to do nothing or may open a second window with a different document.

Quote every path placeholder that can contain spaces. A command can work for a project under C:\TeX and fail under C:\Users\Name\My Documents solely because the substituted path is unquoted.

3.2 Configure the inverse-search command line

SumatraPDF's inverse-search command must identify your editor and pass both the source filename and line number. The general structure is:

"C:\Path\Editor.exe" [editor-specific line argument] "%f"

SumatraPDF uses %f for the source filename and %l for the line number. The placement and syntax around those placeholders depend on the editor. For example, one editor may accept a separate line switch, while another may expect a combined file:line argument. Use the command documented by your editor rather than copying a command intended for a different program.

In SumatraPDF, inspect the inverse-search field under the program's options or LaTeX integration settings. If your editor manages SumatraPDF automatically, compare its current configuration with the editor's official external-viewer instructions.

Success means activating inverse search opens the correct source file in the intended editor at or near the selected line. Once that happens, stop modifying the command. Small line differences around included files, macros, and generated content do not necessarily indicate a broken setup.

3.3 Understand reuse-instance and DDE behavior

The -reuse-instance option asks SumatraPDF to reuse an existing process or window instead of creating an unrelated viewer instance. This is useful for automatic PDF refresh and forward search. If it is missing, an editor may repeatedly open new windows, and the synchronization command may reach a different instance from the one you are watching.

Older editor configurations may refer to DDE commands for controlling SumatraPDF. DDE-based setups can work, but mixing a legacy DDE configuration with a newer command-line configuration can make troubleshooting confusing. Use one integration method recommended by your current editor. If the editor offers a built-in SumatraPDF profile, start with that profile instead of combining it with custom DDE commands.

Close all SumatraPDF windows before retesting a changed reuse-instance or DDE configuration. Then launch forward search from the editor. Success means one SumatraPDF instance opens or refreshes the correct PDF and moves to the requested source location.

Diagnostic view of PDF paths, permissions, viewer instances, and synchronization files.

4. Check Windows and External Tool Factors

File associations are not required for SyncTeX itself, but they can determine which SumatraPDF executable or PDF file your workflow opens. If double-clicking a PDF launches another viewer while the editor sends commands to SumatraPDF, you may unknowingly test two different applications.

Open SumatraPDF directly, use its Open command to select the expected PDF, and then test inverse search. For forward search, verify the editor's viewer path explicitly instead of relying only on the Windows default PDF association.

4.1 Check permissions and protected locations

Compilation must be able to create or update the PDF and .synctex.gz file. Projects stored in protected directories, read-only folders, restricted network locations, or synchronization services can leave an old output file in place when a build fails.

Look at the compiler log and file modification times. If the PDF changes but the SyncTeX file does not, remove only the stale generated SyncTeX file and rebuild. If neither changes, fix the build or folder permissions rather than adjusting SumatraPDF.

For a diagnostic test, copy the minimal project to a normal user-writable folder such as a temporary directory under Documents. This does not require running SumatraPDF or the editor as administrator. In fact, routinely mixing elevated and non-elevated programs can interfere with interprocess commands on Windows. Run both applications at the same normal privilege level whenever possible.

4.2 Separate SyncTeX failures from rendering failures

Codecs, Ghostscript, printer drivers, and format handlers may matter for other SumatraPDF features, but they generally do not repair LaTeX source synchronization for an otherwise readable PDF. Ghostscript may be involved in PostScript workflows, yet SyncTeX still depends on the compiler producing matching synchronization data.

If the PDF displays correctly but source jumps fail, focus on the SyncTeX file, paths, and integration commands. If the document does not render or open at all, solve that separate format or file problem first. A viewer cannot perform a meaningful source jump into a document it cannot load.

5. Inspect or Reset SumatraPDF-settings.txt Safely

SumatraPDF stores persistent preferences in SumatraPDF-settings.txt. An installed copy commonly keeps its settings under the current user's local application data, while portable mode can keep settings with the portable executable. The exact active location depends on how SumatraPDF was launched.

Do not begin by deleting the file. First close every SumatraPDF window because the application may write its current preferences when it exits. Make a backup copy, then open the settings file in a plain-text editor.

Search for an inverse-search command entry and inspect it for:

  • An editor executable that no longer exists
  • An old portable-drive letter
  • Missing quotes around paths containing spaces
  • Incorrect or missing %f and %l placeholders
  • A command for an editor that has been uninstalled

If you use both installed and portable editions, compare their settings locations. Editing the installed edition's file will not help if the editor launches the portable executable.

To test whether persistent settings are the cause, rename the active settings file while SumatraPDF is fully closed, such as to SumatraPDF-settings.backup.txt. Start SumatraPDF and configure only the required inverse-search command. If synchronization works, restore other preferences selectively instead of copying the entire old file back. If the issue remains, restore the backup and continue investigating the build and editor command.

6. Run a Clean Temporary Test Before Reinstalling

Reinstalling SumatraPDF rarely creates a missing SyncTeX file or corrects an editor's placeholders. A clean temporary test provides more useful evidence.

  1. Close all SumatraPDF windows and stop any active LaTeX build.
  2. Create a short project in a new, writable local folder.
  3. Compile it with -synctex=1.
  4. Confirm that the PDF and .synctex.gz share the same base name.
  5. Open that PDF in the exact SumatraPDF executable configured in the editor.
  6. Set the inverse-search command using your editor's documented syntax.
  7. Test inverse search, then run forward search from a known source line.

If both directions work, the installation is healthy. Return to the main project and clean its generated files, verify its output directory, and rebuild. If inverse search fails only in the temporary project, inspect the inverse command. If forward search alone fails, inspect the editor's SumatraPDF executable, placeholders, quoting, and reuse-instance option.

Only consider reinstalling after the minimal project fails with a correctly generated SyncTeX file and verified commands. Even then, preserve a backup of your settings and distinguish between installed and portable copies so the reinstall does not leave the editor pointing to the wrong executable.

7. Quick Fix Checklist

  • Compile with SyncTeX enabled, such as -synctex=1.
  • Confirm the matching .synctex or .synctex.gz file exists.
  • Verify SumatraPDF is displaying the newly built PDF, not an old copy.
  • Clean and rebuild after moving or renaming the project.
  • Check the editor's SumatraPDF executable path and quote path placeholders.
  • Use the correct source-file and line-number placeholders.
  • Add -reuse-instance when recommended by the editor integration.
  • Avoid mixing legacy DDE settings with a separate custom command unless required.
  • Run the editor and SumatraPDF at the same Windows privilege level.
  • Test a minimal local project before resetting settings or reinstalling.

8. Frequently Asked Questions

8.1 Why does inverse search fail while forward search works?

Forward search is sent by the editor, but inverse search depends on the command stored or supplied for SumatraPDF. Check the inverse-search executable, the filename and line placeholders, quoting, and whether the intended editor is still installed.

8.2 Why does SumatraPDF open the PDF but not jump to the source?

Opening a PDF requires only the PDF. Source synchronization also requires a matching .synctex or .synctex.gz file and accessible source paths. Rebuild with SyncTeX enabled and confirm that SumatraPDF has opened the matching output PDF.

8.3 Can I copy the PDF and SyncTeX file to another folder?

You can copy them, but synchronization may still refer to source paths recorded during the original build. The reliable fix after moving a project is to compile it again from its new location and open the newly generated PDF.

8.4 Does the PDF need to be the Windows default application?

No. SyncTeX can work without SumatraPDF being the default PDF viewer. However, the editor must call the correct SumatraPDF executable, and you must test the PDF opened by that instance rather than one opened in another viewer.

8.5 Should I delete SumatraPDF-settings.txt?

Not immediately. Close SumatraPDF, back up the file, and rename it temporarily. If a clean settings file fixes inverse search, reconfigure the required command and restore other preferences selectively. If it does not help, restore the backup.

8.6 When should I stop troubleshooting?

Stop changing settings when the minimal project jumps successfully in both directions or when the failing direction has been isolated. If the minimal project works, SumatraPDF itself is functioning. Focus only on the original project's build output, path changes, or stale generated files rather than applying broader resets.


Citations

  1. Official guidance for configuring SumatraPDF with LaTeX editors and SyncTeX. (SumatraPDF LaTeX Integration)
  2. Official reference for forward search, instance reuse, and other launch options. (SumatraPDF Command-Line Arguments)
  3. Official documentation covering advanced preferences stored in the settings file. (SumatraPDF Settings Documentation)
Cindy, ContentBASE creator assistant

MEET CINDY

Your ContentBASE creator assistant

Cindy helps creators find Canva templates, content ideas, and simple ways to make better social media posts faster.

Want ready-to-use templates? Claim the free Canva bundles or browse the full bundle store.