4 Understanding Macros and Packages

Macros and packages in plasTeX live a dual life. On one hand, macros can be defined in LaTeX files and expanded by plasTeX itself. On the other hand, macros can also be implemented as Python classes. Packages are the same way. plasTeX can handle some LaTeX packages natively. Others may have to be implemented in Python. In most cases, both implementations work transparently together. If you don’t define that many macros, and the ones that you do define are simple or even of intermediate complexity, it’s probably better to just let plasTeX handle them natively. However, there are some reasons that you may want to implement Python versions of your macros:

If any of these reasons appeal to you, read the following sections on how to implement macros and packages in plasTeX.