diff options
Diffstat (limited to 'Master/texmf-dist/doc/latex/disser/include')
4 files changed, 338 insertions, 215 deletions
diff --git a/Master/texmf-dist/doc/latex/disser/include/latex.fig.mk b/Master/texmf-dist/doc/latex/disser/include/latex.fig.mk index 9c77cdde874..41cfdecd501 100644 --- a/Master/texmf-dist/doc/latex/disser/include/latex.fig.mk +++ b/Master/texmf-dist/doc/latex/disser/include/latex.fig.mk @@ -3,74 +3,93 @@ # Author: Stanislav Kruchinin <stanislav.kruchinin@gmail.com> # -E2E?=eps2eps -EPSTOOL?=epstool -EPSTOPDF?=epstopdf -GS?=gs +BMTOEPS ?= sam2p +E2E ?= eps2eps +EPSTOOL ?= epstool +EPSTOPDF ?= epstopdf +GS ?= gs -E2EFLAGS?=-dSAFER -ETFLAGS?=--quiet --copy --bbox -RES?=600 +BMTOEPSFLAGS ?= +E2EFLAGS ?= -dSAFER -dNOCACHE +ETFLAGS ?= --quiet --copy --bbox +RES ?= 600 -E2EFILES?=*.eps -E2PFILES?=*.eps -FBBFILES?=*.eps -PDF2PNGFILES?=*.pdf -PDF2TIFFILES?=*.pdf -FIGCLFILES?=*.pdf *.png *.tif -SUFFIX?=~ +BMTOEPSFILES ?= $(wildcard *.jpg *.png *.tif) +E2PFILES ?= *.eps +FBBFILES ?= *.eps +FIGCLFILES ?= *.pdf *.jpg *.png *.tif +OPTFILES ?= *.eps +PDF2PNGFILES ?= *.pdf +PDF2TIFFILES ?= *.pdf +PREFIX ?= ~ -# end of configuration help: - @echo " clean clean PDF, PNG and TIFF files" - @echo " epstoeps optimize EPS files using Ghostscript" - @echo " epstopdf convert EPS to PDF" - @echo " fixbb fix BoundingBox of EPS files" - @echo " help (default) show description of targets" - @echo " pdftopng256 convert PDF to PNG (256-color)" - @echo " pdftotiffg4 convert PDF to TIFF (b/w CCITT Group 4)" + @echo " bmtoeps convert bitmap images to EPS format" ;\ + echo " clean remove output files" ;\ + echo " epstoeps alias for optimize target" ;\ + echo " epstopdf convert EPS to PDF" ;\ + echo " fixbb fix BoundingBox of EPS files" ;\ + echo " help show description of targets" ;\ + echo " optimize optimize EPS files (implies fixbb)" ;\ + echo " pdftopng256 convert PDF to PNG (256-color)" ;\ + echo " pdftotiffg4 convert PDF to TIFF (b/w CCITT Group 4)" -clean: - rm -f $(FIGCLFILES) - -epstoeps: $(E2EFILES) - @for f in $^ ;\ - do \ - echo -n "fixbb: $$f..." ;\ - $(E2E) $(E2EFLAGS) $$f $$f$(SUFFIX) ;\ - mv $$f$(SUFFIX) $$f ;\ +bmtoeps: $(BMTOEPSFILES) + @for f in $^ ; do \ + echo -n "bmtoeps: $$f..." ;\ + $(BMTOEPS) $(BMTOEPSFLAGS) "$$f" "$${f%.*}.eps" > /dev/null 2>&1 ;\ echo "done" ;\ done +clean: + -rm -f $(FIGCLFILES) + +epstoeps: optimize + epstopdf: $(patsubst %.eps, %.pdf, $(wildcard $(E2PFILES))) fixbb: $(FBBFILES) - @for f in $^ ;\ - do \ + @for f in $^ ; do \ echo -n "fixbb: $$f..." ;\ - $(EPSTOOL) $(ETFLAGS) $$f $$f$(SUFFIX) ;\ - mv $$f$(SUFFIX) $$f ;\ + $(EPSTOOL) $(ETFLAGS) "$$f" "$(PREFIX)$$f" ;\ + mv "$(PREFIX)$$f" "$$f" ;\ echo "done" ;\ done +optimize: $(OPTFILES) + @for f in $^ ; do \ + echo -n "optimize: $$f..." ;\ + $(E2E) $(E2EFLAGS) "$$f" "$(PREFIX)$$f" ;\ + $(EPSTOOL) $(ETFLAGS) "$(PREFIX)$$f" "$(PREFIX)1$$f" ;\ + mv "$(PREFIX)1$$f" "$(PREFIX)$$f" ;\ + if [ `stat -c%s $$f` -gt `stat -c%s $(PREFIX)$$f` ] ; then \ + mv "$(PREFIX)$$f" "$$f" ;\ + echo "done" ;\ + else \ + rm "$(PREFIX)$$f" ;\ + echo "does not need optimization" ;\ + fi ;\ + done + pdftopng256: $(patsubst %.pdf, %.png, $(wildcard $(PDF2PNGFILES))) pdftotiffg4: $(patsubst %.pdf, %.tif, $(wildcard $(PDF2TIFFILES))) %.pdf: %.eps - @echo -n "epstopdf: $^..." - @$(EPSTOPDF) "$^" - @echo "done" + @echo -n "epstopdf: $^..." ;\ + $(EPSTOPDF) "$^" ;\ + echo "done" %.png: %.pdf - @echo -n "pdftopng256: $^..." - @$(GS) -sDEVICE=png256 -r$(RES) -q -sOutputFile=$(^:.pdf=.png) \ - -dNOPAUSE -dBATCH -dSAFER "$^" - @echo "done" + @echo -n "pdftopng256: $^..." ;\ + $(GS) -sDEVICE=png256 -r$(RES) -q -sOutputFile=$(^:.pdf=.png) \ + -dNOPAUSE -dBATCH -dSAFER "$^" ;\ + echo "done" %.tif: %.pdf - @echo -n "pdftotiffg4: $^..." - @$(GS) -sDEVICE=tiffg4 -r$(RES) -q -sOutputFile=$(^:.pdf=.tif) \ - -dNOPAUSE -dBATCH -dSAFER "$^" - @echo "done" + @echo -n "pdftotiffg4: $^..." ;\ + $(GS) -sDEVICE=tiffg4 -r$(RES) -q -sOutputFile=$(^:.pdf=.tif) \ + -dNOPAUSE -dBATCH -dSAFER "$^" ;\ + echo "done" + diff --git a/Master/texmf-dist/doc/latex/disser/include/latex.fig.nmk.cmd b/Master/texmf-dist/doc/latex/disser/include/latex.fig.nmk.cmd index a79a74ab838..9f860cb49c8 100644 --- a/Master/texmf-dist/doc/latex/disser/include/latex.fig.nmk.cmd +++ b/Master/texmf-dist/doc/latex/disser/include/latex.fig.nmk.cmd @@ -4,94 +4,149 @@ rem nomake script for EPS figures rem Author: Stanislav Kruchinin <stanislav.kruchinin@gmail.com> if "%CMDEXTVERSION%"=="" ( - echo Error: This script requires command interpreter from Windows 2000 or above. + echo This script requires command interpreter from Windows 2000 or above. goto :eof ) -if "%e2e%"=="" set e2e=eps2eps -if "%epstool%"=="" set epstool=epstool +setlocal enabledelayedexpansion + +if "%bmtoeps%"=="" set bmtoeps=sam2p +if "%e2e%"=="" set e2e=eps2eps +if "%epstool%"=="" set epstool=epstool if "%epstopdf%"=="" set epstopdf=epstopdf -if "%gs%"=="" set gs=gswin32c +if "%gs%"=="" set gs=gswin32c -if "%e2eflags%"=="" set e2eflags=-dSAFER -if "%etflags%"=="" set etflags=--quiet --copy --bbox -if "%res%"=="" set res=600 +if "%e2eflags%"=="" set e2eflags=-dSAFER -dNOCACHE +if "%etflags%"=="" set etflags=--quiet --copy --bbox +if "%res%"=="" set res=600 -if "%e2efiles%"=="" set e2efiles=*.eps -if "%e2pfiles%"=="" set e2pfiles=*.eps +if "%bmtoepsfiles%"=="" set bmtoepsfiles==*.jpg *.png *.tif +if "%e2pfiles%"=="" set e2pfiles=*.eps +if "%fbbfiles%"=="" set fbbfiles=*.eps +if "%figclfiles%"=="" set figclfiles=*.pdf *.jpg *.png *.tif +if "%optfiles%"=="" set optfiles=*.eps if "%pdf2pngfiles%"=="" set pdf2pngfiles=*.pdf if "%pdf2tiffiles%"=="" set pdf2tiffiles=*.pdf -if "%fbbfiles%"=="" set fbbfiles=*.eps -if "%figclfiles%"=="" set figclfiles=*.pdf *.png *.tif -if "%suffix%"=="" set suffix=~ +if "%prefix%"=="" set prefix=~ -rem end of configuration - -setlocal enabledelayedexpansion if "%1"=="" ( -:default call :help -goto :eof -) else if "%1"=="help" ( +) else ( + for %%f in (%*) do call :%%f +) + +exit /b + :help - echo clean clean PDF, PNG and TIFF files - echo epstoeps optimize EPS files using Ghostscript + echo bmtoeps convert bitmap images to EPS format + echo clean remove output files + echo epstoeps alias for optimize target echo epstopdf convert EPS to PDF echo fixbb fix BoundingBox of EPS files echo help ^(default^) show description of targets + echo optimize optimize EPS files ^(implies fixbb^) echo pdftopng256 convert PDF to PNG ^(256-color^) echo pdftotiffg4 convert PDF to TIFF ^(b/w CCITT Group 4^) goto :eof -) else if "%1"=="clean" ( + +:bmtoeps + for %%f in (!bmtoepsfiles!) do ( + if not exist "%%~nf.eps" ( + %bmtoeps% %bmtoepsflags% "%%f" "%%~nf.eps" > nul 2>&1 + echo bmtoeps: %%f + ) + ) +goto :eof + :clean - del /s %figclfiles% + del /s !figclfiles! goto :eof -) else if "%1"=="epstoeps" ( + :epstoeps - for %%f in (!e2efiles!) do ( - %e2e% %e2eflags% "%%f" "%%f%suffix%" - move "%%f%suffix%" "%%f" > nul - echo epstoeps: %%f - ) + call :optimize goto :eof -) else if "%1"=="epstopdf" ( + :epstopdf for %%f in (!e2pfiles!) do ( - if not exist "%%~nf.pdf" ( + call :cmptimes %%~nf.pdf %%f + if !_ctres!==1 ( %epstopdf% "%%f" echo epstopdf: %%f ) ) -goto :eof -) else if "%1"=="fixbb" ( +goto :eof + :fixbb for %%f in (!fbbfiles!) do ( - %epstool% %etflags% "%%f" "%%f%suffix%" - move "%%f%suffix%" "%%f" > nul + %epstool% %etflags% "%%f" "%prefix%%%f" + move "%prefix%%%f" "%%f" > nul echo fixbb: %%f ) goto :eof -) else if "%1"=="pdftopng256" ( + +:optimize + for %%f in (!optfiles!) do ( + %e2e% %e2eflags% "%%f" "%prefix%%%f" + %epstool% %etflags% "%prefix%%%f" "%prefix%1%%f" + move "%prefix%1%%f" "%prefix%%%f" > nul + call :cmpsizes "%%f" "%prefix%%%f" + if !_csres!==1 ( + move "%prefix%%%f" "%%f" > nul + echo optimize: %%f + ) else ( + del /q "%prefix%%%f" + echo optimize: %%f does not need optimization + ) + ) +goto :eof + :pdftopng256 - if "%2" neq "" set pdf2pngfiles=%2 %3 %4 %5 %6 %7 %8 %9 for %%f in (!pdf2pngfiles!) do ( - if not exist "%%~nf.png" ( - %gs% -sDEVICE=png256 -r%res% -q -sOutputFile=%%~nf.png -dNOPAUSE -dBATCH -dSAFER "%%f" + call :cmptimes "%%~nf.png" "%%f" + if !_ctres!==1 ( + %gs% -sDEVICE=png256 -r%res% -q -sOutputFile=%%~nf.png -dNOPAUSE ^ + -dBATCH -dSAFER "%%f" echo pdftopng256: %%f ) ) -goto :eof -) else if "%1"=="pdftotiffg4" ( +goto :eof + :pdftotiffg4 - if "%2" neq "" set pdf2tiffiles=%2 %3 %4 %5 %6 %7 %8 %9 for %%f in (!pdf2tiffiles!) do ( - if not exist "%%~nf.tif" ( - %gs% -sDEVICE=tiffg4 -r%res% -q -sOutputFile=%%~nf.tif -dNOPAUSE -dBATCH -dSAFER "%%f" + call :cmptimes "%%~nf.tif" "%%f" + if !_ctres!==1 ( + %gs% -sDEVICE=tiffg4 -r%res% -q -sOutputFile=%%~nf.tif -dNOPAUSE ^ + -dBATCH -dSAFER "%%f" echo pdftotiffg4: %%f ) ) -goto :eof -) else ( - echo Don't know how to make %1 -) +goto :eof + +:cmptimes + set _ctfiles=%* + set _ctoutf=%~1 + if not exist %_ctoutf% ( + set _ctres=1 + goto :eof + ) + for /f "usebackq" %%f in (`dir /b /t:w /o:-d %_ctfiles%`) do ( + set _ctnewest=%%f + goto :_ctbreak + ) + :_ctbreak + + if "%_ctoutf%"=="%_ctnewest%" ( + set _ctres=0 + ) else ( + set _ctres=1 + ) +goto :eof + +:cmpsizes + if %~z1 GTR %~z2 ( + set _csres=1 + ) else ( + set _csres=0 + ) +goto :eof diff --git a/Master/texmf-dist/doc/latex/disser/include/latex.mk b/Master/texmf-dist/doc/latex/disser/include/latex.mk index b0269945088..e93fadcc4ab 100644 --- a/Master/texmf-dist/doc/latex/disser/include/latex.mk +++ b/Master/texmf-dist/doc/latex/disser/include/latex.mk @@ -3,49 +3,58 @@ # Author: Stanislav Kruchinin <stanislav.kruchinin@gmail.com> # -TARGET?=thesis -BIBFILE?=thesis.bib - -ARCH?=7z -BIBTEX?=bibtex8 -DVIPS?=dvips -L2H?=latex2html -L2RTF?=latex2rtf -LATEX?=latex -PDFLATEX?=pdflatex -PS2PDF?=gs -PSBOOK?=psbook -PSNUP?=psnup - -ARCHEXT?=zip -ARCHFLAGS?=a -t$(ARCHEXT) -ARCHIVE?=$(TARGET).$(ARCHEXT) -BIBTEXFLAGS?=-H -c cp1251 - -L2HFLAGS?=-dir html -iso_language RU.RU -split 3 -short_index \ +TARGET ?= thesis +BIBFILE ?= thesis.bib + +ARCH ?= 7z +BIBTEX ?= bibtex8 +DVIPS ?= dvips +L2H ?= latex2html +L2RTF ?= latex2rtf +LATEX ?= latex +PDFLATEX ?= pdflatex +PS2PDF ?= gs +PSBOOK ?= psbook +PSNUP ?= psnup + +ARCHEXT ?= zip +ARCHFLAGS ?= a -t$(ARCHEXT) +ARCHIVE := $(TARGET).$(ARCHEXT) +BIBTEXFLAGS ?= -H -c cp1251 +DVIPSFLAGS ?= -P pdf -t A4 -z +L2HFLAGS ?= -dir html -iso_language RU.RU -split 3 -short_index \ -numbered_footnotes -white -antialias -html_version 4.0 -L2RTFFLAGS?=-F -M12 -i russian -PS2PDFFLAGS?=-dBATCH -dNOPAUSE -sDEVICE=pdfwrite -g4960x7016 -r600 \ +L2RTFFLAGS ?= -F -M12 -i russian +LATEXFLAGS ?= --src-specials +PS2PDFFLAGS ?= -dBATCH -dNOPAUSE -sDEVICE=pdfwrite -g4960x7016 -r600 \ -dCompatibilityLevel=1.2 -PSNUPFLAGS?=-2 -pA4 -PDFLATEXFLAGS?=--shell-escape -LATEXFLAGS?=-src-specials +PSNUPFLAGS ?= -2 -pA4 +PDFLATEXFLAGS ?= --shell-escape -CLEXT?=*.aux *.toc *.idx *.ind *.ilg *.log *.out *.lof *.lot *.lol \ +CLEXT ?= *.aux *.toc *.idx *.ind *.ilg *.log *.out *.lof *.lot *.lol \ *.bbl *.blg *.bak *.dvi *.ps *.pdf -CLFILES?=$(CLEXT) $(ARCHIVE) -SRCFILES?=* +CLFILES ?= $(CLEXT) $(ARCHIVE) +SRCFILES ?= * -# end of configuration dvi: $(TARGET).dvi clean: - rm -f $(CLFILES) - @$(MAKE) -C fig $@ - -epstoeps epstopdf fixbb pdftopng256 pdftotiffg4: - @$(MAKE) -C fig $@ + -rm -f $(CLFILES) + +.help: + @$(MAKE) -s -C fig help ;\ + echo " dvi (default) build DVI" ;\ + echo " figclean clean output files in figures directory" ;\ + echo " html convert DVI to HTML" ;\ + echo " pdf build PDF" ;\ + echo " pdf_2on1 build PDF with two A5 pages on one A4 ordered by number" ;\ + echo " pdf_book build PDF booklet (two A5 on A4)" ;\ + echo " ps build PS" ;\ + echo " ps_2on1 build PS with two A5 pages on one A4 ordered by number" ;\ + echo " ps_book build PS booklet (two A5 on A4)" ;\ + echo " rtf convert DVI to RTF" ;\ + echo " srcdist build source distribution" html: $(TARGET).dvi $(L2H) $(L2HFLAGS) $(TARGET).tex @@ -64,39 +73,38 @@ ps_book: $(TARGET)_book.ps rtf: $(TARGET).rtf -srcdist: clean +srcdist: clean figclean $(ARCH) $(ARCHFLAGS) $(ARCHIVE) $(SRCFILES) -$(TARGET).dvi: $(TARGET).tex - $(LATEX) $(TEXFLAGS) $^ - @if [ -f $(BIBFILE) ]; then \ +$(TARGET).dvi: *.tex *.bib + @$(LATEX) $(TEXFLAGS) $(TARGET).tex ;\ + if [ -f $(BIBFILE) ] ; then \ for f in *.aux; do $(BIBTEX) $(BIBTEXFLAGS) $$f; done ;\ - $(LATEX) $(TEXFLAGS) $^ ;\ + $(LATEX) $(TEXFLAGS) $(TARGET).tex ;\ else \ echo Warning: Bibliography file does not exist ;\ - fi - $(LATEX) $(TEXFLAGS) $^ + fi ;\ + $(LATEX) $(TEXFLAGS) $(TARGET).tex $(TARGET).ps: $(TARGET).dvi - $(DVIPS) -o $@ $^ + $(DVIPS) $(DVIPSFLAGS) $^ $(TARGET)_2on1.ps: $(TARGET).ps $(PSNUP) $(PSNUPFLAGS) $^ > $@ $(TARGET)_book.ps: $(TARGET).ps - $(PSNUP) $(PSNUPFLAGS) $^ > $@ + $(PSNUP) $(PSNUPFLAGS) $^ > $@ ;\ $(PSBOOK) $^ | $(PSNUP) -2 > $@ -$(TARGET).pdf: $(TARGET).tex - $(PDFLATEX) $(PDFLATEXFLAGS) $^ - @if [ -f $(BIBFILE) ];\ - then \ - for f in *.aux; do $(BIBTEX) $(BIBTEXFLAGS) $$f ; done ;\ - $(PDFLATEX) $(PDFLATEXFLAGS) $^ ;\ +$(TARGET).pdf: *.tex *.bib + @$(PDFLATEX) $(PDFLATEXFLAGS) $(TARGET).tex ;\ + if [ -f $(BIBFILE) ] ; then \ + for f in *.aux ; do $(BIBTEX) $(BIBTEXFLAGS) $$f ; done ;\ + $(PDFLATEX) $(PDFLATEXFLAGS) $(TARGET).tex ;\ else \ - echo Warning: Bibliography file does not exist ;\ - fi - $(PDFLATEX) $(PDFLATEXFLAGS) $^ + echo "Warning: Bibliography file does not exist" ;\ + fi ;\ + $(PDFLATEX) $(PDFLATEXFLAGS) $(TARGET).tex $(TARGET)_2on1.pdf: $(TARGET)_2on1.ps $(PS2PDF) $(PS2PDFFLAGS) -sOutputFile=$@ -c save pop -f $^ @@ -107,16 +115,9 @@ $(TARGET)_book.pdf: $(TARGET)_book.ps $(TARGET).rtf: $(TARGET).dvi $(L2RTF) $(L2RTFFLAGS) -a $(TARGET).aux -b $(TARGET).bbl $(TARGET).tex -help: - @echo " dvi (default) build DVI" - @echo " clean remove output files" - @echo " help show description of targets" - @echo " html convert DVI to HTML" - @echo " pdf build PDF" - @echo " pdf_2on1 build PDF with two A5 pages on one A4 ordered by number" - @echo " pdf_book build PDF booklet (two A5 on A4)" - @echo " ps build PS" - @echo " ps_2on1 build PS with two A5 pages on one A4 ordered by number" - @echo " ps_book build PS booklet (two A5 on A4)" - @echo " rtf convert DVI to RTF" - @echo " srcdist build source distribution" +bmtoeps epstoeps epstopdf fixbb optimize pdftopng256 pdftotiffg4: + @$(MAKE) -C fig $@ + +figclean: + @$(MAKE) -C fig clean + diff --git a/Master/texmf-dist/doc/latex/disser/include/latex.nmk.cmd b/Master/texmf-dist/doc/latex/disser/include/latex.nmk.cmd index 2d71e7acf4b..6f72e3e5775 100644 --- a/Master/texmf-dist/doc/latex/disser/include/latex.nmk.cmd +++ b/Master/texmf-dist/doc/latex/disser/include/latex.nmk.cmd @@ -4,12 +4,14 @@ rem nomake script for LaTeX projects rem Author: Stanislav Kruchinin <stanislav.kruchinin@gmail.com> if "%CMDEXTVERSION%"=="" ( - echo Error: This script requires command interpreter from Windows 2000 or above. + echo This script requires command interpreter from Windows 2000 or above. goto :eof ) -if "%target%"=="" set target=thesis -set bibfile=thesis.bib +setlocal enabledelayedexpansion + +if "%target%"=="" set target=thesis +if "%bibfile%"=="" set bibfile=thesis.bib if "%arch%"=="" set arch=7z if "%bibtex%"=="" set bibtex=bibtex8 @@ -27,36 +29,45 @@ if "%archext%"=="" set archext=zip if "%archflags%"=="" set archflags=a -t%archext% if "%archive%"=="" set archive=%target%.%archext% if "%bibtexflags%"=="" set bibtexflags=-H -c cp1251 +if "%dvipsflags%"=="" set dvipsflags=-P pdf -t A4 -z if "%l2hflags%"=="" ( set l2hflags=-dir html -iso_language RU.RU -split 3 -short_index ^ - -numbered_footnotes -white -antialias -html_version 4.0 + -numbered_footnotes -white -antialias -html_version 4.0 ) -if "%l2rtfflags%"=="" set l2rtfflags=-F -M12 -i russian +if "%l2rtfflags%"=="" set l2rtfflags=-F -M12 -i russian +if "%latexflags%"=="" set latexflags=--src-specials if "%ps2pdfflags%"=="" ( set ps2pdfflags=-dBATCH -dNOPAUSE -sDEVICE=pdfwrite -g4960x7016 -r600 ^ - -dCompatibilityLevel#1.2 + -dCompatibilityLevel#1.2 ) if "%psnupflags%"=="" set psnupflags=-2 -pA4 if "%pdflatexflags%"=="" set pdflatexflags=--shell-escape -if "%latexflags%"=="" set latexflags=-src-specials -set clext=*.bbl *.bak *.aux *.blg *.out *.toc *.log *.dvi *.tmp *.pdf *.ps -if "%clfiles%"=="" set clfiles=%clext% %archive% +if "%clext%"=="" set clext=*.bbl *.bak *.aux *.blg *.out *.toc *.log ^ + *.dvi *.tmp *.pdf *.ps +if "%clfiles%"=="" set clfiles=!clext! %archive% if "%srcfiles%"=="" set srcfiles=* -rem end of configuration if "%1"=="" ( -:default call :dvi -goto :eof -) else if "%1"=="clean" ( +) else ( + for %%f in (%*) do call :%%f +) + +exit /b + :clean del /s %clfiles% 2> nul if exist %target%.%arctype% del %target%.%arctype% goto :eof -) else if "%1"=="dvi" ( + :dvi + call :cmptimes %target%.dvi *.tex *.bib + if !_ctres!==0 ( + echo nomake: Nothing to be done for 'dvi'. + goto :eof + ) %latex% %latexflags% %target%.tex if exist %bibfile% ( for %%f in (*.aux) do %bibtex% %bibtexflags% %%f @@ -66,13 +77,34 @@ goto :eof ) %latex% %latexflags% %target%.tex goto :eof -) else if "%1"=="html" ( + +:help + call ..\..\include\latex.fig.nmk.cmd + echo dvi ^(default^) build DVI + echo figclean clean output files in figures directory + echo help show description of targets + echo html convert DVI to HTML + echo pdf build PDF + echo pdf_2on1 build PDF with two A5 pages on one A4 ordered by number + echo pdf_book build PDF booklet ^(two A5 on A4^) + echo ps build PS + echo ps_2on1 build PS with two A5 pages on A4 ordered by number + echo ps_book build PS booklet ^(two A5 on A4^) + echo rtf convert DVI to RTF + echo srcdist build source distribution +goto :eof + :html - if not exist %target%.dvi call :dvi + call :dvi %l2h% %l2hflags% %target%.tex goto :eof -) else if "%1"=="pdf" ( + :pdf + call :cmptimes %target%.pdf *.tex *.bib + if !_ctres!==0 ( + echo nomake: Nothing to be done for 'pdf'. + goto :eof + ) %pdflatex% %pdflatexflags% %target%.tex if exist %bibfile% ( for %%f in (*.aux) do %bibtex% %bibtexflags% %%f @@ -82,76 +114,92 @@ goto :eof ) %pdflatex% %pdflatexflags% %target%.tex goto :eof -) else if "%1"=="pdf_2on1" ( + :pdf2on1 - if not exist %target%_2on1.ps call :ps2on1 + call :ps2on1 %ps2pdf% %ps2pdfflags% -sOutputFile=%target%_2on1.pdf ^ - -c save pop -f %target%_2on1.ps + -c save pop -f %target%_2on1.ps goto :eof -) else if "%1"=="pdf_book" ( + :pdfbook - if not exist %target%_book.ps call :psbook - %ps2pdf% %ps2pdfflags% -sOutputFile=%target%_booklet.pdf ^ - -c save pop -f %target%_book.ps + call :psbook + %ps2pdf% %ps2pdfflags% -sOutputFile=%target%_book.pdf ^ + -c save pop -f %target%_book.ps goto :eof -) else if "%1"=="ps" ( + :ps - if not exist %target%.dvi call :dvi - %dvips% -o %target%.ps %target%.dvi + call :dvi + %dvips% %dvipsflags% %target%.dvi goto :eof -) else if "%1"=="ps_2on1" ( + :ps2on1 - if not exist %target%.ps call :ps + call :ps %psnup% %psnupflags% %target%.ps > %target%_2on1.ps goto :eof -) else if "%1"=="ps_book" ( + :psbook - if not exist %target%.ps call :ps + call :ps %psbook% %target%.ps | %psnup% -2 > %target%_book.ps goto :eof -) else if "%1"=="rtf" ( + +:rtf call :dvi %l2rtf% %l2rtfflags% -a %target%.aux -b %target%.bbl %target%.tex -) else if "%1"=="srcdist" ( +goto :eof + :srcdist call :clean %arch% %archflags% %archive% %srcfiles% goto :eof -) else if "%1"=="epstoeps" ( + +:bmtoeps + cd fig & call nomake.cmd bmtoeps & cd .. +goto :eof + :epstoeps cd fig & call nomake.cmd epstoeps & cd .. -goto :eof -) else if "%1"=="epstopdf" ( +goto :eof + :epstopdf cd fig & call nomake.cmd epstopdf & cd .. -goto :eof -) else if "%1"=="fixbb" ( +goto :eof + +:figclean + cd fig & call nomake.cmd clean & cd .. +goto :eof + :fixbb cd fig & call nomake.cmd fixbb & cd .. goto :eof -) else if "%1"=="pdftopng256" ( + +:optimize + cd fig & call nomake.cmd optimize & cd .. +goto :eof + :pdftopng256 cd fig & call nomake.cmd pdftopng256 & cd .. goto :eof -) else if "%1"=="pdftotiffg4" ( + :pdftotiffg4 cd fig & call nomake.cmd pdftotiffg4 & cd .. goto :eof -) else if "%1"=="help" ( -:help - echo dvi ^(default^) build DVI - echo clean remove output files - echo help show description of targets - echo html convert DVI to HTML - echo pdf build PDF - echo pdf_2on1 build PDF with two A5 pages on one A4 ordered by number - echo pdf_book build PDF booklet ^(two A5 on A4^) - echo ps build PS - echo ps_2on1 build PS with two A5 pages on A4 ordered by number - echo ps_book build PS booklet ^(two A5 on A4^) - echo rtf convert DVI to RTF - echo srcdist build source distribution + +:cmptimes + set _ctfiles=%* + set _ctoutf=%~1 + if not exist %_ctoutf% ( + set _ctres=1 + goto :eof + ) + for /f "usebackq" %%f in (`dir /b /t:w /o:-d %_ctfiles%`) do ( + set _ctnewest=%%f + goto :_ctbreak + ) + :_ctbreak + + if "%_ctoutf%"=="%_ctnewest%" ( + set _ctres=0 + ) else ( + set _ctres=1 + ) goto :eof -) else ( - echo Don't know how to make %1 -) |