summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKarl Berry <karl@gnu.org>1997-06-27 19:09:14 +0000
committerKarl Berry <karl@gnu.org>1997-06-27 19:09:14 +0000
commitc297b2fbd50b87fb9f06f1b55357a180530b1aac (patch)
tree667c9f6c425ebb8222439b4fa4dac7fd1b7e205e
parentec08feae9702cc85216478eec70008da107c82ae (diff)
downloadgunmake-c297b2fbd50b87fb9f06f1b55357a180530b1aac.tar.gz
(\image): New definition for new @image command.
-rw-r--r--texinfo.tex42
1 files changed, 42 insertions, 0 deletions
diff --git a/texinfo.tex b/texinfo.tex
index 6b7da70..ad037ef 100644
--- a/texinfo.tex
+++ b/texinfo.tex
@@ -4559,9 +4559,51 @@ width0pt\relax} \fi
%
\def\finalout{\overfullrule=0pt}
+% @image. We use the macros from epsf.tex to support this.
+% If epsf.tex is not installed and @image is used, we complain.
+%
+% Check for and read epsf.tex up front. If we read it only at @image
+% time, we might be inside a group, and then its definitions would get
+% undone and the next image would fail.
+\openin 1 = xepsf.tex
+\ifeof 1 \else
+ \closein 1
+ \def\epsfannounce{\toks0 = }% do not bother showing banner
+ \input epsf.tex
+\fi
+%
+\newif\ifwarnednoepsf
+\newhelp\noepsfhelp{epsf.tex must be installed for images to
+ work. It is also included in the Texinfo distribution, or you can get
+ it from ftp://ftp.tug.org/tex/epsf.tex.}
+%
+% Only complain once about lack of epsf.tex.
+\def\image#1{%
+ \ifx\epsfbox\undefined
+ \ifwarnednoepsf \else
+ \errhelp = \noepsfhelp
+ \errmessage{epsf.tex not found, images will be ignored}%
+ \global\warnednoepsftrue
+ \fi
+ \else
+ \imagexxx #1,,,\finish
+ \fi
+}
+%
+% Arguments to @image:
+% #1 is (mandatory) image filename; we tack on .eps extension.
+% #2 is (optional) width, #3 is (optional) height.
+% #4 is just the usual extra ignored arg for parsing this stuff.
+\def\imagexxx#1,#2,#3,#4\finish{%
+ % \epsfbox itself resets \epsf?size at each figure.
+ \setbox0 = \hbox{\ignorespaces #2}\ifdim\wd0 > 0pt \epsfxsize=#2\relax \fi
+ \setbox0 = \hbox{\ignorespaces #3}\ifdim\wd0 > 0pt \epsfysize=#3\relax \fi
+ \epsfbox{#1.eps}%
+}
% End of control word definitions.
+
\message{and turning on texinfo input format.}
\def\openindices{%