2

I use winedt to edit tex, and xelatex to compile. It works fine for a long time. But for some unknow reasons, I recently found that winedt often get stuck when I click the xelatex compilation button. This is really annoying. But I just don't know why.

So I looks for other method that is to use winedt marco to directly call xelatex. This is the macro I used now

SaveDoc(1);
Run('xelatex.exe --shell-escape --synctex=-1 "%N%T"','%P',0,0,'LaTeX ...',0,0,1);
Run('"C:\Program Files (x86)\SumatraPDF\SumatraPDF.exe" "%P\%N.pdf"','%P') 

The Run command is basically calling windows CMD.exe to run command. It works fine except that the forward pdf search is not working. Does anyone know how to make forward pdf search in CMD command?

  • Ask on winedt+list@wsg.net. Forward search with MiKTeX/standard LaTeX + Sumatra work fine (as advertised). What you use for PDF viewing? – Zarko May 29 '15 at 6:25
  • @Bernard Didn't work for me. Ctril+F8 is for what? – user15964 May 29 '15 at 10:48
  • @user15964: Sorry, I made a mistale: the actual shortcut for forward search in .pdf files is Shift+F8. – Bernard May 29 '15 at 14:35
3

This answer comes a bit late, so I hope you have solved your problem with xelatex in the meantime.

However, for the sake of completeness and to remove this question from the unanswered list, here is how you must proceed.

The SumatraPDF command to initiate a forward search is -forward-search, so the right call to the WinEdt macro Run must be, in your case:

  Run('%$("PDF-View"); -reuse-instance "%P\%N.pdf" '+>
      '-forward-search "%p\%n%t" %!l '+>
      '-inverse-search "\"%B\WinEdt.exe\" \"[Open(|%%f|);SelPar(%%l,8);]\""','%P');

"%p\%n%t" %!l indicates the file and its line from where the forward search should start.

The -inverse-search command tells SumatraPDF to use WinEdt again for inverse search, while -reuse-instance tells SumatraPDF not to open a new window if one is already opened.

Note that I have substituted the full path to SumatraPDF with %$("PDF-View"); which is the WinEdt variable where the default PDF reader is stored.

If this is not your case, simply substitute that with the full path:

  Run('"C:\Program Files (x86)\SumatraPDF\SumatraPDF.exe" '+>
      '-reuse-instance "%P\%N.pdf" '+>
      '-forward-search "%p\%n%t" %!l '+>
      '-inverse-search "\"%B\WinEdt.exe\" \"[Open(|%%f|);SelPar(%%l,8);]\""','%P');

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.