Skip to main content

Section 9.2 Example Use

Here is a typical example of using mbx. You have several (or many!) diagrams and figures in your PreTeXt source, all authored in the TikZ language, and so packaged up within <latex-image-code> elements. Your /PDF output looks beautiful, since PreTeXt simply inserts the TikZ code into the right place in the generated *.tex file, and you have done this several times until your figures look just right.

Now you need to generate the SVG versions of your images that will accompany your HTML version of your book and provide nice scalable graphics. This is exactly the sort of chore the mbx script was designed for. You might run

mbx -vv -c latex-image -f svg -d ~/books/aota/images ~/books/aota/animals.xml

Here -c is specifying the “component” of your book to process, and -f is specifying the “format” of what is being produced. The -d argument specifies a directory where the output ends up, in this case a collection of SVG files, one per image.