Debian Codegraph @

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

raw
1 \documentclass[pagesize=auto]{scrartcl}
2
3 \addtokomafont{title}{\rmfamily}
4
5 \title{The \textsf{ditaa} package}
6 \author{Hiroshi Ukai}
7 \date{2018/10/18}
8
9
10 \usepackage{verbatim}
11 \def\imagepath{./resources}
12 \usepackage[imagepath=\imagepath]{ditaa}
13 \graphicspath{ {\imagepath/} }
14
15 \begin{document}
16
17 \maketitle
18
19 \noindent
20 The \LaTeX\ \textsf{ditaa} package renders your ascii art inside your LaTeX files into pretty image files which you can use them in your papers.
21
22 \minisec{Usage:}
23 To \texttt{usepackage} \textbf{ditaa}, typically do following.
24 \begin{verbatim}
25 \def\imagepath{./resources}
26 \usepackage[imagepath=\imagepath]{ditaa}
27 \graphicspath{ {\imagepath/} }
28 \end{verbatim}
29
30 A vaiable \texttt{\textbackslash imagepath} points a directory that your images reside.
31 Under it, you need to create a directory \texttt{ditaa} in advance.
32 In this directory, \texttt{ditaa} environment creates its working files.
33
34 \minisec{Features:}
35 %
36 This is a ditaa diagram example.
37 \begin{verbatim}
38 \begin{ditaa}[8cm]{ditaa caption example}{ditaaexample}
39 +--------+ +-------+ +-------+
40 | | --+ ditaa +--> | |
41 | Text | +-------+ |diagram|
42 |Document| |!magic!| | |
43 | {d}| | | | |
44 +---+----+ +-------+ +-------+
45 : ^
46 | Lots of work |
47 +-------------------------+
48 \end{ditaa}
49 \end{verbatim}
50
51 The fragment above will be rendered into following diagram.
52
53 \begin{ditaa}[8cm]{ditaa caption example}{ditaaexample}
54 +--------+ +-------+ +-------+
55 | | --+ ditaa +--> | |
56 | Text | +-------+ |diagram|
57 |Document| |!magic!| | |
58 | {d}| | | | |
59 +---+----+ +-------+ +-------+
60 : ^
61 | Lots of work |
62 +-------------------------+
63 \end{ditaa}
64 \pagebreak
65 And you can specify image width like this Figure.\ref{fig:ditaaexample2}.
66
67 \begin{verbatim}
68 \begin{ditaa}[6cm]{ditaa caption example2}{ditaaexample2}
69 +---------+
70 | cBLU |
71 | |
72 | +----+
73 | |cPNK|
74 | | |
75 +----+----+
76 \end{ditaa}
77 \end{verbatim}
78
79 To denote your diagram, you can do
80
81 \begin{verbatim}
82
83 Figure~\ref{fig:ditaaexample2}
84
85 \end{verbatim}
86
87 , where \texttt{ditaaexample2} is the second argument you gave to the \texttt{ditaa} environment as you see above.
88 The prefix \texttt{fig:} is given by \texttt{ditaa} environment automatically.
89
90 \begin{ditaa}[6cm]{ditaa caption example2}{ditaaexample2}
91 +---------+
92 | cBLU |
93 | |
94 | +----+
95 | |cPNK|
96 | | |
97 +----+----+
98 \end{ditaa}
99
100 Enjoy!
101
102 \minisec{ChangeLog:}
103 %
104 \begin{labeling}[\hspace{\labelsep}--]{0.9}
105 \item[0.9] Preparation for first \textsf{ditaa} release.
106 \end{labeling}
107
108 \end{document}