File: test.tex

package info (click to toggle)
texlive-bin 2007.dfsg.2-4%2Blenny3
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 245,472 kB
  • ctags: 135,653
  • sloc: ansic: 971,350; cpp: 307,149; sh: 53,218; perl: 39,201; makefile: 12,611; python: 6,078; xml: 5,342; asm: 4,245; yacc: 3,108; pascal: 2,483; ruby: 2,089; ada: 1,681; lex: 1,654; objc: 1,357; awk: 1,214; tcl: 973; cs: 879; lisp: 708; sed: 536; java: 172; csh: 47
file content (138 lines) | stat: -rw-r--r-- 4,250 bytes parent folder | download | duplicates (3)
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
%% -*- Mode: LaTeX -*-
%% -*- Module: test.tex

%% set the documentstyle
\documentclass{article}
\usepackage{epsfig}
\usepackage{times}

%% we will get a new page for each example so make pages high enough
\textheight=10in

\def\illpref/{}
% \def\illpref{/u/vojta/Xdvi/xdvi-examples}

\begin{document}

Here we go with some tests.  We want to make sure we have examples for
all possibilities.  For instance, we believe that xdvi should be able to
show a figure that has a bounding box and is included via psfig.  Here
is an attempt, which we call Fig.~\ref{fig:f1}.

\begin{figure}[h]
  \centerline{\psfig{figure=\illpref/f1.ps,width=5in}}
  \caption{Figure with bounding box included with psfig.}
  \label{fig:f1}
\end{figure}

This figure is a crude postscript figure created with an in-house program.

\newpage

This next figure is created with matlab.
Also included courtesy of psfig.

\begin{figure}[h]
  \centerline{\psfig{figure=\illpref/f2.ps,height=5in}}
  \caption{Figure with bounding box included with psfig.  More robust
    postscript.}
  \label{fig:f2}
\end{figure}

You will no doubt notice the figure does not seem to be centered.  It
is in fact centered as you can check by clicking on the {\em ``View PS''}
option and checking out its bounding box.  It just so happens
that the program that generated this figure comes out with weird bb's.

\newpage

Now, we might want to try figures that are somewhat different.  For
instance Fig.~\ref{fig:f3} has no bounding box.  We wish to include it
by means of a special.  Here we go...

\begin{figure}[h]
  \vspace{2in}
  \special{psfile=\illpref/f3.ps.gz hoffset=-10 vscale=200 hscale=200}
  \caption{Figure without a bounding box included with special.}
  \label{fig:f3}
\end{figure}

You no doubt noticed that the figure is not centered, either horizontally
or vertically.  With a {\em special} command you would have to do
that on your own by specifying the hoffset, voffset, etc.  In contrast
{\em psfig} or {\em epsf} will do that for you automagically.

Also, you will notice that since the figure is included with a
{\em special}, it is impossible to know its bounding box (even if it
had one---see next example).  Therefore it cannot be shown.

\newpage

Now the following figure, Fig.~\ref{fig:f4}, does have a bounding box
but we still include it with a simple special.  Plus it is color!

\begin{figure}[h]
  \vspace{5.5in}
  \special{psfile=\illpref/f4.ps hoffset=-100 voffset=-200}
  \caption{Figure with a bounding box included with special.}
  \label{fig:f4}
\end{figure}

Even though the figure does have a bounding box we cannot show it
since it was included with a {\em special} which does no filtering
of the file whatsoever.

\newpage

The following figure, Fig.~\ref{fig:f5}, is included with {\em epsf}.

\begin{figure}[h]
  \epsfysize=5in
  \epsffile{f5.ps}
  \caption{Postscript code directly from an {\em epsf} command.}
  \label{fig:f5}
\end{figure}  

\begin{figure}[h]
  \epsffile{f6.ps}
  \caption{Postscript code directly from an {\em epsf} command (FP).}
  \label{fig:f5}
\end{figure}  

\newpage

The following figure, Fig.~\ref{fig:f6}, is included with {\em epsf}.
It is the same figure as above but a Bounding box is provided.

\begin{figure}[h]
  \epsfysize=2in
  \epsffile[100 100 400 500]{f5.ps}
  \caption{Postscript code directly from an {\em epsf} command.}
  \label{fig:f6}
\end{figure}  

This example is interesting because it shows that if you are not
careful with either the dimensions you think the picture has or the
bounding box you use for it (assuming it does not have one), then you
may have strange things happen to you.

\newpage

The following figure, Fig.~\ref{fig:f7}, is an example of raw
postscript being sent to the driver.  It was taken from the
{\em dvips} manual.

\begin{figure}[h]
  \vspace{2in}
  \vbox to 100bp{
    \special{" newpath 000 000 moveto 100 100 lineto 394 0 lineto
      closepath gsave 0.8 setgray fill grestore stroke}\vfil}
  \caption{Postscript code directly from a {\em special} command.}
  \label{fig:f7}
\end{figure}  

It may come as a bit of a surprise, but this was the last type of
{\em special} command to be implemented.  But it has now been implemented.
It has no bounding box.

\end{document}