Files
emacs/snippets/org-mode/article-img-tpl

44 lines
1.2 KiB
Plaintext

# -*- mode: snippet -*-
# name: Article Image Tikz
# group: Article Templates
# key: ?article-img-tpl
# --
#+HEADER: :file (tpl-file "test-tikz")
#+HEADER: :results (tpl-results)
#+BEGIN_src latex :exports results :wrap figure
\begin{tikzpicture}
\begin{axis}[
width=12.5cm,
height=5cm,
title={},
enlarge x limits=false,
enlarge y limits=false,
scale only axis,
ymajorgrids,
grid style={gray!30},
axis lines=left,
xticklabel style={/pgf/number format/.cd,fixed,fixed zerofill,precision=1},
%xticklabel style={rotate=90,anchor=near xticklabel, /pgf/number format/1000 sep={}},
xlabel={$x$ label},
xlabel style ={yshift=-0.5cm},
%xtick={0,1,...,3},
xmin=0,
xmax=3,
ymin=0,
ymax=10,
ylabel={$y$ label},
%yticklabel style={/pgf/number format/.cd,fixed,fixed zerofill,precision=2},
%ytick={-1,0,...,3.5},
]
\addplot[red, thick, mark=x] table[x index=0, y index=1] {data.dat}; \label{tpl:y1}
\addplot[blue, thick, mark=x] table[x index=0, y index=2] {data.dat}; \label{tpl:y2}
\end{axis}
\end{tikzpicture}
#+END_src
#+ATTR_LATEX: :options [H] :caption \caption[Caption in ToC]{Caption at place with ref to \(y_{1}\) \ref{tpl:y1} and \(y_{2}\) \ref{tpl:y2}}
#+RESULTS:
#+begin_figure
[[file:test-tikz.svg]]
#+end_figure