summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/combinedgraphics/test/combinedgraphics_test.tex
blob: e67a523afe34dee4fb0d75130fb831edf6688859 (plain)
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
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
%
% LaTeX test file for combinedgraphics package
%
% Copyright 2009,2011,2012 Christian Schneider <software(at)chschneider(dot)eu>
%
% This file is part of combinedgraphics.
%
% combinedgraphics is free software: you can redistribute it and/or modify
% it under the terms of the GNU General Public License version 3 as
% published by the Free Software Foundation, not any later version.
%
% combinedgraphics is 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 General Public License for more details.
%
% You should have received a copy of the GNU General Public License
% along with combinedgraphics.  If not, see <http://www.gnu.org/licenses/>.
%
% WARNING: THIS IS ALPHA SOFTWARE AND MAY CONTAIN SERIOUS BUGS!
%

\documentclass[DIV12]{scrartcl}

\usepackage{combinedgraphics}
%\usepackage{combinedgraphics}

\newcommand*\mycolor{\color{blue}}
\newcommand*\myfont{\bfseries\Large}
\newcommand*\combinput[1]{%
  \begin{picture}(0,0)%
    \includegraphics{#1}%
  \end{picture}%
  \input{#1}%
}

\begin{document}
  \section*{Test: no macro parameters}
  \noindent
  \fbox{\combinput{xfig325}}%
  \fbox{\input{gnuplot42}}\\[3ex]
  \fbox{\includecombinedgraphics{xfig325}}%
  \fbox{\includecombinedgraphics{gnuplot42}}\\[3ex]
  The default output generated by manually including the graphics is given in
  the first line and the output of \texttt{\textbackslash
  includecombinedgraphics} with the options indicated in the headline is given
  in the next line.  Here, we should see exactly the same output in both lines,
  because \texttt{\textbackslash includecombinedgraphics} is used without any
  parameters.

  \clearpage

  \section*{Test: \texttt{textfont=\textbackslash bfseries\textbackslash
    Large},\texttt{textcolor=\textbackslash color\{blue\}}}
  \noindent
  \fbox{\combinput{xfig325}}%
  \fbox{\input{gnuplot42}}\\[3ex]
  \fbox{\includecombinedgraphics[textfont=\myfont,textcolor=\mycolor]{xfig325}}%
  \fbox{\includecombinedgraphics[textfont=\myfont,textcolor=\mycolor]%
    {gnuplot42}}\\[3ex]
  The font size is increased, the font series changed to bold-face and the color
  to blue.  Note, that the vector graphics part is not affected.

  \clearpage

  \section*{Test: \texttt{vecscale=1.2}}
  \noindent
  \fbox{\combinput{xfig325}}%
  \fbox{\input{gnuplot42}}\\[3ex]
  \fbox{\includecombinedgraphics[vecscale=1.2]{xfig325}}%
  \fbox{\includecombinedgraphics[vecscale=1.2]{gnuplot42}}\\[3ex]
  The vector graphics part is scaled by a factor of $1.2$.  Note, that the text
  positions are changed accordingly, but the font and color are not affected.

  \clearpage

  \section*{Test: \texttt{vecwidth=7cm}}
  \noindent
  \fbox{\combinput{xfig325}}%
  \fbox{\input{gnuplot42}}\\[3ex]
  \fbox{\includecombinedgraphics[vecwidth=7cm]{xfig325}}%
  \fbox{\includecombinedgraphics[vecwidth=7cm]{gnuplot42}}\\
  \fbox{\rlap{\raise 5pt\hbox{length: 7cm}}\rule{7cm}{1pt}}%
  \fbox{\rlap{\raise 5pt\hbox{length: 7cm}}\rule{7cm}{1pt}}\\[3ex]
  These examples are similar to the \texttt{vecscale=\ldots} examples, but the
  scaling factor is calculated automatically such that the graphics have a
  width of $7$cm.

  \clearpage

  \section*{Test: \texttt{vecheight=6cm}}
  \noindent
  \fbox{\combinput{xfig325}}%
  \fbox{\input{gnuplot42}}\\[3ex]
  \fbox{\rotatebox{90}{length: 6cm}\rule{1pt}{6cm}}%
  \fbox{\includecombinedgraphics[vecheight=6cm]{xfig325}}%
  \fbox{\includecombinedgraphics[vecheight=6cm]{gnuplot42}}\\[3ex]
  Similiar example, but in this case the height is specified.

  \clearpage

  \section*{Test: \texttt{vecfile=\ldots}}
  \noindent
  \fbox{\combinput{xfig325}}%
  \fbox{\input{gnuplot42}}\\[3ex]
  \fbox{\includecombinedgraphics[vecfile=gnuplot42]{xfig325}}%
  \fbox{\includecombinedgraphics[vecfile=xfig325]{gnuplot42}}\\[3ex]
  Here, the vector graphics parts of the two graphics are interchanged (at the
  inclusion of the first graphics file, the vector graphics part of the second
  graphics file is passed to its \texttt{vecfile} parameter and vice versa).
  This leads to some ``chaotic'' output, but the \texttt{vecfile} parameter
  works as expected.

  \clearpage

  \section*{Test: \texttt{vecinclude=false}}
  \noindent
  \fbox{\combinput{xfig325}}%
  \fbox{\input{gnuplot42}}\\[3ex]
  \fbox{\includecombinedgraphics[vecinclude=false]{xfig325}}%
  \fbox{\includecombinedgraphics[vecinclude=false]{gnuplot42}}\\[3ex]
  Here, the automatic inclusion of the vector graphics part is disabled.  As
  the \LaTeX{} part of Xfig graphics do not include it (left), the vector
  graphics part is not shown.  In contrast gnuplot includes the vector graphics
  part in the \LaTeX{} part (right).

  \clearpage

  \section*{Test: \texttt{vecinclude=overwrite}}
  \noindent
  \fbox{\combinput{xfig325}}%
  \fbox{\input{gnuplot42}}\\[3ex]
  \fbox{\includecombinedgraphics[vecinclude=overwrite]{xfig325}}%
  \fbox{\includecombinedgraphics[vecinclude=overwrite]{gnuplot42}}\\[3ex]
  The inclusion of the vector graphics part by the \LaTeX{} part is disabled
  (if any) and \texttt{\textbackslash includecombinedgraphics} generates its
  own code for the inclusion.  In this case the vector graphics part is included
  first, because \texttt{vecfirst=true} is the default.  Note, that the label
  ``filled'' in the gnuplot graphics has become visible.  (In gnuplot's
  \LaTeX{} parts labels are output before including the vector graphics part
  and, hence, can become invisible under filled curves.)

  \clearpage

  \section*{Test: \texttt{vecfirst=false,vecinclude=overwrite}}
  \noindent
  \fbox{\combinput{xfig325}}%
  \fbox{\input{gnuplot42}}\\[3ex]
  \fbox{\includecombinedgraphics[vecfirst=false,vecinclude=overwrite]{xfig325}}%
  \fbox{\includecombinedgraphics[vecfirst=false,vecinclude=overwrite]%
    {gnuplot42}}\\[3ex]
  This example is similar to the previous one, but now the vector graphics
  part is forced to be included after the \LaTeX{} part.  Note, that the text
  in the left one is hidden and in addition to the label ``filled'', parts
  of the axes labels etc. are hidden in the right one.

  \clearpage

  \section*{Test: \texttt{angle=90}}
  \noindent
  \fbox{\combinput{xfig325}}%
  \fbox{\input{gnuplot42}}\\[3ex]
  \fbox{\includecombinedgraphics[angle=90]{xfig325}}%
  \fbox{\includecombinedgraphics[angle=90]{gnuplot42}}\\[3ex]
  The graphics are rotated by 90 degrees.

  \clearpage

  \section*{Test: \texttt{scale=0.8}}
  \noindent
  \fbox{\combinput{xfig325}}%
  \fbox{\input{gnuplot42}}\\[3ex]
  \fbox{\includecombinedgraphics[scale=0.8]{xfig325}}%
  \fbox{\includecombinedgraphics[scale=0.8]{gnuplot42}}\\[3ex]
  The \emph{whole} graphics (vector graphics part and font) are scaled by a
  factor of $0.8$.

  \clearpage

  \section*{Test: \texttt{hscale=1.2,vscale=0.8}}
  \noindent
  \fbox{\combinput{xfig325}}%
  \fbox{\input{gnuplot42}}\\[3ex]
  \fbox{\includecombinedgraphics[hscale=1.2,vscale=0.8]{xfig325}}%
  \fbox{\includecombinedgraphics[hscale=1.2,vscale=0.8]{gnuplot42}}\\[3ex]
  Similar to the example before, by the horizontal and vertical scaling factors
  differ.

  \clearpage

  \section*{Test: \texttt{width=0.49\textbackslash textwidth,height=5cm}}
  \noindent
  \fbox{\combinput{xfig325}}%
  \fbox{\input{gnuplot42}}\\[3ex]
  \fbox{\includecombinedgraphics[width=0.49\textwidth,height=5cm]{xfig325}}%
  \fbox{\includecombinedgraphics[width=0.49\textwidth,height=5cm]%
    {gnuplot42}}\\[3ex]
  Similar to the example before, but instead of scaling factors explicit
  heights and widths are given.

  \clearpage

  \section*{Test: \texttt{width=0.49\textbackslash textwidth,keepaspectratio}}
  \noindent
  \fbox{\combinput{xfig325}}%
  \fbox{\input{gnuplot42}}\\[3ex]
  \fbox{\includecombinedgraphics[width=0.49\textwidth,keepaspectratio]%
    {xfig325}}%
  \fbox{\includecombinedgraphics[width=0.49\textwidth,keepaspectratio]%
    {gnuplot42}}\\[3ex]
  Again, similar as the examples before, but the new height is automatically
  calculated such that the aspect ratio of the graphics does not change.

  \clearpage

  \section*{Test: \texttt{angle=30,scale=0.75,angle=15}}
  \noindent
  \fbox{\combinput{xfig325}}%
  \fbox{\input{gnuplot42}}\\[3ex]
  \fbox{\includecombinedgraphics[angle=30,scale=0.75,angle=15]{xfig325}}%
  \fbox{\includecombinedgraphics[angle=30,scale=0.75,angle=15]{gnuplot42}}%
    \\[3ex]
  Here, a combination of different rotations and scalings is shown.  In contrast
  to other parameters, some (like \texttt{angle} and \texttt{scale}) do not
  overwrite previously specified parameters, but they accumulate.
\end{document}