#!/bin/sh
# Convert a TeXinfo or LaTeXinfo file to a GNU Emacs info file.
# The file type is determined automatically.
# [04-Oct-1991]
for f in $*
do
	if grep -s '^\\input texinfo' $f
	then
		echo "Processing TeXinfo file: $f"
		emacs -batch -funcall batch-texinfo-format $f
	elif grep -s '^\\documentstyle.*latexinfo' $f
	then
		echo "Processing LaTeXinfo file: $f"
		emacs -batch \
			-load /usr/local/emacs/latexinfo/latexinfomd.el \
			-load /usr/local/emacs/latexinfo/latexinfo.el \
			-cd `pwd` \
			-funcall batch-latexinfo-format \
			$f | egrep -v '^Mark set|^Done'
	else
		echo "Don't know what kind of file this is: $f"
	fi
done


