1

I am able to successfully compile using XeLaTeX and view the resulting PDF in Sumatra with the following run code in Notepad++:

cmd /c cd /d "$(CURRENT_DIRECTORY)" && xelatex.exe "$(FILE_NAME)" & "C:\Program Files (x86)\SumatraPDF\SumatraPDF.exe" "$(CURRENT_DIRECTORY)\$(NAME_PART).pdf"

However, I have to manually save the file each time before running the script. Is there an additional command that I can insert at the beginning that saves the .tex file to the current directory? I'm not a programmer, so I'm probably missing something very simple. Here's an MWE for testing purposes:

\documentclass[12pt]{article}
\usepackage[utf8]{inputenc}
\usepackage{lipsum}
\begin{document}
\section{Notepad++ and \LaTeX}
\lipsum[3]
\end{document}
Henri Menke
  • 109,596

1 Answers1

1

Alright, the NPP_SAVEALL hint directed me to this question. I downloaded the NppExec plugin, manually extracted it to the plugins folder in Notepad++, and revised the run script to:

NPP_SAVEALL
cmd /c cd /d "$(CURRENT_DIRECTORY)" && xelatex.exe "$(FILE_NAME)" & "C:\Program Files (x86)\SumatraPDF\SumatraPDF.exe" "$(CURRENT_DIRECTORY)\$(NAME_PART).pdf"

Now it works: save, compile and view in one keyboard shortcut! Hope this helps someone else!