@cristianormazabal/triton-latex 0.1.9 → 0.1.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/triton.sty +9 -0
package/package.json
CHANGED
package/triton.sty
CHANGED
|
@@ -120,6 +120,15 @@
|
|
|
120
120
|
% holds the \includegraphics options. Content-hash → cache → shell-out → include.
|
|
121
121
|
\newcommand{\triton@render}{%
|
|
122
122
|
\ifnum\pdf@shellescape=\@ne
|
|
123
|
+
% Fold theme + scale into the hashed file so that changing \tritontheme{}
|
|
124
|
+
% or \tritonscale{} correctly invalidates the cache. The appended line is a
|
|
125
|
+
% full-line %% comment, stripped by stripComments() before the CLI parses
|
|
126
|
+
% the diagram, so the compiler never sees it and IR/SVG output is
|
|
127
|
+
% byte-identical. The temp file is freshly written before every call to
|
|
128
|
+
% \triton@render, so this append is idempotent per render.
|
|
129
|
+
% NOTE: echo (not printf) is used deliberately — printf treats %% as a
|
|
130
|
+
% format escape; echo passes characters through verbatim, so '%%' stays '%%'.
|
|
131
|
+
\immediate\write18{echo '\@percentchar\@percentchar triton-key:\triton@themearg\space scale=\triton@scale' >> "\triton@tmpfile"}%
|
|
123
132
|
\edef\triton@hash{\pdf@filemdfivesum{\triton@tmpfile}}%
|
|
124
133
|
\edef\triton@pdf{\triton@cachedir/\triton@hash.pdf}%
|
|
125
134
|
% Only render when this exact source has not been rendered before.
|