-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcommon.tex
145 lines (122 loc) · 4.41 KB
/
common.tex
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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
% ========================================================================
% PlantUML : a free UML diagram generator
% ========================================================================
%
% (C) Copyright 2009, Arnaud Roques
%
% Project Info: http://plantuml.sourceforge.net
%
% This file is part of PlantUML.
%
% PlantUML is free software; you can redistribute it and/or modify it
% under the terms of the GNU General Public License as published by
% the Free Software Foundation, either version 3 of the License, or
% (at your option) any later version.
%
% PlantUML distributed in the hope that it will be useful, but
% WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
% or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
% License for more details.
%
% You should have received a copy of the GNU General Public
% License along with this library; if not, write to the Free Software
% Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
% USA.
%
% [Java is a trademark or registered trademark of Sun Microsystems, Inc.
% in the United States and other countries.]
%
% Original Author: Arnaud Roques
%
% ========================================================================
% PlantUML : a free UML diagram generator
% ========================================================================
%
% (C) Copyright 2009, Arnaud Roques
%
% Project Info: http://plantuml.sourceforge.net
%
% This file is part of PlantUML.
%
% PlantUML is free software; you can redistribute it and/or modify it
% under the terms of the GNU General Public License as published by
% the Free Software Foundation, either version 3 of the License, or
% (at your option) any later version.
%
% PlantUML distributed in the hope that it will be useful, but
% WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
% or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
% License for more details.
%
% You should have received a copy of the GNU General Public
% License along with this library; if not, write to the Free Software
% Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
% USA.
%
% [Java is a trademark or registered trademark of Sun Microsystems, Inc.
% in the United States and other countries.]
%
% Original Author: Arnaud Roques
%
\section{Common commands}
% ========================================================================
\subsection{Footer and header}
\begin{description}
\item You can use the commands \texttt{header} or \texttt{footer} to add a
footer or a header on any generated diagram.
\item You can optionally specify if you want a \texttt{center}, \texttt{left} or
\texttt{right} footer/header, by adding a keywork.
\item As for title, it is possible to define a header or a footer on several lines.
\item It is also possible to put some HTML into the header or footer
\end{description}
\begin{lstlisting}
@startuml
Alice -> Bob: Authentication Request
header
<font color=red>Warning:</font> This is a demonstration diagram.
Do not use in production.
endheader
center footer Generated for demonstration
@enduml
\end{lstlisting}
\begin{center}
\includegraphics[width=50mm]{common.png}
\end{center}
% ========================================================================
\newpage \subsection{Zoom}
You can use the scale command to zoom the generated image.
You can use either a number or a fraction to define the scale factor.
You can also specify either width or height (in pixel).
And you can also give both width and height : the image is scaled to fit inside the specified dimension.
\begin{itemize}
\item \texttt{scale 1.5},
\item \texttt{scale 2/3},
\item \texttt{scale 200 width},
\item \texttt{scale 200 height},
\item \texttt{scale 200*100}
\end{itemize}
\begin{lstlisting}
@startuml
scale 180*90
Bob->Alice : hello
@enduml
\end{lstlisting}
\begin{center}
\includegraphics[width=30mm]{common_001.png}
\end{center}
% ========================================================================
\newpage \subsection{Rotation}
Sometimes, and especially for printing, you may want to rotate the generated image, so that it fits
better in the page.
You can use the \texttt{rotate} command for this.
\begin{lstlisting}
@startuml
rotate
title Simple Usecase\nwith one actor
"Use the application" as (Use)
User -> (Use)
@enduml
\end{lstlisting}
\begin{center}
\includegraphics[width=30mm]{common_002.png}
\end{center}