@echo off set ORIGPATH=%PATH% set PATH=%KTUG_BIN%\..\dviout;%PATH% if .%1.==.. goto HELP if .%1.==.--help. goto HELP if .%1.==.--cat. goto DIRECTCAT if .%1.==.--ctan. goto DIRECTCTAN if .%1.==.-l. goto LISTDOC texdoc %1 if %ERRORLEVEL%==0 goto END goto CTAN :DIRECTCAT if .%2.==.. goto HELP texdoc %2 if %ERRORLEVEL%==0 goto END call $$$kcdirectcat %2 goto END :CTAN call $$$kctexsrch %1 goto END :DIRECTCTAN if .%2.==.. goto HELP texdoc %2 if %ERRORLEVEL%==0 goto END call $$$kctexsrch %2 :HELP echo KTUG Collection texdoc script echo Usage: kctexdoc [option] stylename echo Option: --help : this message echo -l : find document echo --cat : When the package is not installed, goto TeX Catalogue Online echo --ctan : When the package is not installed, goto CTAN Search (default) goto END :LISTDOC if .%2.==.. goto HELP kpsewhich --format="TeX system documentation" %2 if errorlevel 1 kpsewhich --format="TeX system documentation" %~n2.dvi if errorlevel 1 kpsewhich --format="TeX system documentation" %~n2.pdf if errorlevel 1 kpsewhich --format="TeX system documentation" %~n2.txt if errorlevel 1 kpsewhich --format="TeX system documentation" %~n2.html if errorlevel 1 kpsewhich --format="TeX system documentation" %~n2.ps if errorlevel 1 kpsewhich --format="TeX system documentation" %~n2.tex if errorlevel 1 kpsewhich --format="TeX system documentation" %~n2.texi if errorlevel 1 echo NOT FOUND goto END :END set PATH=%ORIGPATH% set ORIGPATH=