From: gronke@acpub.duke.edu (Paul Gronke)
Newsgroups: comp.text.tex
Subject: Norton Desktop Batch Files for emTeX programs
Date: 24 Jul 92 04:10:42 GMT
Organization: Duke University; Durham, N.C.

I have seen some queries about running emtex under windows.
Others came up with the same solution I did -- use Norton Desktop
or WinBatch (shareware) batch programs.  I posted these a few months
ago, i'll repeat them here.  The files contained are:

DROPTEX.WBT     This is a batch runner file that you can "drag/drop"
                .dvi or .tex files onto.  The program runs LaTeX
                if the file has a .tex extension, and asks you whether
                you want to print or view if the file has a .dvi
                extension.  The viewer used in DVIHPLJ/DVISCR.  Not pretty,
                but it works.  Have to make the command like "BATCHRUN
                DROPTEX.WBT" so that the filename is passed on param1.

DVI.WBT         This is a batch runner file for .dvi file viewing and printing
                which is which is intended to be added
                to the "Launch List" in Norton Desktop.  It prompts you
                for a series of DVIHPLJ/DVISCR parameters, thus allowing
                two sided, selected pages, etc. printing.

DVI.WBD, SELECT.WBD are dialog boxes called from within DVI.WBT

---------- cut here for droptex.wbt ------------
filer="%param1%"
filelen=StrLen(filer)
dirstrip=StrScan(filer,"\",%filelen%,@BACKSCAN)
dirstrip1=dirstrip+1
file1len=filelen-dirstrip
filer1=StrSub(filer,%dirstrip1%,%file1len%)
extstart=file1len-2
extens=StrSub(filer1,%extstart%,3)
dir=StrSub(filer,1,%dirstrip%)
DirChange("%dir%")
if extens=="tex" Then Run("d:\emtex\latex.bat","%filer1%")
if extens=="tex" Then Exit
if extens=="dvi" Then porv=AskLine("Print_or_View","p(rint) or v(iew)?","")
if porv=="p" Then Run("d:\emtex\p.pif","%param1%")
if porv=="v" Then Run("d:\emtex\v.bat","%param1%")
----------end of droptex.wbt ----------------
----------cut here for dvi.wbt --------------
; dvi.wbt - runs DVISCR or DVIHPLJ, the emTeX dvi viewer
; and printer.
;
; First, runs a dialog box to ask user whether he/she wants
; to view or print.  Dialog box also allows setting a 
; variety of program parameters.  Most times users will
; just want to take the defaults.
; 
; Then, the program asks for directory and subdirectory
; of the dvi file, defaulting to dissertation directory
; for now.
;
; Table of variables:
;       pg = default directory for graphic files, /pg:=c:\emtex\docs\graphs
;       pt = name of log file, "/pt" suppresses, "/pt=filename" otherwise
;       nf = "/nf#" print file # times (not supported in dviscr)
;       b, e = start selection (/b) end selection (/e) (/b*, /e* defaults)
;       two = two sided printing, "/2o" (odd sides), "/2e" (even sides)
;       sel = special printing, calls another dialog box
;       viewer = view file or print file
;
; Initialize the default variables:
pg = 1
pt = 1
nf = 1
b = "*"
e = "*"
pg1 = "d:\emtex\docs"
two1=0
sel=0
viewer=0
:start
DialogBox("View or Print the dvi file?","dvi.wbd")
;
; Use conditionals and new dialog box
; to change defaults
;
If pg == 0 Then pg1=AskLine("Graph Directory","Enter full dir path for graphic files"," ")
pg2=StrCat("/pg:","%pg1%")
If pt == 1 Then pt = "/pt"
If pt == 0 Then pt = " "
If sel == 1 Then DialogBox("Special Printing","select.wbd")
two1=""
If twoodd == 1 Then two1="/2o"
If twoeven == 1 Then two1="/2e"
;
; DEFAULT DIRECTORY c:\emtex\docs
;
DirChange("c:\emtex\docs")
currdir=DirGet ( )
q=AskYesNo("Choose Directory","Use Default Doc Directory (%currdir%)?")
if q == @YES Then Goto getfile
DirChange("\")
;
; NOW SELECT ANOTHER DIRECTORY FOR DVI FILE
;
:getdir
subdirs=DirItemize("*.*")
If subdirs=="" Then Goto getfile
targdir=ItemSelect("What directory for dvi File? (OK = current)",subdirs," ")
If targdir == "" Then Goto getfile
DirChange(targdir)
Goto getdir
;
; NOW SELECT INPUT FILE
;
:getfile
files=FileItemize("*.dvi")
texfile = ItemSelect("Select File to Process:",files," ")
If texfile=="" Then Goto getfile
;
; Now Check for output to printer or File, use TEXFILE as default
;
po1 = "prn"
If po == 2 Then po1=AskLine("Print to File","Print Output File:","%texfile%.hp")
po2=StrCat("/po:","%po1%")
;
; NOW RUN THE PROGRAM
;
If viewer==1 Then Run("c:\emtex\dviscr","@hplj.cnf /fi /s4 /ocr=1 /fl=-1 %pt% %pg2% /b%b% /e%e% %two1% %texfile%")
If viewer==2 Then Run("c:\emtex\dvihplj.pif","@hplj.cnf /fb /fl=-1 %pt% %po2% %pg2% /b%b% /e%e% /nf%nf% %two1% %texfile%")
------------ end dvi.wbt ---------------
------------cut here for dvi.wbd, dialog box #1 ---------

[viewer^1DVI to screen]          [viewer^2DVI to printer]

[pg+1Graphics c:\emtex\docs\graphs] [pt+1Suppress Log File]
          
Special Options:
[po^1Output to Printer]          [sel+1Special Selection?]
[po^2Output to file]             (Selected Pages?)
                                 (Multiple Copies?)
Two Sided Printing:
[twoodd+1Odd Sides (do first)]
[twoeven+1Even Sides (do second)]
--------------end dvi.wbd ------------------
-------------cut here for select.wbd, dialog box #2 -------

Start Selection:                    [b#   ]
End Selection:                      [e#   ]

Number of Copies (default is 1):    [nf#  ]
-------------end select.wbd ----------------------
Newsgroups: comp.text.tex