summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/latex/disser/templates/master/nomake.cmd
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/doc/latex/disser/templates/master/nomake.cmd')
-rw-r--r--Master/texmf-dist/doc/latex/disser/templates/master/nomake.cmd166
1 files changed, 166 insertions, 0 deletions
diff --git a/Master/texmf-dist/doc/latex/disser/templates/master/nomake.cmd b/Master/texmf-dist/doc/latex/disser/templates/master/nomake.cmd
new file mode 100644
index 00000000000..8ed500ecaa6
--- /dev/null
+++ b/Master/texmf-dist/doc/latex/disser/templates/master/nomake.cmd
@@ -0,0 +1,166 @@
+@echo off
+
+set target=thesis
+
+rem Checking for version of cmd.exe
+if %CMDEXTVERSION%/==/ (
+ echo Error: This script requieres command interpreter from Windows 2000 or above.
+ goto :eof
+)
+
+rem Trying to autodetect MiKTeX installation directory
+if %texmf%/==/ call :getdir HKCU\Software\MiK\MiKTeX\CurrentVersion\MiKTeX "Install Root" texmf
+if %texmf%/==/ call :getdir HKLM\Software\MiK\MiKTeX\CurrentVersion\MiKTeX "Install Root" texmf
+
+if %texmf%/==/ (
+ echo Error: Unable to find MiKTeX installation directory
+ echo You must set texmf value manually
+ goto :eof
+)
+
+rem Name of thesis class
+set clsname=disser
+set clssrc=%texmf%\tex\latex\%clsname%
+set clsdir=.\%clsname%
+
+rem Name of BibTeX style
+set bstsrc=%texmf%\bibtex\bst\%clsname%
+set bstfile=%clsname%.bst
+
+rem Cmdline tools
+set arc=rar
+set arcflags=a -r -x%target%.pdf -x%target%.prj
+
+set tex=%texmf%\miktex\bin\latex
+set texflags=-src-specials
+
+set bibtex=%texmf%\miktex\bin\bibtex8
+set bibtexflags=-B -c cp1251
+
+set epstool=%programfiles%\bin\eps\epstool
+set epstopdf=%texmf%\miktex\bin\epstopdf
+
+set pdftodjvu=pdftodjvu
+set pdftodjvuflags=--dpi=600 --threshold-level=80 --fg-quality=conservative --bg-subsample=3 --quality=65 --convert-links --fg-colors=256 --fg-image-colors=256
+
+set djvuocr=djvubundle
+set djvuocrflags=--ocr=lang=(Russian,English)
+
+set mktexlsr=%texmf%\miktex\bin\mktexlsr.exe
+
+set srcfiles=*.*
+set clfiles=*.bbl *.bak *.aux *.blg *.out *.toc *.log *.dvi *.tmp *.pdf %target%.%arc%
+set suffix=$$
+
+if %1/==/ (
+:make
+ %tex% %target%.tex
+ %bibtex% %bibtexflags% %target%
+ %tex% %target%.tex
+ %tex% %texflags% %target%.tex
+goto :eof
+)
+:start
+if %1/==/ goto :eof
+
+if %1/==pdf/ (
+:pdf
+ set tex=pdflatex
+ call :make
+)
+
+if %1/==srcdist/ (
+:srcdist
+ echo Making source distribution...
+ if not exist %clsdir% mkdir %clsdir%
+ xcopy %clssrc% %clsdir% /S
+ xcopy %bstsrc%\%bstfile% . /S
+ call :clean
+ %arc% %arcflags% %target%.%arc% %srcfiles%
+ del /s /q %clsdir%
+ rmdir /s /q %clsdir%
+ del /q %bstfile%
+goto :end
+)
+
+if %1/==clean/ (
+:clean
+ del /s %clfiles% 2> nul
+ if exist %target%.rar del %target%.rar
+goto :end
+)
+
+if %1/==cleansvn/ (
+:cleansvn
+ del /s .svn 2>nul
+goto :end
+)
+
+if %1/==fixbb/ (
+:fixbb
+ echo Fixing bounding boxes of EPS files...
+ for /f "usebackq" %%n in (`dir *.eps /s /b`) do call :fix %%n
+goto :end
+:fix
+ echo %1
+ %epstool% --copy --quiet --bbox %1 %1.%suffix%
+ move %1.%suffix% %1
+goto :eof
+)
+
+if %1/==epstopdf/ (
+:epstopdf
+ echo Converting EPS to PDF...
+ for /f "usebackq" %%n in (`dir *.eps /s /b`) do call :conv %%n
+ goto :end
+:conv
+ echo %1
+ %epstopdf% "%1"
+goto :eof
+)
+rem Installs requiered packages
+if %1/==install/ (
+:install
+ if not exist %clssrc% md %clssrc%
+ xcopy %clsdir%\ %clssrc%\ /Y
+ rmdir %clsdir%
+ if not exist %bstsrc% md %bstsrc%
+ move %bstfile% %bstsrc%
+ %mktexlsr%
+goto :end
+)
+rem Start default DVI-viewer
+if %1/==preview/ (
+:preview
+ if not exist %target%.dvi call :make
+ start %target%.dvi
+goto :end
+)
+rem Convert PDF to DjVu using LizardTech DocumentExpress Enterprise
+if %1/==djvu/ (
+:djvu
+ if not exist %target%.pdf call :pdf
+ %pdftodjvu% %pdftodjvuflags% %target%.pdf
+goto :end
+)
+rem Create OCRed DjVu file
+if %1/==ocr/ (
+:ocr
+ if not exist %target%.djvu call :djvu
+ %djvuocr% %djvuocrflags% %target%.djvu %target%-ocr.djvu
+goto :end
+)
+rem Create backup
+if %1/==backup/ (
+:backup
+ call :srcdist
+ for /f "usebackq" %%n in (`date`) do move %target%.rar %%n.rar
+goto :end
+)
+
+:end
+shift & goto :start
+
+:getdir
+ for /f "usebackq tokens=4 skip=2" %%i in (`reg query %1 /v %2`) do set %3=%%i
+goto :eof