While doing recently some LaTeX writing in LEd, I found the supplied batches for calling different tools somewhat awkward in use. I wanted to have differently configured tools on per project/file basis and, since other people might have similar desire, here's how this can be done.
Replace the default batches in <LEd dir>\Batches with the following generic batch:
Code: Select all
@echo off
setlocal
%3
cd %1
set CD=
if "%~dp0"=="%CD%\" (
echo cannot be run from directory "%~dp0">&2
exit /b 1
)
call %~n0 %2
The whole idea behind the above batch is to call, e.g. 'pdflatex ...' rather than 'pdflatex.exe ...'. While this might seem like a cosmetic change, it does in fact make a lot of difference if there is a wrapper script 'pdflatex.bat' (or any other executable format for that matter) present in the current directory or on the search path. If the wrapper is found before pdflatex.exe it will be called instead. It goes without saying that the same trick can be used for any other tool supported by LEd.
As an example I used the following pdflatex.bat (placed together with the main .tex file) to work smoothly with PDF-XChange viewer (see also
this topic):
Code: Select all
@echo off
setlocal
set pdfview=C:\path\to\PDF-XChangeViewer
echo on
"%pdfview%\PDFXCview.exe" /close:discard "%~dpn1.pdf"
pdflatex.exe %1
Cheers,
Tomek