File: test-robust-externalize.tex

package info (click to toggle)
vim-vimtex 2.17-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 8,844 kB
  • sloc: makefile: 360; python: 103
file content (56 lines) | stat: -rw-r--r-- 1,383 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
\documentclass{article}
\usepackage{robust-externalize}

\begin{document}

\begin{CacheMeCode}{c}
  int main() {
    return 1;
  }
\end{CacheMeCode}

\begin{CacheMeCode}{bash, tikz terminal}
  echo 'test.dat'
  exit 0
\end{CacheMeCode}
\begin{figure}
  \begin{CacheMeCode}{python matplotlib, add to preamble={\def\hello#1{Hello #1!}}}
    def f(p: string):
      return [x + p for x in ('a', 'b')]
  \end{CacheMeCode}
\end{figure}

\begin{RobExtCacheMeCode}{my python matplotlib, 
    add to preamble={\def\hello#1{Hello #1!}}
  }
  def f(p: string):
    return [x + p for x in ('a', 'b')]
\end{RobExtCacheMeCode}

\begin{CacheMe}{tikz}[scale=0.6]
  \draw[gray, thick] (-1,2) -- (2,-4);
  \draw[gray, thick] (-1,-1) -- (2,2);
  \filldraw[black] (0,0) circle (2pt) node[anchor=west]{Intersection point};
\end{CacheMe}

\begin{CacheMe}{tikzpicture}[scale=0.6]
  \draw[gray, thick] (-1,2) -- (2,-4);
  \draw[gray, thick] (-1,-1) -- (2,2);
  \filldraw[black] (0,0) circle (2pt) node[anchor=west]{Intersection point};
\end{CacheMe}

\begin{SetPlaceholderCode*}{__PYTHON_TEMP}
def f(p: string):
  return [x + p for x in ('a', 'b')]
\end{SetPlaceholderCode*}

\begin{PlaceholderPathFromCode}[.py]{__PYTHON_TEMP}
  def f(p: string):
    return [x + p for x in ('a', 'b')]
\end{PlaceholderPathFromCode}

\begin{CacheMe}{latex}
  This is regular \LaTeX commands.
\end{CacheMe}

\end{document}