4

I use WinEdt 10.1 and Sumatrapdf. I find the inverse search extremely useful. However, the .synctex files are quite annoying to me because I work within a folder which contains up to a hundred latex files (and I arrange the files according to the time modified). In WinEdt, there is an option to put all the auxiliary files to a folder called "TeXAuX" which is very neat but somehow the .synctex file has to be in the same directory as the .tex file.

So my question is, is there a way (preferably by modifying the "compile" command within WinEdt's option) to change the attribute of the .synctex file to "hidden" immediately after compilation?

Thanks in advance!

  • Welcome to TeX SX! I don't know, but I would find it quite useful too that .synctex files might be located in a subdirectory of the main file directory. – Bernard Jul 14 '17 at 19:08
  • 3
    That probably could be done on the TeX side, but how would SumatraPDF or other previewer know where to find the .synctex file? – egreg Jul 14 '17 at 19:13
  • 2
    @egreg, the OP doesn't want to move the .synctex file, but only to set its file attribute to "hidden". – karlkoeller Jul 15 '17 at 6:11
  • Crosspost – Johannes_B Jul 15 '17 at 12:45
5

There's no WinEdt macro that acts on the file attributes.

However we can tell WinEdt to use the attrib DOS command to achieve what you want.

These are the steps you have to follow:

  1. Open the file %B\Exec\ExeCompilerPost.edt in WinEdt (%B is the directory where you've installed the program, something like C:\Program Files\WinEdt Team\WinEdt 10).
  2. Show the "Options Interface" (Options -> Options Interface) and click on "Advanced Configuration":

    enter image description here

  3. Now, in the Options Interface toolbar, click on the button "Create and Open Local Copy":

    enter image description here

  4. A local copy of ExeCompilerPost.edt gets opened. In this file search for the following lines near the end of the file:

        IfFileExists("%O\%N.%!7",!"CopyFile('%O\%N.%!7','%P\%N.%!7',1);DeleteFile('%O\%N.%!7');");
        IfFileExists("%O\%N%$('PDF-SyncEx');",>
          !"CopyFile('%O\%N%$(|PDF-SyncEx|);','%P\%N%$(|PDF-SyncEx|);',1);DeleteFile('%O\%N%$(|PDF-SyncEx|);');");
      JMP(!"Post_Done");
    
  5. Replace these lines with the following:

        IfFileExists("%O\%N.%!7",!"CopyFile('%O\%N.%!7','%P\%N.%!7',1);DeleteFile('%O\%N.%!7');");
        IfFileExists("%O\%N%$('PDF-SyncEx');",>
          !"CopyFile('%O\%N%$(|PDF-SyncEx|);','%P\%N%$(|PDF-SyncEx|);',1);DeleteFile('%O\%N%$(|PDF-SyncEx|);');");
        IfFileExists("%P\%N%$('PDF-SyncEx');",>
          !"WinExe('','cmd.exe /C attrib +h %N%$(|PDF-SyncEx|);','%P','',011100);");
      JMP(!"Post_Done");
    
  6. Save the file and you're done.


Now, every time you compile a file, the associated synctex file is saved as a hidden file.

|improve this answer|||||
  • What is the idea behind step 1? Why open the original too? – Ulrike Fischer Jul 15 '17 at 10:11
  • @UlrikeFischer It is very likely that a local copy of ExeCompilerPost.edt doesn't exist in the OP's system. Unless you manually created it, only the ChkTeX add-on creates a local copy and modifyes it. – karlkoeller Jul 15 '17 at 11:24
  • Ah I see. I hadn't realized that there is no entry for the file in the option menu to "double click". – Ulrike Fischer Jul 15 '17 at 12:37
0

You can use -output-directory="output" (right side is dir name) parameter, like

xelatex -synctex=1 -interaction=nonstopmode -output-directory="output" "something.tex"

so that your outupt will be placed in separate directory, but directory must exist, so that it can write in it. But I am not sure how it will work with inverse search.

|improve this answer|||||

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.