[texhax] [IC/Admin] Putting image *data* inside a TeX/LaTeX file?

tom sgouros tomfool at as220.org
Tue Apr 7 16:30:40 CEST 2009


> > I need to create a LaTeX style for technical report covers. 
> > The cover is to show the institution's logo, which exists 
> > only in bitmap form.
> > 
> > Normally I would provide the user with two files, the 
> > "report.sty" and a "logo.eps" file. However, life would be 
> > simpler for users if they had only one file to download.
> > 
> > So, is there a way to include the image pixel data (or the 
> > contents of the "logo.eps" file) in the "report.sty" file 
> > itself? Say, within a largish "\special" command?
> 

Yes, you can do this.  Make a postscript version of the logo, and then
you can use a \special command to encapsulate it.  I got a file like
this from kluwer a few years ago, and have also used the same trick for
clients since for exactly the reason you suggest, to make it easier on them.

The kluwer file I think you can find by googling kluwer.cls.  The
beginning of the relevant section looks like this:

\logotoks={\special{"
4 4 translate
989 1138 1 [60 0 0 -60 210 930]
currentfile
/ASCII85Decode filter
<< /K -1 /Columns 989 >>
/CCITTFaxDecode filter
image
Q>'H49/K0rjdMhW-(A!cb;A.`/DC9EH"NLrmTGB3G`p9Q"2Q+cbR4Nj7'd7dn1Os5
\string$DPm^#D5dp.Sq0)HOI.%W!@rm_0-3j?%po`_0-3j?%VDq_0-W'Fr+S1(LXi_Ye(:I
]*kjT\string$a at 6KL"blG_X2L_CTtEVL"blG_X2L_CTtEVY/9RL]*l%#ln6muG.V%6g?j&"

The downside is you are stuck with the tex->dvips->ps2pdf route. (I
think -- someone else will correct me if I'm wrong.)  I imagine there is
some similar trick for pdftex->pdf, but I haven't messed with that.

 -tom




> You might try lookng at the "filecontents" package.
> 
> Cheers,  Phil
> 
> _______________________________________________
> TeX FAQ: http://www.tex.ac.uk/faq
> Mailing list archives: http://tug.org/pipermail/texhax/
> More links: http://tug.org/begin.html
> 
> Automated subscription management: http://tug.org/mailman/listinfo/texhax
> Human mailing list managers: postmaster at tug.org
> 


-- 
 ------------------------
 tomfool at as220 dot org
 http://sgouros.com  
 http://whatcheer.net


More information about the texhax mailing list