diff --git a/.github/workflows/latex-pdf.yml b/.github/workflows/latex-pdf.yml index c42dca9..6e29c00 100644 --- a/.github/workflows/latex-pdf.yml +++ b/.github/workflows/latex-pdf.yml @@ -13,6 +13,7 @@ jobs: uses: xu-cheng/latex-action@v2 with: root_file: main.tex + latexmk_shell_escape: true - name: Upload Artifact uses: actions/upload-artifact@v2 diff --git a/.github/workflows/publish-latest.yml b/.github/workflows/publish-latest.yml index a65abc3..a5f5d6d 100644 --- a/.github/workflows/publish-latest.yml +++ b/.github/workflows/publish-latest.yml @@ -19,6 +19,7 @@ jobs: with: working_directory: 'taoe3' root_file: 'main.tex' + latexmk_shell_escape: true - name: Checkout gh_pages branch uses: actions/checkout@v2 diff --git a/.gitignore b/.gitignore index 9b1324c..c38f068 100644 --- a/.gitignore +++ b/.gitignore @@ -38,3 +38,7 @@ # latexrun latex.out/ +## Tikz externalize files +*.makefile +*.figlist +*.auxlock diff --git a/main.pdf b/main.pdf index ae9d5a7..01cd1fb 100644 Binary files a/main.pdf and b/main.pdf differ diff --git a/taoesolutions.sty b/taoesolutions.sty index 8dfb01f..a81b8aa 100644 --- a/taoesolutions.sty +++ b/taoesolutions.sty @@ -2,6 +2,7 @@ \usepackage{circuitikz} \usepackage{pgfplots} +\usepackage{environ} \usepackage{amsmath} \usepackage{cancel} \usepackage{enumitem} @@ -13,6 +14,10 @@ ]{geometry} \usepackage[toc]{multitoc} +\usetikzlibrary{external} +\tikzexternalize[prefix=tikz-cache/] +% \tikzexternalize[prefix=tikz-cache/, mode=list and make] + % Remove the "Chapter" label on each chapter \usepackage{titlesec} \titleformat{\chapter}[display] @@ -43,39 +48,63 @@ \newcommand{\ave}{\ensuremath{\text{ave}}} % average \newcommand{\eq}{\ensuremath{\text{eq}}} % equivalent -\newenvironment{circuit}[2]% param1=label, param2=caption - { - \begin{figure}[H] +\NewEnviron{circuit}[2]{% + \begin{figure}[H] \caption{#2} \label{#1} - - \begin{center} - % \centering - \begin{circuitikz}[american]\draw - } - { + \begin{center} + \begin{tikzpicture}[american]\draw + \BODY ; - \end{circuitikz} + \end{tikzpicture} \end{center} - \end{figure} - } + \end{figure}} + +% \newenvironment{circuit}[2]% param1=label, param2=caption +% { +% \begin{figure}[H] +% \caption{#2} +% \label{#1} + +% \begin{center} +% % \centering +% \begin{tikzpicture}[american]\draw +% } +% { +% ; +% \end{tikzpicture} +% \end{center} +% \end{figure} +% } -\newenvironment{plot}[2]% param1=label, param2=caption - { - \begin{figure}[H] +\NewEnviron{plot}[2]{% + \begin{figure}[H] \caption{#2} \label{#1} - - \begin{center} - % \centering + \begin{center} \begin{tikzpicture}[scale=0.8, samples=200]\draw - } - { + \BODY ; \end{tikzpicture} \end{center} - \end{figure} - } + \end{figure}} + +% \newenvironment{plot}[2]% param1=label, param2=caption +% { +% \begin{figure}[H] +% \caption{#2} +% \label{#1} + +% \begin{center} +% % \centering +% \begin{tikzpicture}[scale=0.8, samples=200]\draw +% } +% { +% ; +% \end{tikzpicture} +% \end{center} +% \end{figure} +% } % Set first level of list to (a) format \setlist[enumerate,1]{label=(\alph*)} diff --git a/tikz-cache/.gitignore b/tikz-cache/.gitignore new file mode 100644 index 0000000..7d06c29 --- /dev/null +++ b/tikz-cache/.gitignore @@ -0,0 +1,6 @@ +# This tikz-cache folder is here to cache the tikz images. +# It is needed by the \tikzpackage{external} library. +# This folder is not automatically generated, so it's tracked in version control +# to prevent new users from seeing cryptic compile errors. +* +!.gitignore