From 065f154f6e6878bf07682eb15879352dd70d59e9 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Andr=C3=A9=20Wobst?= Date: Fri, 20 May 2011 07:58:29 +0000 Subject: [PATCH] prepare manual for rest conversion git-svn-id: https://pyx.svn.sourceforge.net/svnroot/pyx/trunk/pyx@3139 069f4177-920e-0410-937b-c2a4a81bcd90 --- manual/arrows.tex | 2 +- manual/axis.tex | 26 +++++++---- manual/bbox.tex | 118 ++++++++++++++++++------------------------------ manual/bitmap.tex | 7 +-- manual/box.tex | 9 +--- manual/colorname.tex | 2 +- manual/connector.tex | 7 +-- manual/deformer.tex | 4 ++ manual/document.tex | 30 +++++------- manual/epsfile.tex | 94 +++++++++++++++++--------------------- manual/gradientname.tex | 2 +- manual/graph.tex | 73 ++++++++++++------------------ manual/graphics.tex | 78 ++++++-------------------------- manual/manual.tex | 66 ++++++++++----------------- manual/pathstyles.tex | 2 +- manual/pattern.tex | 36 ++++----------- manual/text.tex | 21 +++------ manual/trafo.tex | 65 ++++++++------------------ manual/unit.tex | 89 +++++++++++++++++++----------------- 19 files changed, 276 insertions(+), 455 deletions(-) rewrite manual/bbox.tex (74%) rewrite manual/epsfile.tex (67%) diff --git a/manual/arrows.tex b/manual/arrows.tex index 5b665e9c..aa551063 100644 --- a/manual/arrows.tex +++ b/manual/arrows.tex @@ -1,3 +1,3 @@ \chapter{Arrows in deco module} \label{arrows} -\centerline{\includegraphics{arrows}} +\includegraphics{arrows} diff --git a/manual/axis.tex b/manual/axis.tex index 12f0665a..0206069f 100644 --- a/manual/axis.tex +++ b/manual/axis.tex @@ -225,7 +225,11 @@ place for axis related data. Since these features are not interesting for the average \PyX{} user, we'll not go into all the details of their parameters and except for some handy axis position methods: -\begin{methoddesc}[anchoredaxis]{basepath}{x1=None, x2=None} +\begin{classdesc}{anchoredaxis}{} + DUMMY +\end{classdesc} + +\begin{methoddesc}{basepath}{x1=None, x2=None} Returns a path instance for the base path. \var{x1} and \var{x2} define the axis range, the base path should cover. For \code{None} the beginning and end of the path is taken, which might cover a @@ -235,37 +239,37 @@ their parameters and except for some handy axis position methods: the subaxis is the first or last of the subaxes. \end{methoddesc} -\begin{methoddesc}[anchoredaxis]{vbasepath}{v1=None, v2=None} +\begin{methoddesc}{vbasepath}{v1=None, v2=None} Like \method{basepath} but in graph coordinates. \end{methoddesc} -\begin{methoddesc}[anchoredaxis]{gridpath}{x} +\begin{methoddesc}{gridpath}{x} Returns a path instance for the grid path at position \var{x}. Might return \code{None} when no grid path is available. \end{methoddesc} -\begin{methoddesc}[anchoredaxis]{vgridpath}{v} +\begin{methoddesc}{vgridpath}{v} Like \method{gridpath} but in graph coordinates. \end{methoddesc} -\begin{methoddesc}[anchoredaxis]{tickpoint}{x} +\begin{methoddesc}{tickpoint}{x} Returns the position of \var{x} as a tuple \samp{(x, y)}. \end{methoddesc} -\begin{methoddesc}[anchoredaxis]{vtickpoint}{v} +\begin{methoddesc}{vtickpoint}{v} Like \method{tickpoint} but in graph coordinates. \end{methoddesc} -\begin{methoddesc}[anchoredaxis]{tickdirection}{x} +\begin{methoddesc}{tickdirection}{x} Returns the direction of a tick at \var{x} as a tuple \samp{(dx, dy)}. The tick direction points inside of the graph. \end{methoddesc} -\begin{methoddesc}[anchoredaxis]{vtickdirection}{v} +\begin{methoddesc}{vtickdirection}{v} Like \method{tickdirection} but in graph coordinates. \end{methoddesc} -\begin{methoddesc}[anchoredaxis]{vtickdirection}{v} +\begin{methoddesc}{vtickdirection}{v} Like \method{tickdirection} but in graph coordinates. \end{methoddesc} @@ -949,6 +953,10 @@ receive a bad rating as well. The position of an axis is defined by an instance of a class providing the following methods: +\begin{classdesc}{positioner}{} + DUMMY +\end{classdesc} + \begin{methoddesc}{vbasepath}{v1=None, v2=None} Returns a path instance for the base path. \var{v1} and \var{v2} define the axis range in graph coordinates the base path should diff --git a/manual/bbox.tex b/manual/bbox.tex dissimilarity index 74% index 44abae70..ff0ac3a6 100644 --- a/manual/bbox.tex +++ b/manual/bbox.tex @@ -1,74 +1,44 @@ -\chapter{Module bbox} - -\label{bbox} - -The \texttt{bbox} module contains the definition of the \texttt{bbox} -class representing bounding boxes of graphical elements like paths, -canvases, etc.\ used in \PyX. Usually, you obtain \texttt{bbox} -instances as return values of the corresponding \texttt{bbox())} -method, but you may also construct a bounding box by yourself. - -\section{bbox constructor} - -The \texttt{bbox} constructor accepts the following keyword arguments - -\medskip -\begin{tabularx}{\linewidth}{l>{\raggedright\arraybackslash}X} -keyword & description\\ -\hline -\texttt{llx}&\texttt{None} (default) for $-\infty$ or $x$-position of -the lower left corner of the bbox (in user units)\\ -\texttt{lly}&\texttt{None} (default) for $-\infty$ or $y$-position of -the lower left corner of the bbox (in user units)\\ -\texttt{urx}&\texttt{None} (default) for $\infty$ or $x$-position of -the upper right corner of the bbox (in user units)\\ -\texttt{ury}&\texttt{None} (default) for $\infty$ or $y$-position of -the upper right corner of the bbox (in user units) -\end{tabularx} - -\section{bbox methods} - -%Instances of the \texttt{bbox} class offer the following methods: -%\medskip - -\begin{tabularx} - {\linewidth} - {>{\hsize=.85\hsize}X>{\raggedright\arraybackslash\hsize=1.15\hsize}X} - \texttt{bbox} method & function \\ - \hline - \texttt{intersects(other)} & returns \texttt{1} if the \texttt{bbox} instance - and \texttt{other} intersect with each other.\\ - \texttt{transformed(self, trafo)}& returns \texttt{self} transformed - by transformation \texttt{trafo}.\\ - \texttt{enlarged(all=0, bottom=None, - \newline\phantom{enlarged(}left=None, top=None, - \newline\phantom{enlarged(}right=None)} & - return the bounding box enlarged by the given amount (in visual - units). \texttt{all} is the default for all other directions, which - is used whenever \texttt{None} is given for the corresponding - direction.\\ - \texttt{path()} or \texttt{rect()} & return the \texttt{path} corresponding to the - bounding box rectangle.\\ - \texttt{height()} & returns the height of the bounding box (in \PyX{} - lengths).\\ - \texttt{width()} & returns the width of the bounding box (in \PyX{} - lengths).\\ - \texttt{top()} & returns the $y$-position of the top of the bounding - box (in \PyX{} lengths).\\ - \texttt{bottom()} & returns the $y$-position of the bottom of the - bounding box (in \PyX{} lengths).\\ - \texttt{left()} & returns the $x$-position of the left side of the - bounding box (in \PyX{} lengths).\\ - \texttt{right()} & returns the $x$-position of the right side of the - bounding box (in \PyX{} lengths).\\ - \end{tabularx} -\medskip - -Furthermore, two bounding boxes can be added (giving the bounding box -enclosing both) and multiplied (giving the intersection of both -bounding boxes). - -%%% Local Variables: -%%% mode: latex -%%% TeX-master: "manual.tex" -%%% End: +\chapter{Module bbox} + +\label{bbox} + +The \texttt{bbox} module contains the definition of the \texttt{bbox} +class representing bounding boxes of graphical elements like paths, +canvases, etc.\ used in \PyX. Usually, you obtain \texttt{bbox} +instances as return values of the corresponding \texttt{bbox())} +method, but you may also construct a bounding box by yourself. + +\section{bbox constructor} + +The \texttt{bbox} constructor accepts the following keyword arguments + +\begin{tableii}{l|l}{textrm}{keyword}{description} +\lineii{\texttt{llx}}{\texttt{None} (default) for $-\infty$ or $x$-position of the lower left corner of the bbox (in user units)} +\lineii{\texttt{lly}}{\texttt{None} (default) for $-\infty$ or $y$-position of the lower left corner of the bbox (in user units)} +\lineii{\texttt{urx}}{\texttt{None} (default) for $\infty$ or $x$-position of the upper right corner of the bbox (in user units)} +\lineii{\texttt{ury}}{\texttt{None} (default) for $\infty$ or $y$-position of the upper right corner of the bbox (in user units)} +\end{tableii} + +\section{bbox methods} + +\begin{tableii}{l|l}{textrm}{\texttt{bbox} method}{function} +\lineii{\texttt{intersects(other)}}{returns \texttt{1} if the \texttt{bbox} instance and \texttt{other} intersect with each other.} +\lineii{\texttt{transformed(self, trafo)}}{returns \texttt{self} transformed by transformation \texttt{trafo}.} +\lineii{\texttt{enlarged(all=0, bottom=None, left=None, top=None, right=None)}}{return the bounding box enlarged by the given amount (in visual units). \texttt{all} is the default for all other directions, which is used whenever \texttt{None} is given for the corresponding direction.} +\lineii{\texttt{path()} or \texttt{rect()}}{return the \texttt{path} corresponding to the bounding box rectangle.} +\lineii{\texttt{height()}}{returns the height of the bounding box (in \PyX{} lengths).} +\lineii{\texttt{width()}}{returns the width of the bounding box (in \PyX{} lengths).} +\lineii{\texttt{top()}}{returns the $y$-position of the top of the bounding box (in \PyX{} lengths).} +\lineii{\texttt{bottom()}}{returns the $y$-position of the bottom of the bounding box (in \PyX{} lengths).} +\lineii{\texttt{left()}}{returns the $x$-position of the left side of the bounding box (in \PyX{} lengths).} +\lineii{\texttt{right()}}{returns the $x$-position of the right side of the bounding box (in \PyX{} lengths).} +\end{tableii} + +Furthermore, two bounding boxes can be added (giving the bounding box +enclosing both) and multiplied (giving the intersection of both +bounding boxes). + +%%% Local Variables: +%%% mode: latex +%%% TeX-master: "manual.tex" +%%% End: diff --git a/manual/bitmap.tex b/manual/bitmap.tex index b4a57661..076013a6 100644 --- a/manual/bitmap.tex +++ b/manual/bitmap.tex @@ -42,11 +42,8 @@ c.insert(bitmap_rgb) c.writeEPSfile("bitmap") \end{verbatim} Figure~\ref{fig:bitmap} shows the resulting output. -\begin{figure}[ht] -\centerline{\includegraphics{bitmap}} -\caption{An introductory bitmap example.} -\label{fig:bitmap} -\end{figure} +\includegraphics{bitmap} +\centerline{An introductory bitmap example.} \section{Bitmap module} \declaremodule{}{bitmap} diff --git a/manual/box.tex b/manual/box.tex index a39bd6e2..92095d75 100644 --- a/manual/box.tex +++ b/manual/box.tex @@ -26,7 +26,6 @@ The corners have to be ordered counterclockwise. In the following list some methods of this \verb|polygon| class are explained: \begin{description} -\raggedright \item[\texttt{path(centerradius=None, bezierradius=None, beziersoftness=1)}:] returns a path of the box; the center might be marked by a small circle of radius \verb|centerradius|; the corners @@ -40,12 +39,9 @@ to the box \item[\texttt{reltransform(*trafos)}:] performs a list of transformations to the box relative to the box center -\begin{figure} -\centerline{\includegraphics{boxalign}} -\caption{circle and line alignment examples (equal direction and +\includegraphics{boxalign} +\centerline{circle and line alignment examples (equal direction and distance)} -\label{fig:boxalign} -\end{figure} \item[\texttt{circlealignvector(a, dx, dy)}:] returns a vector (a tuple (x, y)) to align the box at a circle with radius \verb|a| in @@ -70,7 +66,6 @@ the box \section{Functions working on a box list} \begin{description} -\raggedright \item[\texttt{circlealignequal(boxes, a, dx, dy)}:] Performs a circle alignment of the boxes \verb|boxes| using the parameters \verb|a|, \verb|dx|, and \verb|dy| as in the \verb|circlealign| method. For the diff --git a/manual/colorname.tex b/manual/colorname.tex index 77f9d170..45676c13 100644 --- a/manual/colorname.tex +++ b/manual/colorname.tex @@ -1,3 +1,3 @@ \chapter{Named colors} \label{colorname} -\centerline{\includegraphics{colorname}} +\includegraphics{colorname} diff --git a/manual/connector.tex b/manual/connector.tex index 114dde30..9d5ca4f2 100644 --- a/manual/connector.tex +++ b/manual/connector.tex @@ -53,14 +53,9 @@ given.\\ (Default: \code{absbulge=None}, \code{relbulge=0.39}; these default values produce output similar to the defaults of \class{arc}.)\medskip -\begin{figure}[hbt] -\centerline{ \includegraphics{connector} -} -\caption{The angle-parameters of the connector.arc (left panel) and the +\centerline{The angle-parameters of the connector.arc (left panel) and the connector.curve (right panel) classes.} -\label{fig:connector} -\end{figure} \section{Class \class{twolines}} diff --git a/manual/deformer.tex b/manual/deformer.tex index 35557ab2..6270b4d4 100644 --- a/manual/deformer.tex +++ b/manual/deformer.tex @@ -12,6 +12,10 @@ module is that here, a totally new path is constructed. All classes of the \module{deformer} module provide the following methods: +\begin{classdesc}{deformer}{} + DUMMY +\end{classdesc} + \begin{methoddesc}{__call__}{(specific parameters for the class)} Returns a deformer with modified parameters \end{methoddesc} diff --git a/manual/document.tex b/manual/document.tex index adf2844a..cd84b552 100644 --- a/manual/document.tex +++ b/manual/document.tex @@ -88,25 +88,17 @@ Define a \class{paperformat} with the given \var{width} and Predefined paperformats are listed in the following table \medskip -\begin{center} -\begin{tabular}{l|l|l|l} -instance & name & width & height \\ -\hline -\constant{document.paperformat.A0} & A0 & \unit[840]{mm} & -\unit[1188]{mm}\\ -\constant{document.paperformat.A0b} & &\unit[910]{mm} & -\unit[1370]{mm}\\ -\constant{document.paperformat.A1} & A1& \unit[594]{mm} & -\unit[840]{mm}\\ -\constant{document.paperformat.A2} & A2& \unit[420]{mm} & -\unit[594]{mm}\\ -\constant{document.paperformat.A3} & A3 & \unit[297]{mm} & \unit[420]{mm}\\ -\constant{document.paperformat.A4} & A4& \unit[210]{mm} & \unit[297]{mm}\\ -\constant{document.paperformat.Letter} & Letter & \unit[8.5]{inch} & -\unit[11]{inch}\\ -\constant{document.paperformat.Legal} & Legal & \unit[8.5]{inch} & \unit[14]{inch} -\end{tabular} -\end{center} +\begin{tableiv}{l|l|l|l}{textrm}{instance}{name}{width}{height} +\lineiv{\constant{document.paperformat.A0}}{A0}{840 mm}{1188 mm} +\lineiv{\constant{document.paperformat.A0b}}{}{910 mm}{1370 mm} +\lineiv{\constant{document.paperformat.A1}}{A1}{594 mm}{840 mm} +\lineiv{\constant{document.paperformat.A2}}{A2}{420 mm}{594 mm} +\lineiv{\constant{document.paperformat.A3}}{A3}{297 mm}{420 mm} +\lineiv{\constant{document.paperformat.A4}}{A4}{210 mm}{297 mm} +\lineiv{\constant{document.paperformat.A5}}{A5}{148.5 mm}{210 mm} +\lineiv{\constant{document.paperformat.Letter}}{Letter}{8.5 inch}{11 inch} +\lineiv{\constant{document.paperformat.Legal}}{Legal}{8.5 inch}{14 inch} +\end{tableiv} \medskip diff --git a/manual/epsfile.tex b/manual/epsfile.tex dissimilarity index 67% index db250b41..8b2bf8bb 100644 --- a/manual/epsfile.tex +++ b/manual/epsfile.tex @@ -1,53 +1,41 @@ -\chapter{Module epsfile: EPS file inclusion} - -With the help of the \verb|epsfile.epsfile| class, you can easily embed -another EPS file in your canvas, thereby scaling, aligning the content -at discretion. The most simple example looks like -\begin{quote} -\begin{verbatim} -from pyx import * -c = canvas.canvas() -c.insert(epsfile.epsfile(0, 0, "file.eps")) -c.writeEPSfile("output") -\end{verbatim} -\end{quote} - -All relevant parameters are passed to the \verb|epsfile.epsfile| -constructor. They are summarized in the following table: - -\medskip -\begin{tabularx}{\linewidth}{l>{\raggedright\arraybackslash}X} -argument name&description\\ -\hline -\texttt{x} & $x$-coordinate of position.\\ -\texttt{y} & $y$-coordinate of position.\\ -\texttt{filename} & Name of the EPS file (including a possible -extension).\\ -\texttt{width=None} & Desired width of EPS graphics or \texttt{None} -for original width. Cannot be combined with scale specification.\\ -\texttt{height=None} & Desired height of EPS graphics or \texttt{None} -for original height. Cannot be combined with scale specification.\\ -\texttt{scale=None} & Scaling factor for EPS graphics or \texttt{None} -for no scaling. Cannot be combined with width or height specification.\\ -\texttt{align="bl"} & Alignment of EPS graphics. The first character -specifies the vertical alignment: \texttt{b} for bottom, \texttt{c} -for center, and \texttt{t} for top. The second character fixes the -horizontal alignment: \texttt{l} for left, \texttt{c} for center -\texttt{r} for right.\\ -\texttt{clip=1} & Clip to bounding box of EPS file?\\ -\texttt{translatebbox=1} & Use lower left corner of bounding box of EPS -file? Set to $0$ with care.\\ -\texttt{bbox=None} & If given, use \texttt{bbox} instance instead of -bounding box of EPS file.\\ -\texttt{kpsearch=0} & Search for file using the kpathsea library. -\end{tabularx} - - - -\label{epsfile} - -%%% Local Variables: -%%% mode: latex -%%% TeX-master: "manual.tex" -%%% End: - +\chapter{Module epsfile: EPS file inclusion} + +With the help of the \verb|epsfile.epsfile| class, you can easily embed +another EPS file in your canvas, thereby scaling, aligning the content +at discretion. The most simple example looks like +\begin{quote} +\begin{verbatim} +from pyx import * +c = canvas.canvas() +c.insert(epsfile.epsfile(0, 0, "file.eps")) +c.writeEPSfile("output") +\end{verbatim} +\end{quote} + +All relevant parameters are passed to the \verb|epsfile.epsfile| +constructor. They are summarized in the following table: + +\medskip +\begin{tableii}{l|l}{textrm}{argument name}{description} +\lineii{\texttt{x}}{$x$-coordinate of position.} +\lineii{\texttt{y}}{$y$-coordinate of position.} +\lineii{\texttt{filename}}{Name of the EPS file (including a possible extension).} +\lineii{\texttt{width=None}}{Desired width of EPS graphics or \texttt{None} for original width. Cannot be combined with scale specification.} +\lineii{\texttt{height=None}}{Desired height of EPS graphics or \texttt{None} for original height. Cannot be combined with scale specification.} +\lineii{\texttt{scale=None}}{Scaling factor for EPS graphics or \texttt{None} for no scaling. Cannot be combined with width or height specification.} +\lineii{\texttt{align="bl"}}{Alignment of EPS graphics. The first character specifies the vertical alignment: \texttt{b} for bottom, \texttt{c} for center, and \texttt{t} for top. The second character fixes the horizontal alignment: \texttt{l} for left, \texttt{c} for center \texttt{r} for right.} +\lineii{\texttt{clip=1}}{Clip to bounding box of EPS file?} +\lineii{\texttt{translatebbox=1}}{Use lower left corner of bounding box of EPS file? Set to $0$ with care.} +\lineii{\texttt{bbox=None}}{If given, use \texttt{bbox} instance instead of bounding box of EPS file.} +\lineii{\texttt{kpsearch=0}}{Search for file using the kpathsea library.} +\end{tableii} + + + +\label{epsfile} + +%%% Local Variables: +%%% mode: latex +%%% TeX-master: "manual.tex" +%%% End: + diff --git a/manual/gradientname.tex b/manual/gradientname.tex index 134cf0c2..8abcd466 100644 --- a/manual/gradientname.tex +++ b/manual/gradientname.tex @@ -1,3 +1,3 @@ \chapter{Named gradients} \label{gradientname} -\centerline{\includegraphics{gradientname}} +\includegraphics{gradientname} diff --git a/manual/graph.tex b/manual/graph.tex index 155c9978..45fef2f7 100644 --- a/manual/graph.tex +++ b/manual/graph.tex @@ -40,11 +40,8 @@ g.writeEPSfile("graph") \end{verbatim} The result \file{graph.eps} is shown in figure~\ref{fig:graph}. -\begin{figure}[ht] -\centerline{\includegraphics{graph}} -\caption[A minimalistic plot for the data from a file.]{A minimalistic plot for the data from file \file{graph.dat}.} -\label{fig:graph} -\end{figure} +\includegraphics{graph} +\centerline{A minimalistic plot for the data from file \file{graph.dat}.} Instead of plotting data from a file, other data source are available as well. For example function data is created and placed into @@ -63,11 +60,8 @@ addressed in more detail in section~\ref{graph:graph}. As you can see in figure~\ref{fig:graph2}, a function is plotted as a line by default. -\begin{figure}[ht] -\centerline{\includegraphics{graph2}} -\caption{Plotting data from a file together with a function.} -\label{fig:graph2} -\end{figure} +\includegraphics{graph2} +\centerline{Plotting data from a file together with a function.} While the axes ranges got adjusted automatically in the previous example, they might be fixed by keyword options in axes constructors. @@ -79,12 +73,8 @@ logathmic axis in y-direction: The result is shown in figure~\ref{fig:graph3}. -\begin{figure}[ht] -\centerline{\includegraphics{graph3}} -\caption{Plotting a function for a given axis range and use a -logarithmic y-axis.} -\label{fig:graph3} -\end{figure} % }}} +\includegraphics{graph3} +\centerline{Plotting a function for a given axis range and use a logarithmic y-axis.} \section{Component architecture} % {{{ \label{graph:components} @@ -657,28 +647,28 @@ For the sake of completeness we list the default patterns: The builtins in math expressions are listed in the following table: \begin{tableii}{l|l}{textrm}{name}{value} -\code{neg}&\code{lambda x: -x}\\ -\code{abs}&\code{lambda x: x < 0 and -x or x}\\ -\code{sgn}&\code{lambda x: x < 0 and -1 or 1}\\ -\code{sqrt}&\code{math.sqrt}\\ -\code{exp}&\code{math.exp}\\ -\code{log}&\code{math.log}\\ -\code{sin}&\code{math.sin}\\ -\code{cos}&\code{math.cos}\\ -\code{tan}&\code{math.tan}\\ -\code{asin}&\code{math.asin}\\ -\code{acos}&\code{math.acos}\\ -\code{atan}&\code{math.atan}\\ -\code{sind}&\code{lambda x: math.sin(math.pi/180*x)}\\ -\code{cosd}&\code{lambda x: math.cos(math.pi/180*x)}\\ -\code{tand}&\code{lambda x: math.tan(math.pi/180*x)}\\ -\code{asind}&\code{lambda x: 180/math.pi*math.asin(x)}\\ -\code{acosd}&\code{lambda x: 180/math.pi*math.acos(x)}\\ -\code{atand}&\code{lambda x: 180/math.pi*math.atan(x)}\\ -\code{norm}&\code{lambda x, y: math.hypot(x, y)}\\ -\code{splitatvalue}&see the \code{splitatvalue} description below\\ -\code{pi}&\code{math.pi}\\ -\code{e}&\code{math.e} +\lineii{\code{neg}}{\code{lambda x: -x}} +\lineii{\code{abs}}{\code{lambda x: x < 0 and -x or x}} +\lineii{\code{sgn}}{\code{lambda x: x < 0 and -1 or 1}} +\lineii{\code{sqrt}}{\code{math.sqrt}} +\lineii{\code{exp}}{\code{math.exp}} +\lineii{\code{log}}{\code{math.log}} +\lineii{\code{sin}}{\code{math.sin}} +\lineii{\code{cos}}{\code{math.cos}} +\lineii{\code{tan}}{\code{math.tan}} +\lineii{\code{asin}}{\code{math.asin}} +\lineii{\code{acos}}{\code{math.acos}} +\lineii{\code{atan}}{\code{math.atan}} +\lineii{\code{sind}}{\code{lambda x: math.sin(math.pi/180*x)}} +\lineii{\code{cosd}}{\code{lambda x: math.cos(math.pi/180*x)}} +\lineii{\code{tand}}{\code{lambda x: math.tan(math.pi/180*x)}} +\lineii{\code{asind}}{\code{lambda x: 180/math.pi*math.asin(x)}} +\lineii{\code{acosd}}{\code{lambda x: 180/math.pi*math.acos(x)}} +\lineii{\code{atand}}{\code{lambda x: 180/math.pi*math.atan(x)}} +\lineii{\code{norm}}{\code{lambda x, y: math.hypot(x, y)}} +\lineii{\code{splitatvalue}}{see the \code{splitatvalue} description below} +\lineii{\code{pi}}{\code{math.pi}} +\lineii{\code{e}}{\code{math.e}} \end{tableii} \code{math} refers to Pythons \module{math} module. The \code{splitatvalue} function is defined as: @@ -929,13 +919,6 @@ definition is: the data provided by the \class{range} style. The additional data column named \code{color} specifies the color of the rectangle defined by \var{gradient}. The valid color range is [0:1]. - - \begin{note} - Although this style can be used for plotting colored surfaces, it - will lead to a huge memory footprint of \PyX{} together with a - long running time and large outputs. Improved support for colored - surfaces is planned for the future. - \end{note} \end{classdesc} % }}} \begin{classdesc}{histogram}{lineattrs=[], steps=0, fromvalue=0, % {{{ diff --git a/manual/graphics.tex b/manual/graphics.tex index 40c25ecf..05d374f7 100644 --- a/manual/graphics.tex +++ b/manual/graphics.tex @@ -80,13 +80,10 @@ subpaths (see Fig.~\ref{fig:rects}a). In a better solution (see Fig.~\ref{fig:rects}b), the pen is not lifted between the first and the last point: % -\begin{figure} -\centerline{\includegraphics{rects}} -\caption{Rectangle consisting of (a) four separate lines, (b) one open +\includegraphics{rects} +\centerline{Rectangle consisting of (a) four separate lines, (b) one open path, and (c) one closed path. (d) Filling a path always closes it automatically.} -\label{fig:rects} -\end{figure} % \begin{verbatim} rect2 = path.path(path.moveto(0, 0), path.lineto(0, 1), @@ -146,11 +143,8 @@ Suppose you want to draw the radii to the intersection points of a circle with a straight line. This task can be done using the following code which results in Fig.~\ref{fig:radii} \verbatiminput{radii.py} -\begin{figure} -\centerline{\includegraphics{radii}} -\caption{Example: Intersection of circle with line yielding two radii.} -\label{fig:radii} -\end{figure} +\includegraphics{radii} +\centerline{Example: Intersection of circle with line yielding two radii.} Here, the basic elements, a circle around the point $(0, 0)$ with radius $2$ and a straight line, are defined. Then, passing the \var{line}, to the \method{intersect()} method of \var{circle}, we obtain a tuple of @@ -181,12 +175,9 @@ line1, line2, line3 = line.split(isects_line) segment = line2 << arc \end{verbatim} -\begin{figure} -\centerline{\includegraphics{radii2}} -\caption{Example: Intersection of circle with line yielding radii and +\includegraphics{radii2} +\centerline{Example: Intersection of circle with line yielding radii and circle segment.} -\label{fig:radii2} -\end{figure} Here, we first split the circle using the \method{split()} method passing the list of parameters obtained above. Since the circle is closed, this yields two arc segments. We then use the \method{arclen()}, which @@ -304,54 +295,15 @@ clears all strokestyle subclasses and thus \class{style.linewidth} and \code{attr.clear}. An overview over the most important attribute typesprovided by PyX is given in the following table. \medskip -\begin{center} -\begin{tabular}{l|l|p{0.3\linewidth}} -Attribute category & description & examples\\ -\hline -\class{deco.deco} & decorator specifying the way the path is drawn & -\class{deco.stroked}\newline -\class{deco.filled}\newline -\class{deco.arrow} -\\ -\class{style.strokestyle} & style used for path stroking & -\class{style.linecap}\newline -\class{style.linejoin}\newline -\class{style.miterlimit}\newline -\class{style.dash}\newline -\class{style.linestyle}\newline -\class{style.linewidth}\newline -\class{color.color} -\\ -\class{style.fillstyle} & style used for path filling & -\class{color.color}\newline\class{pattern.pattern} -\\ -\class{style.filltype} & type of path filling & -\code{style.filltype.nonzero_winding} (default)\newline\code{style.filltype.even_odd} -\\ -\class{deformer.deformer} & -operations changing the shape of the path -& -\class{deformer.cycloid}\newline -\class{deformer.smoothed} -\\ -\class{text.textattr} & attributes used for typesetting & -\class{text.halign}\newline -\class{text.valign}\newline -\class{text.mathmode}\newline -\class{text.phantom}\newline -\class{text.size}\newline -\class{text.parbox} -\\ -\class{trafo.trafo} -& transformations applied when drawing object -& -\class{trafo.mirror}\newline -\class{trafo.rotate}\newline -\class{trafo.scale}\newline -\class{trafo.slant}\newline -\class{trafo.translate} -\end{tabular} -\end{center} +\begin{tableiii}{l|l|l}{textrm}{Attribute category}{description}{examples} +\lineiii{\class{deco.deco}}{decorator specifying the way the path is drawn}{\class{deco.stroked}, \class{deco.filled}, \class{deco.arrow}} +\lineiii{\class{style.strokestyle}}{style used for path stroking}{\class{style.linecap}, \class{style.linejoin}, \class{style.miterlimit}, \class{style.dash}, \class{style.linestyle}, \class{style.linewidth}, \class{color.color}} +\lineiii{\class{style.fillstyle}}{style used for path filling}{\class{color.color}, \class{pattern.pattern}} +\lineiii{\class{style.filltype}}{type of path filling}{\code{style.filltype.nonzero_winding} (default), \code{style.filltype.even_odd}} +\lineiii{\class{deformer.deformer}}{operations changing the shape of the path}{\class{deformer.cycloid}, \class{deformer.smoothed}} +\lineiii{\class{text.textattr}}{attributes used for typesetting}{\class{text.halign}, \class{text.valign}, \class{text.mathmode}, \class{text.phantom}, \class{text.size}, \class{text.parbox}} +\lineiii{\class{trafo.trafo}}{ransformations applied when drawing object}{\class{trafo.mirror}, \class{trafo.rotate}, \class{trafo.scale}, \class{trafo.slant}, \class{trafo.translate}} +\end{tableiii} \medskip XXX specify which classes in the table are in fact instances diff --git a/manual/manual.tex b/manual/manual.tex index ae1dbfdc..c367c969 100644 --- a/manual/manual.tex +++ b/manual/manual.tex @@ -1,23 +1,13 @@ \documentclass{manual} - -% to shorten edit-compile-view cycles use -% \includeonly{graph} - \usepackage{pyx} -\ifhtml -\def\PyX{PyX} % redefine the PyX macro for html (the other makes trouble) -\def\textquotedbl{"} % make double quotes available in html -\fi \usepackage{graphicx} \usepackage[T1]{fontenc} -\usepackage{tabularx} % TODO: get rid of that -\usepackage{units} % TODO: get rid of that \title{\PyX{} Reference Manual} \author{J\"org Lehmann, Andr\'e Wobst} \authoraddress{http://pyx.sourceforge.net/} -\date{\input{pyxdate.tex}} -\release{\input{pyxversion.tex}} +\date{DUMMY} +\release{DUMMY} \makeindex @@ -26,9 +16,6 @@ \maketitle \cleardoublepage -\ifhtml % make abstract better available (as in the Python docs) -\chapter*{Front Matter\label{front}} -\fi \begin{abstract} \noindent \PyX{} is a Python package for the creation of PostScript and PDF files. It @@ -39,31 +26,28 @@ built out of these primitives. \tableofcontents -\include{intro} -\include{graphics} -\include{path} -%\include{deco} -\include{deformer} -\include{canvas} -\include{document} -\include{text} -\include{graph} -\include{axis} -\include{box} -\include{connector} -\include{epsfile} -\include{bitmap} -\include{bbox} -\include{color} -\include{pattern} -\include{unit} -\include{trafo} -\appendix -\include{colorname} -\include{palettename} -\include{pathstyles} -\include{arrows} - -\input{manual.ind} +% \include{intro} +% \include{graphics} +% \include{path} +% \include{deformer} +% \include{canvas} +% \include{document} +% \include{text} +% \include{graph} +% \include{axis} +% \include{box} +% \include{connector} +% \include{epsfile} +% \include{bitmap} +% \include{bbox} +% \include{color} +% \include{pattern} +% \include{unit} +% \include{trafo} +% \appendix +% \include{colorname} +% \include{palettename} +% \include{pathstyles} +% \include{arrows} \end{document} diff --git a/manual/pathstyles.tex b/manual/pathstyles.tex index 795c0d5f..4adc9f45 100644 --- a/manual/pathstyles.tex +++ b/manual/pathstyles.tex @@ -1,3 +1,3 @@ \chapter{Module \module{style}} \label{pathstyles} -\centerline{\includegraphics{pathstyles}} +\includegraphics{pathstyles} diff --git a/manual/pattern.tex b/manual/pattern.tex index 540a6aa6..8dea70c1 100644 --- a/manual/pattern.tex +++ b/manual/pattern.tex @@ -19,33 +19,15 @@ the former. The \class{pattern} constructor accepts the following keyword arguments: \medskip -\begin{tabularx}{\linewidth}{l>{\raggedright\arraybackslash}X} -keyword&description\\ -\hline -\texttt{painttype}&\texttt{1} (default) for coloured patterns or -\texttt{2} for uncoloured patterns\\ -\texttt{tilingtype}&\texttt{1} (default) for constant spacing tilings -(patterns are spaced constantly by a multiple of a device pixel), -\texttt{2} for undistorted pattern cell, whereby the spacing may vary -by as much as one device pixel, or \texttt{3} for constant spacing and -faster tiling which behaves as tiling type \texttt{1} but with -additional distortion allowed to permit a more efficient -implementation.\\ -\texttt{xstep}&desired horizontal spacing between pattern cells, use -\texttt{None} (default) for automatic calculation from pattern -bounding box.\\ -\texttt{ystep}&desired vertical spacing between pattern cells, use -\texttt{None} (default) for automatic calculation from pattern -bounding box.\\ -\texttt{bbox}&bounding box of pattern. Use \texttt{None} for an -automatic determination of the bounding box (including an -enlargement by \texttt{bboxenlarge} pts on each side.)\\ -\texttt{trafo}&additional transformation applied to pattern or -\texttt{None} (default). This may be used to rotate the pattern or to -shift its phase (by a translation).\\ -\texttt{bboxenlarge}&enlargement when using the automatic bounding box -determination; default is 5 pts. -\end{tabularx} +\begin{tableii}{l|l}{textrm}{keyword}{description} +\lineii{\texttt{painttype}}{\texttt{1} (default) for coloured patterns or \texttt{2} for uncoloured patterns} +\lineii{\texttt{tilingtype}}{\texttt{1} (default) for constant spacing tilings (patterns are spaced constantly by a multiple of a device pixel), \texttt{2} for undistorted pattern cell, whereby the spacing may vary by as much as one device pixel, or \texttt{3} for constant spacing and faster tiling which behaves as tiling type \texttt{1} but with additional distortion allowed to permit a more efficient implementation.} +\lineii{\texttt{xstep}}{desired horizontal spacing between pattern cells, use \texttt{None} (default) for automatic calculation from pattern bounding box.} +\lineii{\texttt{ystep}}{desired vertical spacing between pattern cells, use \texttt{None} (default) for automatic calculation from pattern bounding box.} +\lineii{\texttt{bbox}}{bounding box of pattern. Use \texttt{None} for an automatic determination of the bounding box (including an enlargement by \texttt{bboxenlarge} pts on each side.)} +\lineii{\texttt{trafo}}{additional transformation applied to pattern or \texttt{None} (default). This may be used to rotate the pattern or to shift its phase (by a translation).} +\lineii{\texttt{bboxenlarge}}{enlargement when using the automatic bounding box determination; default is 5 pts.} +\end{tableii} \medskip After you have created a pattern instance, you define the pattern diff --git a/manual/text.tex b/manual/text.tex index 14a1fd3b..3f9af6fd 100644 --- a/manual/text.tex +++ b/manual/text.tex @@ -1,4 +1,4 @@ -\chapter[Module \module{text}: TeX/LaTeX interface]{Module \module{text}: \TeX/\LaTeX{} interface} +\chapter{Module \module{text}: \TeX/\LaTeX{} interface} \label{module:text} \section{Basic functionality} @@ -32,8 +32,7 @@ alternative font mapping files like \texttt{psfonts.cmz} in the global the \var{fontmap} keyword argument to a texrunners \method{text} method to use different mappings within a single outout file. -\section[TeX/LaTeX instances: the \class{texrunner} class]% -{\TeX/\LaTeX{} instances: the \class{texrunner} class} +\section{\TeX/\LaTeX{} instances: the \class{texrunner} class} \declaremodule{}{text} \modulesynopsis{\TeX/\LaTeX interface} @@ -193,8 +192,7 @@ instance is started when the \method{text()} method is called again. \end{methoddesc} -\section[TeX/LaTeX attributes] -{\TeX/\LaTeX{} attributes} +\section{\TeX/\LaTeX{} attributes} \declaremodule{}{text} \modulesynopsis{\TeX/\LaTeX interface} @@ -276,11 +274,8 @@ from each other. Some handy instances available as class members: \code{halign(1, 1)}. \end{memberdesc} -\begin{figure} -\centerline{\includegraphics{textvalign}} -\caption{valign example} -\label{fig:textvalign} -\end{figure} +\includegraphics{textvalign} +\centerline{valign example} \begin{classdesc}{valign}{valign} Instances of this class set the vertical alignment of a text box to @@ -441,8 +436,7 @@ attribute) are available at module level. Skip the text in the box, but keep its size. \end{datadesc} -\section[Using the graphics-bundle with LaTeX]% -{Using the graphics-bundle with \LaTeX} +\section{Using the graphics-bundle with \LaTeX} The packages in the \LaTeX{} graphics bundle (\texttt{color.sty}, \texttt{graphics.sty}, \texttt{graphicx.sty}, \ldots) make extensive use of @@ -506,8 +500,7 @@ moment: ends rotation. \end{description} -\section[TeX message parsers]% -{\TeX{} message parsers} +\section{\TeX{} message parsers} \declaremodule{}{text} \modulesynopsis{\TeX/\LaTeX interface} diff --git a/manual/trafo.tex b/manual/trafo.tex index 498c5705..f08efad2 100644 --- a/manual/trafo.tex +++ b/manual/trafo.tex @@ -12,9 +12,9 @@ like translation, rotation, scaling, and mirroring. The \verb|trafo| class represents a general linear transformation, which is defined for a vector $\vec{x}$ as -\[ +\begin{displaymath} \vec{x}' = \mathsf{A}\, \vec{x} + \vec{b}\ , -\] +\end{displaymath} where $\mathsf{A}$ is the transformation matrix and $\vec{b}$ the translation vector. The transformation matrix must not be singular, \textit{i.e.} we require $\det \mathsf{A} \ne 0$. @@ -37,33 +37,16 @@ The methods of the \verb|trafo| class are summarized in the following table. \medskip -\begin{tabularx}{\linewidth}{>{\hsize=.8\hsize}X>{\raggedright\arraybackslash\hsize=1.2\hsize}X} -\texttt{trafo} method & function \\ -\hline -\texttt{\_\_init\_\_(matrix=((1,0),(0,1)),\newline -\phantom{\_\_init\_\_(}vector=(0,0)):} & create new \texttt{trafo} -instance with transformation \texttt{matrix} and \texttt{vector}. -\\ -\texttt{apply(x, y)} & apply \texttt{trafo} to point vector -$(\mathtt{x}, \mathtt{y})$.\\ -\texttt{inverse()} & returns inverse transformation of -\texttt{trafo}.\\ -\texttt{mirrored(angle)} & returns \texttt{trafo} followed by mirroring -at line through $(0,0)$ with direction \texttt{angle} in degrees.\\ -\texttt{rotated(angle, \newline\phantom{rotate(}x=None, y=None)} & -returns \texttt{trafo} followed by rotation by \texttt{angle} degrees -around point $(\mathtt{x}, -\mathtt{y})$, or $(0,0)$, if not given.\\ -\texttt{scaled(sx, sy=None,\newline\phantom{scale(}x=None, y=None)} & -returns \texttt{trafo} followed by -scaling with scaling factor \texttt{sx} in $x$-direction, \texttt{sy} in -$y$-direction ($\mathtt{sy}=\mathtt{sx}$, if not given) with scaling -center $(\mathtt{x}, \mathtt{y})$, or $(0,0)$, if not given.\\ -\texttt{translated(x, y)} & returns \texttt{trafo} followed by -translation by vector $(\mathtt{x}, \mathtt{y})$.\\ -\texttt{slanted(a, angle=0, x=None, y=None)} & returns \texttt{trafo} -followed by XXX\\ -\end{tabularx} +\begin{tableii}{l|l}{textrm}{\texttt{trafo} method}{function} +\lineii{\texttt{\_\_init\_\_(matrix=((1,0),(0,1)), vector=(0,0)):}}{create new \texttt{trafo} instance with transformation \texttt{matrix} and \texttt{vector}.} +\lineii{\texttt{apply(x, y)}}{apply \texttt{trafo} to point vector $(\mathtt{x}, \mathtt{y})$.} +\lineii{\texttt{inverse()}}{returns inverse transformation of \texttt{trafo}.} +\lineii{\texttt{mirrored(angle)}}{returns \texttt{trafo} followed by mirroring at line through $(0,0)$ with direction \texttt{angle} in degrees.} +\lineii{\texttt{rotated(angle, x=None, y=None)}}{returns \texttt{trafo} followed by rotation by \texttt{angle} degrees around point $(\mathtt{x}, \mathtt{y})$, or $(0,0)$, if not given.} +\lineii{\texttt{scaled(sx, sy=None, x=None, y=None)}}{returns \texttt{trafo} followed by scaling with scaling factor \texttt{sx} in $x$-direction, \texttt{sy} in $y$-direction ($\mathtt{sy}=\mathtt{sx}$, if not given) with scaling center $(\mathtt{x}, \mathtt{y})$, or $(0,0)$, if not given.} +\lineii{\texttt{translated(x, y)}}{returns \texttt{trafo} followed by translation by vector $(\mathtt{x}, \mathtt{y})$.} +\lineii{\texttt{slanted(a, angle=0, x=None, y=None)}}{returns \texttt{trafo} followed by XXX} +\end{tableii} \medskip @@ -75,23 +58,13 @@ the \verb|trafo| class, each of which corresponds to one \verb|trafo| method. They are listed in the following table: \medskip -\begin{tabularx}{\linewidth}{>{\hsize=.7\hsize}X>{\raggedright\arraybackslash\hsize=1.3\hsize}X} - \texttt{trafo} subclass & function \\ - \hline - \texttt{mirror(angle)} & mirroring at line through $(0,0)$ - with direction \texttt{angle} in degrees.\\ - \texttt{rotate(angle, \newline\phantom{rotation(}x=None, y=None)} & - rotation by \texttt{angle} degrees around point $(\mathtt{x}, - \mathtt{y})$, or $(0,0)$, if not given.\\ - \texttt{scale(sx, sy=None,\newline\phantom{scaling(}x=None, y=None)} & - scaling with scaling factor \texttt{sx} in $x$-direction, - \texttt{sy} in $y$-direction ($\mathtt{sy}=\mathtt{sx}$, if not - given) with scaling - center $(\mathtt{x}, \mathtt{y})$, or $(0,0)$, if not given.\\ - \texttt{translate(x, y)} & - translation by vector $(\mathtt{x}, \mathtt{y})$.\\ - \texttt{slant(a, angle=0, x=None, y=None)} & XXX \\ -\end{tabularx} +\begin{tableii}{l|l}{textrm}{\texttt{trafo} subclass}{function} +\lineii{\texttt{mirror(angle)}}{mirroring at line through $(0,0)$ with direction \texttt{angle} in degrees.} +\lineii{\texttt{rotate(angle, x=None, y=None)}}{rotation by \texttt{angle} degrees around point $(\mathtt{x}, \mathtt{y})$, or $(0,0)$, if not given.} +\lineii{\texttt{scale(sx, sy=None, x=None, y=None)}}{scaling with scaling factor \texttt{sx} in $x$-direction, \texttt{sy} in $y$-direction ($\mathtt{sy}=\mathtt{sx}$, if not given) with scaling center $(\mathtt{x}, \mathtt{y})$, or $(0,0)$, if not given.} +\lineii{\texttt{translate(x, y)}}{translation by vector $(\mathtt{x}, \mathtt{y})$.} +\lineii{\texttt{slant(a, angle=0, x=None, y=None)}}{XXX} +\end{tableii} \medskip diff --git a/manual/unit.tex b/manual/unit.tex index b4836d32..57805d87 100644 --- a/manual/unit.tex +++ b/manual/unit.tex @@ -8,15 +8,14 @@ With the \verb|unit| module \PyX{} makes available classes and functions for the specification and manipulation of lengths. As usual, lengths consist of a number together with a measurement unit, e.g., -\unit[1]{cm}, \unit[50]{points}, \unit[0.42]{inch}. In addition, +1 cm, 50 points, 0.42 inch. In addition, lengths in \PyX{} are composed of the five types ``true'', ``user'', -``visual'', ``width'', and ``\TeX'', e.g., \unit[1]{user cm}, -\unit[50]{true points}, $(0.42\ \mathrm{visual} + 0.2\ -\mathrm{width})$ inch. As their names indicate, they serve different -purposes. True lengths are not scalable and are mainly used for return -values of \PyX{} functions. The other length types can be rescaled by -the user and differ with respect to the type of object they are -applied to: +``visual'', ``width'', and ``\TeX'', e.g., 1 user cm, +50 true points, 0.42 visual + 0.2 width inch. As their names +indicate, they serve different purposes. True lengths are not scalable +and are mainly used for return values of \PyX{} functions. The other +length types can be rescaled by the user and differ with respect to +the type of object they are applied to: \begin{description} \item[user length:] used for lengths of graphical objects like @@ -28,7 +27,7 @@ applied to: \end{description} When not specified otherwise, all types of lengths are interpreted -in terms of a default unit, which, by default, is \unit[1]{cm}. +in terms of a default unit, which, by default, is 1 cm. You may change this default unit by using the module level function \begin{funcdesc}{set}{uscale=None, vscale=None, wscale=None, xscale=None, defaultunit=None} @@ -81,28 +80,38 @@ only differ in there values for \verb|type| and \verb|unit|. They are summarized in the following table \medskip -\begin{center} -\begin{tabular}{lll|lll} -name & type & unit & name & type & unit\\ -\hline -\constant{m} & user & m & \constant{v\_m} & visual & m\\ -\constant{cm} & user & cm & \constant{v\_cm} & visual & cm\\ -\constant{mm} & user & mm & \constant{v\_mm} & visual & mm\\ -\constant{inch} & user & inch & \constant{v\_inch} & visual & inch\\ -\constant{pt} & user & points & \constant{v\_pt} & visual & points\\ -\constant{t\_m} & true & m & \constant{w\_m} & width & m\\ -\constant{t\_cm} & true & cm & \constant{w\_cm} & width & cm\\ -\constant{t\_mm} & true & mm & \constant{w\_mm} & width & mm\\ -\constant{t\_inch} & true & inch & \constant{w\_inch} & width & inch\\ -\constant{t\_pt} & true & points & \constant{w\_pt} & width & points\\ -\constant{u\_m} & user & m & \constant{x\_m} & \TeX & m \\ -\constant{u\_cm} & user & cm & \constant{x\_cm} & \TeX & cm \\ -\constant{u\_mm} & user & mm & \constant{x\_mm} & \TeX & mm \\ -\constant{u\_inch} & user & inch & \constant{x\_inch} & \TeX & inch \\ -\constant{u\_pt} & user & points & \constant{x\_pt} & \TeX & points\\ - -\end{tabular} -\end{center} +\begin{tableiii}{lll}{textrm}{name}{type}{unit} +\lineiii{\constant{m}}{user}{m} +\lineiii{\constant{cm}}{user}{cm} +\lineiii{\constant{mm}}{user}{mm} +\lineiii{\constant{inch}}{user}{inch} +\lineiii{\constant{pt}}{user}{points} +\lineiii{\constant{t\_m}}{true}{m} +\lineiii{\constant{t\_cm}}{true}{cm} +\lineiii{\constant{t\_mm}}{true}{mm} +\lineiii{\constant{t\_inch}}{true}{inch} +\lineiii{\constant{t\_pt}}{true}{points} +\lineiii{\constant{u\_m}}{user}{m} +\lineiii{\constant{u\_cm}}{user}{cm} +\lineiii{\constant{u\_mm}}{user}{mm} +\lineiii{\constant{u\_inch}}{user}{inch} +\lineiii{\constant{u\_pt}}{user}{points} +\lineiii{\constant{v\_m}}{visual}{m} +\lineiii{\constant{v\_cm}}{visual}{cm} +\lineiii{\constant{v\_mm}}{visual}{mm} +\lineiii{\constant{v\_inch}}{visual}{inch} +\lineiii{\constant{v\_pt}}{visual}{points} +\lineiii{\constant{w\_m}}{width}{m} +\lineiii{\constant{w\_cm}}{width}{cm} +\lineiii{\constant{w\_mm}}{width}{mm} +\lineiii{\constant{w\_inch}}{width}{inch} +\lineiii{\constant{w\_pt}}{width}{points} +\lineiii{\constant{x\_m}}{\TeX}{m } +\lineiii{\constant{x\_cm}}{\TeX}{cm } +\lineiii{\constant{x\_mm}}{\TeX}{mm } +\lineiii{\constant{x\_inch}}{\TeX}{inch } +\lineiii{\constant{x\_pt}}{\TeX}{points} +\end{tableiii} \medskip Thus, in order to specify, e.g., a length of 5 width points, just use @@ -112,17 +121,13 @@ Thus, in order to specify, e.g., a length of 5 width points, just use If you want to know the value of a \PyX{} length in certain units, you may use the predefined conversion functions which are given in the following table -\begin{center} -\begin{tabular}{ll} -function & result \\ -\hline -\texttt{tom(l)} & \texttt{l} in units of m\\ -\texttt{tocm(l)} & \texttt{l} in units of cm\\ -\texttt{tomm(l)} & \texttt{l} in units of mm\\ -\texttt{toinch(l)} & \texttt{l} in units of inch\\ -\texttt{topt(l)} & \texttt{l} in units of points\\ -\end{tabular} -\end{center} +\begin{tableii}{l|l}{textrm}{function}{result} +\lineii{\texttt{tom(l)}}{\texttt{l} in units of m} +\lineii{\texttt{tocm(l)}}{\texttt{l} in units of cm} +\lineii{\texttt{tomm(l)}}{\texttt{l} in units of mm} +\lineii{\texttt{toinch(l)}}{\texttt{l} in units of inch} +\lineii{\texttt{topt(l)}}{\texttt{l} in units of points} +\end{tableii} If \verb|l| is not yet a \verb|length| instance but a number, it first is interpreted as a user length in the default units. -- 2.11.4.GIT