- Verify the editor path, file placeholder, line placeholder, and quotation marks.
- Test the expanded launch command outside SumatraPDF before resetting settings.
- Separate installed and portable configurations with a clean temporary test.
- Confirm the Symptom With One Simple Test
- Check the Saved Inverse Search Command
- Test the Editor Command Outside SumatraPDF
- Check Installed, Portable, and Multiple-Editor Setups
- Check Windows and Source File Access
- Inspect or Reset SumatraPDF-settings.txt Safely
- Run a Clean Temporary Test Before Reinstalling
- Quick Fix Checklist
- Frequently Asked Questions
When inverse search in SumatraPDF does nothing, opens the wrong source file, or launches an editor without jumping to the correct line, the PDF viewer is usually not the underlying problem. The most common causes are an incorrect editor executable path, missing or misplaced file and line placeholders, broken quotation marks, or a command saved in a different SumatraPDF installation. This guide focuses specifically on the external editor launch command and its arguments. It assumes your PDF already supports inverse-search navigation and does not cover generating SyncTeX data.

Start with free Canva bundles
Browse the freebies page to claim ready-to-use Canva bundles, then get 25% off your first premium bundle after you sign up.
Free to claim. Canva-ready. Instant access.
1. Confirm the Symptom With One Simple Test
Start by reducing the problem to one PDF, one source file, and one editor. This prevents project-specific paths, multiple source files, and editor extensions from hiding a basic command error.
1.1 Identify exactly what happens
Open a LaTeX-generated PDF in SumatraPDF and use the inverse-search action, commonly performed by double-clicking the relevant PDF text. Record which of these outcomes occurs:
- Nothing opens and no visible error appears.
- Windows asks you to choose an application.
- The correct editor opens, but no source file opens.
- The correct source file opens at the wrong line.
- A different editor or an obsolete editor installation opens.
- The editor reports that it cannot find the source file.
These outcomes point to different command problems. If nothing opens, investigate the executable path first. If the editor opens without a file, inspect the file placeholder. If it opens the correct file at the wrong location, inspect the line placeholder and the editor's command-line syntax.
1.2 Test with a minimal source file
Create a temporary folder with a short LaTeX source file and its compiled PDF. Use a simple path first, such as C:\Temp\LatexTest, rather than a deeply nested folder or a cloud-synchronized location. A short document with several lines makes it easy to see whether the editor receives the correct filename and line number.
Perform inverse search on text near the middle of the PDF. Success means the intended editor opens the matching source file near the selected line. Once that works, stop modifying the SumatraPDF command and test your normal project. If only the normal project fails, the remaining issue is likely related to that project's paths, source mapping, or file accessibility rather than the editor launch command itself.
2. Check the Saved Inverse Search Command
SumatraPDF needs a complete command line that identifies the editor executable and tells the editor which source file and line to open. A valid command generally contains three elements: the full path to the editor, SumatraPDF's source-file placeholder, and SumatraPDF's line-number placeholder.
2.1 Verify the editor executable path
Open SumatraPDF's options and locate the inverse-search command-line field. Read the executable path carefully. It may still point to an editor that was upgraded, moved, uninstalled, or replaced.
Do not assume that an editor shortcut proves the recorded path is valid. Right-click the editor's working shortcut, inspect its target, or locate the executable through Windows. Compare that location with the path saved in SumatraPDF.
If the path contains spaces, place quotation marks around the complete executable path. The same principle applies to file arguments that may contain spaces. A command shaped like the following illustrates the structure:
"C:\Program Files\YourEditor\editor.exe" [editor arguments containing "%f" and %l]
In SumatraPDF inverse-search commands, %f represents the source filename and %l represents the source line. The surrounding argument syntax must still match what your particular editor accepts. Some editors use a line switch followed by a number, while others combine the filename and line in one argument.
Success means invoking inverse search launches the exact editor executable you selected. If it now launches correctly but does not open the file or line, stop changing the executable path and move to the argument checks.
2.2 Check the file placeholder and quotation marks
The filename placeholder should normally be quoted because source paths frequently contain spaces. Without quotes, Windows or the editor may split a path such as C:\Users\Name\LaTeX Projects\report.tex into several arguments.
Check for these common mistakes:
- The command does not contain
%f. - The command uses a similarly named placeholder copied from another PDF viewer.
- Only part of the source-file argument is quoted.
- Curly typographic quotation marks were pasted instead of plain double quotes.
- An unmatched quotation mark causes the rest of the command to be treated as one argument.
- The filename is embedded in editor-specific syntax incorrectly.
After correcting the command, test a project whose folder and filename contain spaces. Success means the editor opens the intended .tex file rather than displaying an empty window, an untitled file, or a file-not-found message.
2.3 Check how the editor accepts line numbers
The presence of %l is necessary but not sufficient. It must appear in the format expected by the editor. For example, one editor might require a separate line option, while another may accept a combined filename:line argument. Do not copy command syntax from an unrelated editor.
Consult the editor's official command-line documentation and find its option for opening a file at a specific line. Then place %f where the filename belongs and %l where the line belongs. Preserve any required colons, switches, or separate arguments.
Success means repeated tests on different parts of the PDF open the same source file at correspondingly different lines. If the file opens but always at line one, at the previous cursor position, or without moving, the editor is likely ignoring or misreading the line argument.
2.4 Make sure SumatraPDF saved the command
After editing the command, close the options dialog normally, reopen it, and confirm that the exact value remains. Pay particular attention to quotation marks and placeholders. If the old command returns, settings may be read-only, written to another settings file, or controlled by a different installed or portable copy.
Once the corrected command remains visible after restarting SumatraPDF, stop repeatedly editing it. Continue only if launching still fails.
3. Test the Editor Command Outside SumatraPDF
A direct Windows test separates a SumatraPDF configuration problem from an editor command-line problem. Substitute an actual source path and line number for the placeholders. Run the resulting command in Command Prompt, PowerShell, or a suitable Windows Run test, accounting for the shell's own quoting rules.
For example, replace %f with the full path to the minimal test file and %l with a real line such as 12. Use the same editor arguments recorded in SumatraPDF.
3.1 Interpret the result
- If Windows cannot find the executable, correct the executable path.
- If the editor opens but reports a missing file, correct the filename argument or quotes.
- If the file opens but the line is ignored, correct the editor-specific line syntax.
- If the complete command works outside SumatraPDF, return to SumatraPDF and confirm that the saved command uses the same structure with
%fand%l.
Windows Run is useful for a quick executable test, but a terminal makes errors easier to observe. Be aware that PowerShell and Command Prompt parse commands differently. The goal is not to prove that every character can be copied unchanged between shells. The goal is to verify that the editor executable exists and supports the intended file-and-line operation.
4. Check Installed, Portable, and Multiple-Editor Setups
A frequent SumatraPDF troubleshooting complication is having more than one viewer or editor copy. A Start menu shortcut may launch an installed SumatraPDF, while a file association opens a portable copy. Each copy can use different settings. Editors can create the same confusion after updates or manual moves.
4.1 Portable editors need stable paths
If the editor is portable, confirm that its drive letter and folder have not changed. A command pointing to D:\Tools\Editor\editor.exe fails when the removable drive becomes E: or the tools folder is renamed.
Launch the portable editor directly from the path stored in SumatraPDF. If it does not start, the path is stale. Update the command to the editor's current executable location and retest. Success means the editor opens from both the direct path and SumatraPDF inverse search.
4.2 Confirm which SumatraPDF copy opens the PDF
Open SumatraPDF through the shortcut you normally use and inspect its inverse-search command. Then open a PDF from File Explorer and inspect the setting again. If the values differ, Windows is associating PDFs with another SumatraPDF executable.
You can either correct the inverse-search command in the copy that actually opens PDFs or update the PDF association to your preferred copy. File association matters here only because it can select a different SumatraPDF configuration. It does not supply the editor's line arguments.
4.3 Check for obsolete editor installations
Some editor updates install into a new folder while leaving an older executable or shortcut behind. The old executable may open, making the command appear valid, but it may use an unexpected profile or lack current command-line behavior.
Locate the editor instance you use interactively and verify its executable. Point SumatraPDF to that exact file. When the correct editor opens the correct source file, do not reinstall either application merely because an obsolete copy remains elsewhere.
5. Check Windows and Source File Access
If the command is syntactically correct, confirm that the editor can access the source path supplied by SumatraPDF. This is especially relevant for network locations, removable media, synchronized folders, protected directories, and files moved after the PDF was produced.
5.1 Open the source path directly
Copy the source path from the editor error, if one appears, and try opening that file manually. Confirm that the file still exists and that your Windows account can read it. If the source was moved or renamed after the PDF was created, inverse search may point to its former location.
For diagnosis, copy the minimal test project to a normal writable local folder. Avoid testing first from Program Files, a restricted corporate directory, or an unavailable network share. Success from the local folder indicates an access or path issue in the original location, not a reason to keep changing the command.
5.2 Avoid unnecessary format and rendering repairs
Codecs, Ghostscript, printer drivers, and general rendering settings are usually irrelevant when the PDF displays normally and only the external LaTeX editor fails to launch. Likewise, SumatraPDF's support for eBooks, comics, CHM, DjVu, XPS, and image formats does not make those documents LaTeX inverse-search sources.
Do not install Ghostscript, change printer drivers, or reset file-format handlers solely to fix an editor command. Investigate those components only when there is a separate symptom involving PostScript conversion, printing, or document rendering. For the symptom covered here, focus on the executable, arguments, saved setting, and source path.

6. Inspect or Reset SumatraPDF-settings.txt Safely
If SumatraPDF will not retain the command, inspect its settings file rather than repeatedly entering the same value. The relevant file is commonly named SumatraPDF-settings.txt. Its location depends on whether SumatraPDF is installed or portable and on how it was launched.
6.1 Back up before editing
- Close all SumatraPDF windows.
- Locate the active
SumatraPDF-settings.txtfile. - Copy it to a safe location with a recognizable backup name.
- Open the original in a plain-text editor.
- Search for the inverse-search command or the editor executable name.
Do not edit the file while SumatraPDF is running because the application may overwrite your changes when it exits. Preserve the file's structure, brackets, and unrelated preferences.
6.2 Determine whether you found the active file
Finding a settings file does not prove that the running SumatraPDF copy uses it. Compare the command in the file with the value shown in the application's options. You can also make a harmless, reversible change through the application, close it, and check which settings file received an updated timestamp.
If no change is saved, check whether the file or its folder is read-only or whether your account lacks write access. With portable software placed in a protected folder, Windows permissions can prevent normal persistence. Move a test copy to a user-writable folder rather than weakening system-wide security.
6.3 Reset only what is necessary
Prefer correcting or removing the inverse-search setting over deleting the entire settings file. A full reset also removes unrelated preferences. If targeted repair is unsuccessful, rename the settings file while SumatraPDF is closed so that it can create a fresh one. Renaming is safer than immediate deletion because it preserves a rollback copy.
After the fresh file is created, configure only the editor command and test the minimal document. If inverse search works, one of the old settings was malformed or the old file was not writable. Restore other preferences gradually instead of copying the entire problematic file back.
7. Run a Clean Temporary Test Before Reinstalling
Reinstallation often leaves user settings untouched, so it may not repair a malformed inverse-search command. A clean temporary test provides stronger evidence with less disruption.
- Close all SumatraPDF instances.
- Back up the active settings file.
- Use a separate portable SumatraPDF copy in a writable temporary folder, or temporarily rename the active settings file.
- Configure only the verified editor executable and arguments.
- Open the minimal test PDF.
- Trigger inverse search at several locations.
If the clean test works, the editor and Windows can perform the launch. Compare the clean command and settings location with your normal setup. If the clean test fails in exactly the same way, test the expanded editor command outside SumatraPDF again and verify the editor's documented line option.
Reinstall only after confirming that the expected SumatraPDF executable itself is damaged or missing. Do not delete the original settings backup until the normal setup works and your preferences have been restored.
8. Quick Fix Checklist
- Confirm the configured editor executable exists at the exact saved path.
- Put plain double quotes around executable paths containing spaces.
- Include
%ffor the source filename and quote it. - Include
%lusing the syntax required by your editor. - Test the command with a real filename and line outside SumatraPDF.
- Reopen SumatraPDF options and confirm the corrected command was saved.
- Check whether File Explorer launches a different installed or portable SumatraPDF copy.
- Verify that portable editor paths and drive letters have not changed.
- Test a minimal project in a short, writable local folder.
- Back up
SumatraPDF-settings.txtbefore targeted editing or reset. - Ignore codecs, Ghostscript, and printer drivers unless rendering or printing also fails.
- Stop changing settings as soon as the intended file and line open consistently.
9. Frequently Asked Questions
9.1 Why does my editor open without the LaTeX file?
The executable portion of the command is probably valid, but the source-file argument is missing, malformed, or split at spaces. Confirm that the command includes %f and place plain double quotes around it. Then test with a source path containing spaces.
9.2 Why does the correct file open at the wrong line?
The editor may not recognize the line-number syntax. Confirm that %l appears in the position required by your editor's command-line interface. If the editor always returns to its previous cursor position, it may be ignoring the supplied line argument entirely.
9.3 Can Windows file associations configure inverse search?
No. A PDF association can determine which SumatraPDF executable opens when you double-click a PDF, which indirectly determines which settings are used. It does not replace the external editor command or provide file and line placeholders.
9.4 Why does the command work in one SumatraPDF window but not another?
You may be running installed and portable copies with separate settings files. Compare the executable launched by each shortcut and by the PDF association. Configure the copy that actually handles your documents.
9.5 Should I reinstall SumatraPDF when inverse search does nothing?
Not initially. First verify the editor path, arguments, quotes, settings persistence, and active SumatraPDF copy. Reinstallation may preserve the same incorrect user setting. A clean temporary test is usually more informative.
9.6 When should I stop troubleshooting?
Stop changing the inverse-search command when the intended editor opens the correct source file at the expected line in the minimal test and in your normal project. If the command works for the minimal project but not a particular document, investigate that project's source paths and mapping rather than resetting a working SumatraPDF configuration.