Hello!
Here is my batchscript for compyling LaTeX branch documents.
The branch documents need to be texworks-conform,
they need a line like this:
% !teX rooT = main_document_name.tex
My batch script need a specific grep.exe version,
sorry you have to look for it on your own, I think
I found it in a file called: "UnxUtils.zip".

Jan,
may there be chance, that you implement 
"inverse search" for the PSpad in combination
with "evince"? As I understand it, is this viewer
prepared to work as slave.

Kind regards,

ellocco

@ECHO OFF
REM
********************************************************************************
****************
REM ***  Stefan Pofahl, 03-Mai-2010, batch file for LaTeX processing with
editors like psPAD.exe ***
REM ***  If you want to compile a latex branch document add a line like         
                ***
REM ***  % !teX rooT = main_document_name.tex                                   
                ***
REM ***  (this is the same syntax, that is used in "TeXWorks" for branch
documents)              ***
REM
********************************************************************************
****************
REM ***  This File needs grep (GNU grep) 2.5.1 in the search path.              
                ***
REM ***  Other grep version may be not compatible                               
                ***
REM ***  It is only tested on MS-Windows XP                                     
                ***
REM
********************************************************************************
****************
REM
********************************************************************************
****************
REM ***  Latex-Command you want to use:                                         
                ***
REM
................................................................................
................
SET latexcmd=texify.exe --pdf
SET pdfviewer=C:\Programme\Evince\2.30.0\bin\evince.exe -w
REM
################################################################################
################

SET _PF1=%tmp%\_pf1.tmp
SET _PF2=%tmp%\_pf2.tmp
SET _OF=%tmp%\_.tmp

REM if you use batch command "ECHO" be careful with specific chars like:
^,%,(,),<,>
ECHO.%% ![etxETX]{3} [rotROT]{4}.[=" "a-zA-Z_]*[.][etxETX]{3}> %_PF1%
REM type %_PF1%
ECHO.[a-zA-Z_]*[.][etxETX]{3}> %_PF2%
REM type %_PF2%
REM ---
REM The file should have the extention .tex
IF /i NOT "%~x1"==".tex" (
  ECHO.It seems to be no LaTeX-File!
  REM If you want to have a Pop-Up-Window uncomment the next line, 
  REM but please read info about msg.exe (option star "*" may anoy other users)
  REM msg * /TIME:0 /w %1 seems to be no LaTeX-File!
  GOTO :EOF
)
REM ---
REM if you use grep switch -o (--only-matching: show only the part of a line
matching PATTERN)
REM the switch -i is for my grep version without relevance, but I leave it
there.
REM Search for a line: "% !teX rooT = *.tex" if not there the argument file is
the master file
grep  -a -i -o -E --file=%_PF1% %1 >nil
IF NOT %ERRORLEVEL%==0 ( 
  ECHO No Master file given.
  SET main=%1  
) ELSE (
  grep  -a -i -o -E --file=%_PF1% %1 |grep -i -o -E --file=%_PF2% >%_OF% 
  SET /P main=<%_OF% 
)
REM strip file extention:
call :stripext %main%
REM check if Master file is there:
call :fileexist %main%
REM ---
:END
GOTO :EOF
REM
################################################################################
###############
REM ***               END main part, begin of procedure section                 
               ***
REM
................................................................................
...............
:stripext
  REM ECHO stripext %~1
  SET JOB=%~n1
  GOTO :EOF
  
:fileexist
  REM ECHO fileexist %1
  IF NOT EXIST %1 (
    ECHO.Master file not found!
    GOTO :END
  ) ELSE (
    GOTO :compiletex
  )
  GOTO :EOF

:compiletex
  ECHO.
  ECHO ---
  ECHO LaTeX command is: %latexcmd% %main%
  ECHO.
  REM ---
  call %latexcmd% %main%
  ECHO.IF exist %JOB%.pdf call %pdfviewer% %JOB%.pdf
  IF exist %JOB%.pdf %pdfviewer% %JOB%.pdf
  ECHO --- Done! ---
  GOTO :EOF 
REM
################################################################################
###############
REM ***               END of batch script                                       
               ***
REM
################################################################################
############### 


-- 
<http://forum.pspad.com/read.php?2,19398,53723>
PSPad freeware editor http://www.pspad.com

Odpovedet emailem