[Tex/LaTex] How to change the default editor (TeXworks) to WinEdt on MiKTeX 2.9

editorsmiktexwinedt

I am running one file in LaTeX (through MiKTeX) it is having error; when I am entering the errorstopmode 'e' on the console the TeX file is opening in the TeXworks editor, but I want to open in WinEdt, how to change the default editor in MiKTeX?

Best Answer

The first solution is that you reinstall WinEdt over the existing installation, and, during the same, you select "Associate TeX Filetypes with WinEdt".

enter image description here

The installer has admin privileges so this is the best way to go. Note that none of your customizations will be lost by this process.

A second way to go is to associate filetypes directly within WinEdt (not recommended unless you start WinEdt with admin privileges: Options -> Configuration Wizard -> Start WinEdt as Admin").

To do that open the Configuration Wizard (under the Options menu) and go to the "Filetypes Associations" tab.

There select "Modify filetypes associations" button (All or current user depending on the fact that you have admin privileges)

enter image description here

Then choose the filetypes you want to associate with WinEdt.

enter image description here

Note that you may have to restart your PC to make the changes effective.


Note also that if you are running latex through the command line this may not suffice.

In this case you have two options:

  1. Set the environmental variable MIKTEX_EDITOR to WinEdt, that is, in the command line write:

    set MIKTEX_EDITOR="C:\<winedt_path>\WinEdt.exe" "[Open(|%f|);SelPar(%l,7);]"
    
  2. Edit the MiKTeX configuration file and add a line for the "editor" value, that is, in the command line write:

    initexmf --edit-config-file=miktex
    

    and, in the file that gets opened, write

    editor="C:\<winedt_path>\WinEdt.exe" "[Open(|%f|);SelPar(%l,7);]"
    

    and then save.

Related Question