Debian Codegraph @

texmf-dist/tex/latex/ditaa/ditaa.sty

raw
1 % 'ditaa' package
2 %
3 % (c) Hiroshi Ukai
4 %
5 %% This program can be redistributed and/or modified under the terms
6 %% of the LaTeX Project Public License Distributed from CTAN archives
7 %% in directory macros/latex/base/lppl.txt.
8 %
9 \NeedsTeXFormat{LaTeX2e}
10 \ProvidesPackage{ditaa}
11 [2018/09/27 v0.01 LaTeX package for embedding ditaa style ascii art]
12
13 \RequirePackage{fancyvrb}
14 \RequirePackage{graphicx}
15 \RequirePackage{kvoptions}
16
17 \DeclareStringOption[]{imagepath}
18 \ProcessKeyvalOptions*
19
20 %@formatter:off (This line indicates IntelliJ that formatter should be off before this)
21 \newenvironment{ditaa}[3][\columnwidth]
22 {
23 \def\ditaacaption{#2}
24 \def\ditaastem{#3}
25 \def\ditaadir{\ditaa@imagepath/ditaa}
26 \def\ditaafile{\ditaadir/\ditaastem.ditaa}
27 \def\ditaafigwidth{#1}
28 \VerbatimOut{\ditaafile}}
29 {\endVerbatimOut
30 \immediate\write18{ditaa -E "\ditaafile" "\ditaadir/\ditaastem.png"}
31 \begin{figure}[ht]
32 \begin{center}
33 \vspace{-1em}
34 \includegraphics[width=\ditaafigwidth]{\ditaadir/\ditaastem.png}
35 \vspace{-2em}
36 \caption{\ditaacaption}
37 \label{fig:\ditaastem}
38 \vspace{-1.5em}
39 \end{center}
40 \end{figure}
41 }
42 %@formatter:on (This line indicates IntelliJ that formatter should be off before this)
43 %--------------------------------------------------
44
45 \endinput
46 %%
47 %% End of file `ditaa.sty'.