Texmaker and WinEdt with Foxit PDF Reader

This shows how to customize the Foxit PDF Reader as the PDF viewer for Texmaker and WinEdt.

=============================
Texmaker with Foxit PDF Reader
=============================
1. Make a MSDOS batch file called "viewpdf.bat" in its installation folder with the following lines:

taskkill -fi "windowtitle eq %1*"
start %1
REM "C:\Program Files\Foxit Software\Foxit Reader\Foxit Reader.exe" %1

2. If Foxit PDF Reader is not your default PDF viewer, comment out the second the line, uncomment the third line and make sure the path to the Foxit PDF reader is correct in the "viewpdf.bat".

3. Then open Texmaker and go to "options -> Configure Texmaker" and change the "PDF viewer" to "viewpdf.bat" using the program browsing button.

=============================
WinEdt with Foxit PDF Reader
=============================
Reference: alternative PDF viewer in WinEdt 5.3

1. Add to "Startup.edt" located at PATH_TO_WinEDT\Local\ the following two lines

Assign('AcroRead','"C:\Program Files\Foxit Software\Foxit Reader\Foxit Reader.exe"');
Assign("Acro-Title","Foxit Reader");

and make sure the path to Foxit PDF Reader is correct.

2. Open WinEdt and go to "Macros -> Run startup macro" to refresh the PDF viwer.

3. Add to "Acrobat OpenDoc.bat" located at the PATH_TO_WinEDT\Exec\ the following two lines under "PushTagsandRegisters;":

// Foxit?

FindInString(`%$('AcroRead');`,'Foxit',1,2,1000,1);
IfOK(!"Relax;",!"JMP('not_foxit')");
Run('taskkill -fi "windowtitle eq %N.pdf*"','%P',0,1);
Run('%$("AcroRead"); "%P\%N.pdf"');
RestoreRegisters(1111111111);
Exit;

:not_foxit::

4. Add to "Acrobat CloseDoc.bat" located at the PATH_TO_WinEDT\Exec\ the following two lines under "Requires(20040114);":

// Foxit?
FindInString(`%$('AcroRead');`,'Foxit',1,2,1000,1);
IfOK(!"Relax;",!"JMP('not_Foxit')");
LetRegNum(1,0);
:next_Foxit::
LetRegNum(1,%!1+1);>
IfNum(%!1,99,'>',!"JMP('closed_Foxit')");>
SendMessage("%N - Foxit",$0111,$E152);
IfOK(!"JMP('closed_Foxit')",!"Relax;");
SendMessage("- Foxit",$0111,$E151);
JMP('next_Foxit');
:closed_Foxit::
RestoreRegisters(1111111111);
Exit;
:not_Foxit::

=============================
Automate TeXing with WinEdt
=============================
1. Write a macro called "PDFLatexMacro.edt" as below

Do("Exe('%b\Exec\MikTeX\PDFLaTeX.edt');");
IfOK(!"Relax;",!"JMP('not_SUCCESS')");

Do("Exe('%b\Exec\MikTeX\BibTeX.edt');");
IfOK(!"Relax;",!"JMP('not_SUCCESS')");

Do("Exe('%b\Exec\MikTeX\PDFLaTeX.edt');");
IfOK(!"Relax;",!"JMP('not_SUCCESS')");

Do("Exe('%b\Exec\MikTeX\PDFLaTeX.edt');");
IfOK(!"Relax;",!"JMP('not_SUCCESS')");

Do("Exe('%b\Exec\Acrobat OpenDoc.edt');");

:not_SUCCESS:: // jump to end
End;

and a macro called "DVILatexMacro.edt" as below

Do("Exe('%b\Exec\MikTeX\LaTeX.edt');");
IfOK(!"Relax;",!"JMP('not_SUCCESS')");

Do("Exe('%b\Exec\MikTeX\BibTeX.edt');");
IfOK(!"Relax;",!"JMP('not_SUCCESS')");

Do("Exe('%b\Exec\MikTeX\LaTeX.edt');");
IfOK(!"Relax;",!"JMP('not_SUCCESS')");

Do("Exe('%b\Exec\MikTeX\LaTeX.edt');");
IfOK(!"Relax;",!"JMP('not_SUCCESS')");

Do("Run(|%$('DVIView'); -1 ""%P\%N.dvi""|);");

:not_SUCCESS:: // jump to end
End;

and place them under PATH_TO_WinEDT\Macros\Recorder\.

2. Open WinEdt, go to "Options -> Menu Setup", double-click "&Tools", and then right-click the menu items to insert the two macros above.

No comments: