axiom-developer
[Top][All Lists]

## [Axiom-developer] Re: several images on one page

 From: Ralf Hemmecke Subject: [Axiom-developer] Re: several images on one page Date: Mon, 18 Sep 2006 16:50:41 +0200 User-agent: Thunderbird 1.5.0.5 (X11/20060719)

At various places in the Axiom (Jenks) book there are supposed to

be multiple images on the page. Nothing I tried would place an image where I wanted it. Images "float" and tend to move to the
previous or next page and I'm unable to stop this behavior.



If you're interested take a look at the Jenks book for a page
that contains multiple images and then look at the latex code
in src/doc. See if you can reproduce the multiple image page.


I actually don't see a problem with having multiple pictures on one page.


The biggest problem is that AXIOM does not produce bounding boxes in the .ps file, so one must handcode that in the .tex file. (Which I have tried in the attached file.)

Hope that helps.

Ralf

\documentclass{book}
%\usepackage{axiom}
\usepackage{graphicx}
% struggle with latex figure-floating behavior
\renewcommand\floatpagefraction{.9}
\renewcommand\topfraction{.9}
\renewcommand\bottomfraction{.9}
\renewcommand\textfraction{.1}
\setcounter{totalnumber}{50}
\setcounter{topnumber}{50}
\setcounter{bottomnumber}{50}

% spadcommands are the actual text that you type at the axiom prompt
{\begin{flushleft}{\tt #1}\end{flushleft}\vskip .1cm }

% spadgraph are the actual text that you type at the axiom prompt for draw
{\begin{flushleft}{\tt #1}\end{flushleft}\vskip .1cm }

% returnType is the type signature returned by the axiom interpreter
\newcommand{\returnType}[1]%
{\begin{flushright}{\tt #1}\end{flushright}\vskip .1cm}

% spadsig gives the standard -> notation for signatures
\newcommand{\spadsig}[2]{{\sf #1 $\rightarrow$ #2}}

% The book begins with some introductory material that is not really
% listed as a chapter. This creates a header similar to \chapter.
\newcommand{\pseudoChapter}[1]%
{\vskip .5in \noindent {\Large{\bf #1}}\vskip .5in}

% The book begins with some introductory material that is not really
% listed as a section. This creates a header similar to \section.
\newcommand{\pseudoSection}[1]%
{\vskip .25in \noindent {\large{\bf #1}}\vskip .25in}

% spadofFrom records the operation in the index and the domain in the index
\string\tt{} #1 \endgroup}\index{#2}{\tt #1}''}

% spadfunFrom records the function name and domain in the index
\endgroup}\index{#2}}

% special meanings for math characters
\newcommand{\N}{\mbox{\bbold N}}
\newcommand{\Natural}{\mbox{\bbold N}}
\newcommand{\Z}{\mbox{\bbold Z}}
\newcommand{\Integer}{\mbox{\bbold Z}}
\newcommand{\Rational}{\mbox{\bbold Q}}
\newcommand{\Q}{\mbox{\bbold Q}}
\newcommand{\Complex}{\mbox{\bbold C}}
\newcommand{\C}{{\mathcal C}}
\newcommand{\Real}{\mbox{\bbold R}}
\newcommand{\F}{{\mathcal F}}
\newcommand{\R}{{\mathcal R}}

% draw a box around a text block
\newcommand\boxed[2]{%
\begin{center}
\begin{tabular}{|c|}
\hline
\begin{minipage}{#1}
\normalsize
{#2}
\end{minipage}\\
\hline
\end{tabular}
\end{center}}

\newcommand{\optArg}[1]{{{\tt [}{#1}{\tt ]}}}
\newcommand{\argDef}[1]{{\tt ({#1})}}
\newcommand{\funSyntax}[2]{{\bf #1}{\tt ({\small\it{#2}})}}
\newcommand{\funArgs}[1]{{\tt ({\small\it {#1}})}\newline}

\newcommand{\condata}[4]{{\bf #1} {\bf #2} {\bf #3} {\bf #4}}

\def\glossaryTerm#1{{\bf #1}\index{#1}}
\def\glossaryTermNoIndex#1{{\bf #1}}
\def\glossarySyntaxTerm#1{{\tt #1}\index{#1}}
\long\def\ourGloss#1#2{\par\pagebreak[3]{#1}\newline{#2}}
\def\csch{\mathop{\rm csch}\nolimits}

\def\erf{\mathop{\rm erf}\nolimits}

\def\zag#1#2{
{{\hfill \left. {#1} \right|}
\over
{\left| {#2} \right. \hfill}
}
}

% these bitmaps are used by HyperDoc
\newdimen\commentWidth
\commentWidth=11pc
\newdimen\colGutterWidth
\colGutterWidth=1pc
\newdimen\baseLeftSkip
\newcommand\ExitBitmap{{\setlength{\unitlength}{0.01in}\begin{picture}(50,16)(0,0)\special{psfile=ps/exit.ps}\end{picture}}}
\newcommand\ReturnBitmap{{\setlength{\unitlength}{0.01in}\begin{picture}(50,16)(0,0)\special{psfile=ps/home.ps}\end{picture}}}
\newcommand\HelpBitmap{{\setlength{\unitlength}{0.01in}\begin{picture}(50,16)(0,0)\special{psfile=ps/help.ps}\end{picture}}}
\newcommand\UpBitmap{{\setlength{\unitlength}{0.01in}\begin{picture}(50,16)(0,0)\special{psfile=ps/up.ps}\end{picture}}}
\newcommand{\tpd}[5]{{\setlength{\unitlength}{0.01in}\begin{picture}(#1,#2)(#3,#4)\special{psfile=#5}\end{picture}}}

\begin{document}

\section{Two-Dimensional Graphics}
\label{ugGraphTwoD}

The Axiom two-di\-men\-sion\-al graphics package provides the ability
to \index{graphics!two-dimensional} display
\begin{itemize}
\item curves defined by functions of a single real variable
\item curves defined by parametric equations
\item implicit non-singular curves defined by polynomial equations
\item planar graphs generated from lists of point components.
\end{itemize}

These graphs can be modified by specifying various options, such as
calculating points in the polar coordinate system or changing the size
of the graph viewport window.

\subsection{Plotting Two-Dimensional Functions of One Variable}
\label{ugGraphTwoDPlot}

\index{curve!one variable function} The first kind of
two-di\-men\-sion\-al graph is that of a curve defined by a function
$y = f(x)$ over a finite interval of the $x$ axis.

\boxed{4.6in}{
\vskip 0.1cm
The general format for drawing a function defined by a formula $f(x)$ is:
\begin{center}
{\tt draw(f(x), x = a..b, {\it options})}
\end{center}

where $a..b$ defines the range of $x$, and where {\it options}
prescribes zero or more options as described in
\ref{ugGraphTwoDOptions} on page~\pageref{ugGraphTwoDOptions}.  An
example of an option is $curveColor == bright red().$ An alternative
format involving functions $f$ and $g$ is also available.\\
}

A simple way to plot a function is to use a formula.  The first
argument is the formula.  For the second argument, write the name of
the independent variable (here, $x$), followed by an {\tt =}'', and the
range of values.

Display this formula over the range $0 \leq x \leq 6$.
Axiom converts your formula to a compiled function so that the
results can be computed quickly and efficiently.

\begin{figure}[htbp]
{\rm draw(sin(tan(x)) - tan(sin(x)),x = 0..6)\\}
\vskip 0.2cm
\includegraphics[scale=0.5,bb=0 0 300 300]{ps/2D1VarA.ps}
\caption{$sin(tan(x)) - tan(sin(x))\ \ \ x = 0 \ldots6$}
\end{figure}
{\rm
\par
Notice that Axiom compiled the function before the graph was put
on the screen.

Here is the same graph on a different interval.\\

draw(sin(tan(x)) - tan(sin(x)),x = 10..16)\\
}
\vskip 0.2cm
\begin{figure}[htbp]
\includegraphics[scale=0.5,bb=0 0 400 400]{ps/2D1VarB.ps}
\caption{$sin(tan(x)) - tan(sin(x))\ \ \ x = 10 \ldots16$}
\end{figure}

Once again the formula is converted to a compiled function before any
points were computed.  If you want to graph the same function on
several intervals, it is a good idea to define the function first so
that the function has to be compiled only once.

This time we first define the function.
%\begin{figure}
\includegraphics[scale=0.3,bb=0 0 300 300]{ps/2D1VarD.ps}
%\end{figure}
\returnType{Type: Void}
\includegraphics[scale=0.4,bb=14 14 188 199]{ps/2D1VarD.ps}
%\hspace*{\baseLeftSkip}\special{psfile=ps/2Dctrl.ps}

To draw the function, the first argument is its name and the second is
just the range with no independent variable.