LaTeX forum ⇒ LEdPer project configuration of tools in LEd

Information and discussion about LEd, an integrated LaTeX environment for Windows
User avatar
Posts: 208
Joined: Fri Mar 14, 2008 12:58 pm

Per project configuration of tools in LEd

Postby T3. » Wed May 20, 2009 5:38 pm

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:
  1. @echo off
  2. setlocal
  3. %3
  4. cd %1
  5. set CD=
  6. if "%~dp0"=="%CD%\" (
  7. echo cannot be run from directory "%~dp0">&2
  8. exit /b 1
  9. )
  10. 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):
  1. @echo off
  2. setlocal
  3. set pdfview=C:\path\to\PDF-XChangeViewer
  4. echo on
  5. "%pdfview%\PDFXCview.exe" /close:discard "%~dpn1.pdf"
  6. pdflatex.exe %1



Return to “LEd”

Who is online

Users browsing this forum: No registered users and 1 guest