Debian Codegraph @

texmf-dist/doc/latex/combinedgraphics/test/combinedgraphics_test.tex

raw
1 %
2 % LaTeX test file for combinedgraphics package
3 %
4 % Copyright 2009,2011,2012 Christian Schneider <software(at)chschneider(dot)eu>
5 %
6 % This file is part of combinedgraphics.
7 %
8 % combinedgraphics is free software: you can redistribute it and/or modify
9 % it under the terms of the GNU General Public License version 3 as
10 % published by the Free Software Foundation, not any later version.
11 %
12 % combinedgraphics is distributed in the hope that it will be useful,
13 % but WITHOUT ANY WARRANTY; without even the implied warranty of
14 % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 % GNU General Public License for more details.
16 %
17 % You should have received a copy of the GNU General Public License
18 % along with combinedgraphics. If not, see <http://www.gnu.org/licenses/>.
19 %
20 % WARNING: THIS IS ALPHA SOFTWARE AND MAY CONTAIN SERIOUS BUGS!
21 %
22
23 \documentclass[DIV12]{scrartcl}
24
25 \usepackage{combinedgraphics}
26 %\usepackage{combinedgraphics}
27
28 \newcommand*\mycolor{\color{blue}}
29 \newcommand*\myfont{\bfseries\Large}
30 \newcommand*\combinput[1]{%
31 \begin{picture}(0,0)%
32 \includegraphics{#1}%
33 \end{picture}%
34 \input{#1}%
35 }
36
37 \begin{document}
38 \section*{Test: no macro parameters}
39 \noindent
40 \fbox{\combinput{xfig325}}%
41 \fbox{\input{gnuplot42}}\\[3ex]
42 \fbox{\includecombinedgraphics{xfig325}}%
43 \fbox{\includecombinedgraphics{gnuplot42}}\\[3ex]
44 The default output generated by manually including the graphics is given in
45 the first line and the output of \texttt{\textbackslash
46 includecombinedgraphics} with the options indicated in the headline is given
47 in the next line. Here, we should see exactly the same output in both lines,
48 because \texttt{\textbackslash includecombinedgraphics} is used without any
49 parameters.
50
51 \clearpage
52
53 \section*{Test: \texttt{textfont=\textbackslash bfseries\textbackslash
54 Large},\texttt{textcolor=\textbackslash color\{blue\}}}
55 \noindent
56 \fbox{\combinput{xfig325}}%
57 \fbox{\input{gnuplot42}}\\[3ex]
58 \fbox{\includecombinedgraphics[textfont=\myfont,textcolor=\mycolor]{xfig325}}%
59 \fbox{\includecombinedgraphics[textfont=\myfont,textcolor=\mycolor]%
60 {gnuplot42}}\\[3ex]
61 The font size is increased, the font series changed to bold-face and the color
62 to blue. Note, that the vector graphics part is not affected.
63
64 \clearpage
65
66 \section*{Test: \texttt{vecscale=1.2}}
67 \noindent
68 \fbox{\combinput{xfig325}}%
69 \fbox{\input{gnuplot42}}\\[3ex]
70 \fbox{\includecombinedgraphics[vecscale=1.2]{xfig325}}%
71 \fbox{\includecombinedgraphics[vecscale=1.2]{gnuplot42}}\\[3ex]
72 The vector graphics part is scaled by a factor of $1.2$. Note, that the text
73 positions are changed accordingly, but the font and color are not affected.
74
75 \clearpage
76
77 \section*{Test: \texttt{vecwidth=7cm}}
78 \noindent
79 \fbox{\combinput{xfig325}}%
80 \fbox{\input{gnuplot42}}\\[3ex]
81 \fbox{\includecombinedgraphics[vecwidth=7cm]{xfig325}}%
82 \fbox{\includecombinedgraphics[vecwidth=7cm]{gnuplot42}}\\
83 \fbox{\rlap{\raise 5pt\hbox{length: 7cm}}\rule{7cm}{1pt}}%
84 \fbox{\rlap{\raise 5pt\hbox{length: 7cm}}\rule{7cm}{1pt}}\\[3ex]
85 These examples are similar to the \texttt{vecscale=\ldots} examples, but the
86 scaling factor is calculated automatically such that the graphics have a
87 width of $7$cm.
88
89 \clearpage
90
91 \section*{Test: \texttt{vecheight=6cm}}
92 \noindent
93 \fbox{\combinput{xfig325}}%
94 \fbox{\input{gnuplot42}}\\[3ex]
95 \fbox{\rotatebox{90}{length: 6cm}\rule{1pt}{6cm}}%
96 \fbox{\includecombinedgraphics[vecheight=6cm]{xfig325}}%
97 \fbox{\includecombinedgraphics[vecheight=6cm]{gnuplot42}}\\[3ex]
98 Similiar example, but in this case the height is specified.
99
100 \clearpage
101
102 \section*{Test: \texttt{vecfile=\ldots}}
103 \noindent
104 \fbox{\combinput{xfig325}}%
105 \fbox{\input{gnuplot42}}\\[3ex]
106 \fbox{\includecombinedgraphics[vecfile=gnuplot42]{xfig325}}%
107 \fbox{\includecombinedgraphics[vecfile=xfig325]{gnuplot42}}\\[3ex]
108 Here, the vector graphics parts of the two graphics are interchanged (at the
109 inclusion of the first graphics file, the vector graphics part of the second
110 graphics file is passed to its \texttt{vecfile} parameter and vice versa).
111 This leads to some ``chaotic'' output, but the \texttt{vecfile} parameter
112 works as expected.
113
114 \clearpage
115
116 \section*{Test: \texttt{vecinclude=false}}
117 \noindent
118 \fbox{\combinput{xfig325}}%
119 \fbox{\input{gnuplot42}}\\[3ex]
120 \fbox{\includecombinedgraphics[vecinclude=false]{xfig325}}%
121 \fbox{\includecombinedgraphics[vecinclude=false]{gnuplot42}}\\[3ex]
122 Here, the automatic inclusion of the vector graphics part is disabled. As
123 the \LaTeX{} part of Xfig graphics do not include it (left), the vector
124 graphics part is not shown. In contrast gnuplot includes the vector graphics
125 part in the \LaTeX{} part (right).
126
127 \clearpage
128
129 \section*{Test: \texttt{vecinclude=overwrite}}
130 \noindent
131 \fbox{\combinput{xfig325}}%
132 \fbox{\input{gnuplot42}}\\[3ex]
133 \fbox{\includecombinedgraphics[vecinclude=overwrite]{xfig325}}%
134 \fbox{\includecombinedgraphics[vecinclude=overwrite]{gnuplot42}}\\[3ex]
135 The inclusion of the vector graphics part by the \LaTeX{} part is disabled
136 (if any) and \texttt{\textbackslash includecombinedgraphics} generates its
137 own code for the inclusion. In this case the vector graphics part is included
138 first, because \texttt{vecfirst=true} is the default. Note, that the label
139 ``filled'' in the gnuplot graphics has become visible. (In gnuplot's
140 \LaTeX{} parts labels are output before including the vector graphics part
141 and, hence, can become invisible under filled curves.)
142
143 \clearpage
144
145 \section*{Test: \texttt{vecfirst=false,vecinclude=overwrite}}
146 \noindent
147 \fbox{\combinput{xfig325}}%
148 \fbox{\input{gnuplot42}}\\[3ex]
149 \fbox{\includecombinedgraphics[vecfirst=false,vecinclude=overwrite]{xfig325}}%
150 \fbox{\includecombinedgraphics[vecfirst=false,vecinclude=overwrite]%
151 {gnuplot42}}\\[3ex]
152 This example is similar to the previous one, but now the vector graphics
153 part is forced to be included after the \LaTeX{} part. Note, that the text
154 in the left one is hidden and in addition to the label ``filled'', parts
155 of the axes labels etc. are hidden in the right one.
156
157 \clearpage
158
159 \section*{Test: \texttt{angle=90}}
160 \noindent
161 \fbox{\combinput{xfig325}}%
162 \fbox{\input{gnuplot42}}\\[3ex]
163 \fbox{\includecombinedgraphics[angle=90]{xfig325}}%
164 \fbox{\includecombinedgraphics[angle=90]{gnuplot42}}\\[3ex]
165 The graphics are rotated by 90 degrees.
166
167 \clearpage
168
169 \section*{Test: \texttt{scale=0.8}}
170 \noindent
171 \fbox{\combinput{xfig325}}%
172 \fbox{\input{gnuplot42}}\\[3ex]
173 \fbox{\includecombinedgraphics[scale=0.8]{xfig325}}%
174 \fbox{\includecombinedgraphics[scale=0.8]{gnuplot42}}\\[3ex]
175 The \emph{whole} graphics (vector graphics part and font) are scaled by a
176 factor of $0.8$.
177
178 \clearpage
179
180 \section*{Test: \texttt{hscale=1.2,vscale=0.8}}
181 \noindent
182 \fbox{\combinput{xfig325}}%
183 \fbox{\input{gnuplot42}}\\[3ex]
184 \fbox{\includecombinedgraphics[hscale=1.2,vscale=0.8]{xfig325}}%
185 \fbox{\includecombinedgraphics[hscale=1.2,vscale=0.8]{gnuplot42}}\\[3ex]
186 Similar to the example before, by the horizontal and vertical scaling factors
187 differ.
188
189 \clearpage
190
191 \section*{Test: \texttt{width=0.49\textbackslash textwidth,height=5cm}}
192 \noindent
193 \fbox{\combinput{xfig325}}%
194 \fbox{\input{gnuplot42}}\\[3ex]
195 \fbox{\includecombinedgraphics[width=0.49\textwidth,height=5cm]{xfig325}}%
196 \fbox{\includecombinedgraphics[width=0.49\textwidth,height=5cm]%
197 {gnuplot42}}\\[3ex]
198 Similar to the example before, but instead of scaling factors explicit
199 heights and widths are given.
200
201 \clearpage
202
203 \section*{Test: \texttt{width=0.49\textbackslash textwidth,keepaspectratio}}
204 \noindent
205 \fbox{\combinput{xfig325}}%
206 \fbox{\input{gnuplot42}}\\[3ex]
207 \fbox{\includecombinedgraphics[width=0.49\textwidth,keepaspectratio]%
208 {xfig325}}%
209 \fbox{\includecombinedgraphics[width=0.49\textwidth,keepaspectratio]%
210 {gnuplot42}}\\[3ex]
211 Again, similar as the examples before, but the new height is automatically
212 calculated such that the aspect ratio of the graphics does not change.
213
214 \clearpage
215
216 \section*{Test: \texttt{angle=30,scale=0.75,angle=15}}
217 \noindent
218 \fbox{\combinput{xfig325}}%
219 \fbox{\input{gnuplot42}}\\[3ex]
220 \fbox{\includecombinedgraphics[angle=30,scale=0.75,angle=15]{xfig325}}%
221 \fbox{\includecombinedgraphics[angle=30,scale=0.75,angle=15]{gnuplot42}}%
222 \\[3ex]
223 Here, a combination of different rotations and scalings is shown. In contrast
224 to other parameters, some (like \texttt{angle} and \texttt{scale}) do not
225 overwrite previously specified parameters, but they accumulate.
226 \end{document}