Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for externalizing tikz images. #34

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Commits on Feb 28, 2022

  1. Add support for externalizing tikz images.

    This commit will cause all the tikz images to be generated first in the
    tikz-cache folder before being included in the main PDF file. There are
    several issues that need to be resolved for this to work:
    - Whatever command is being used to compile the document (e.g. `latexmk`
    or `pdflatex` needs to have the `-shell-escape` flag added.
    - The tikz-cache folder is not auto-generated, so it is being tracked in
    version control to avoid users cloning the repo and seeing mysterious
    error messages when compiling. No cached tikz files should be added to
    this directory.
    - The \newenvironment command used in our custom circuit and plot
    environments does not play well with the externalizing library. These
    were modified to use the environ library which solves the problem as
    described [here](https://tex.stackexchange.com/a/15614)
    - This caching significantly improves the compile time when figures are
    already cached, but the first compile takes much longer since the image
    compilation is single-threaded. However, it is possible to use
    tikzexternalize in `list and make` mode which allows you to use `make
    -j` to compile all the images using multiple threads. This requires
    running the pdflatex commands manually without some more complex
    configuration of a latexmkrc file. Only attempt this if you know what
    you are doing. Otherwise, just wait a couple minutes for the
    compilation.
    milesdai committed Feb 28, 2022
    Configuration menu
    Copy the full SHA
    7b46c1f View commit details
    Browse the repository at this point in the history