0

I am currently writing a XeLaTeX-compiled .cls file. This file should be able to include a specific vector background graphic that should be included within this class. At the moment, I am importing the file as a PDF from a directory.

However, it would be desirable to have a self-contained .cls file instead. I found out that it should be possible to include vector graphics in TeX documents: How do I embed vector graphics to LaTeX document. Since those eps graphics are based on scripting, would it be possible to include the vector graphic code directly in one's XeLaTeX document, so there is no need to import the graphics?

TiMauzi
  • 841
  • 1
    If the vector graphic is indeed pure text (postscript or svg without binary elements, or uncompressed pdf) then you can use filecontents for this to copy the source of the graphic to a file and then include the file in the normal way. If the graphic is originally made in TikZ (or if you can recreate it easily in TikZ) then of course it becomes easier because you can just draw the graphic directly without using intermediate files. Note that having supporting files to be distributed with your class is not so unusual, so you may consider that as an option as well. – Marijn Jan 27 '21 at 15:43
  • @Marijn Thank for that advice! I assumed that it is not unusual to attach additional files, but is there a way to kind of compress them into a file (similar to e.g. subsume multiple files into a .jar class when writing Java code)? – TiMauzi Jan 27 '21 at 15:46
  • 1
    A zip file is generally used for such purposes :) which needs to be extracted before use of course. But if you download a class or template for a conference or journal publication for example, or a university thesis style, or a CV template, then you almost always get a zip or tar.gz file that includes several files, like a bibliography style, example document, and indeed logo's and such as images. – Marijn Jan 27 '21 at 15:50
  • eps may not be the best format (since it can not be directly included in pdf) it requires ghostscript to convert to pdf each time. You may be better to use pdf, or to encode the vector format as tikz etc, it depends.... – David Carlisle Jan 27 '21 at 19:40

0 Answers0