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?
filecontentsfor 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