diff options
Diffstat (limited to 'Build/source/utils/asymptote/doc')
21 files changed, 1793 insertions, 1096 deletions
diff --git a/Build/source/utils/asymptote/doc/CAD.pdf b/Build/source/utils/asymptote/doc/CAD.pdf Binary files differindex 59b899d3388..afaad32261c 100644 --- a/Build/source/utils/asymptote/doc/CAD.pdf +++ b/Build/source/utils/asymptote/doc/CAD.pdf diff --git a/Build/source/utils/asymptote/doc/FAQ/asy-faq.bfnn b/Build/source/utils/asymptote/doc/FAQ/asy-faq.bfnn index ce582954dda..26fcd14b628 100644 --- a/Build/source/utils/asymptote/doc/FAQ/asy-faq.bfnn +++ b/Build/source/utils/asymptote/doc/FAQ/asy-faq.bfnn @@ -13,12 +13,13 @@ \endcopy \copyto INFO +INFO-DIR-SECTION Languages START-INFO-DIR-ENTRY * asymptote FAQ: (asy-faq). Asymptote Frequently Asked Questions. END-INFO-DIR-ENTRY -File: $prefix.info, Node: Top, Next: Question 1.1, Up: (dir) +File: asy-faq.info, Node: Top, Next: Question 1.1, Up: (dir) ASYMPTOTE FREQUENTLY ASKED QUESTIONS `date '+%d %h %Y'` diff --git a/Build/source/utils/asymptote/doc/FAQ/asy-faq.info b/Build/source/utils/asymptote/doc/FAQ/asy-faq.info index 059fa578d1a..6fc4b7ce85c 100644 --- a/Build/source/utils/asymptote/doc/FAQ/asy-faq.info +++ b/Build/source/utils/asymptote/doc/FAQ/asy-faq.info @@ -1,15 +1,16 @@ Info file: asy-faq.info, -*-Text-*- produced by bfnnconv.pl from the Bizarre Format With No Name. +INFO-DIR-SECTION Languages START-INFO-DIR-ENTRY * asymptote FAQ: (asy-faq). Asymptote Frequently Asked Questions. END-INFO-DIR-ENTRY -File: $prefix.info, Node: Top, Next: Question 1.1, Up: (dir) +File: asy-faq.info, Node: Top, Next: Question 1.1, Up: (dir) ASYMPTOTE FREQUENTLY ASKED QUESTIONS - 11 Jul 2010 + 26 May 2011 This is the list of Frequently Asked Questions about Asymptote (asy). diff --git a/Build/source/utils/asymptote/doc/FAQ/install-sh b/Build/source/utils/asymptote/doc/FAQ/install-sh index a9244eb0786..6781b987bdb 100755 --- a/Build/source/utils/asymptote/doc/FAQ/install-sh +++ b/Build/source/utils/asymptote/doc/FAQ/install-sh @@ -1,7 +1,7 @@ #!/bin/sh # install - install a program, script, or datafile -scriptversion=2011-01-19.21; # UTC +scriptversion=2009-04-28.21; # UTC # This originates from X11R5 (mit/util/scripts/install.sh), which was # later released in X11R6 (xc/config/util/install.sh) with the @@ -156,10 +156,6 @@ while test $# -ne 0; do -s) stripcmd=$stripprog;; -t) dst_arg=$2 - # Protect names problematic for `test' and other utilities. - case $dst_arg in - -* | [=\(\)!]) dst_arg=./$dst_arg;; - esac shift;; -T) no_target_directory=true;; @@ -190,10 +186,6 @@ if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then fi shift # arg dst_arg=$arg - # Protect names problematic for `test' and other utilities. - case $dst_arg in - -* | [=\(\)!]) dst_arg=./$dst_arg;; - esac done fi @@ -208,11 +200,7 @@ if test $# -eq 0; then fi if test -z "$dir_arg"; then - do_exit='(exit $ret); exit $ret' - trap "ret=129; $do_exit" 1 - trap "ret=130; $do_exit" 2 - trap "ret=141; $do_exit" 13 - trap "ret=143; $do_exit" 15 + trap '(exit $?); exit' 1 2 13 15 # Set umask so as not to create temps with too-generous modes. # However, 'strip' requires both read and write access to temps. @@ -240,9 +228,9 @@ fi for src do - # Protect names problematic for `test' and other utilities. + # Protect names starting with `-'. case $src in - -* | [=\(\)!]) src=./$src;; + -*) src=./$src;; esac if test -n "$dir_arg"; then @@ -264,7 +252,12 @@ do echo "$0: no destination specified." >&2 exit 1 fi + dst=$dst_arg + # Protect names starting with `-'. + case $dst in + -*) dst=./$dst;; + esac # If destination is a directory, append the input filename; won't work # if double slashes aren't ignored. @@ -392,7 +385,7 @@ do case $dstdir in /*) prefix='/';; - [-=\(\)!]*) prefix='./';; + -*) prefix='./';; *) prefix='';; esac @@ -410,7 +403,7 @@ do for d do - test X"$d" = X && continue + test -z "$d" && continue prefix=$prefix$d if test -d "$prefix"; then diff --git a/Build/source/utils/asymptote/doc/Makefile.in b/Build/source/utils/asymptote/doc/Makefile.in index 11651df9e43..8cfc0d20ec8 100644 --- a/Build/source/utils/asymptote/doc/Makefile.in +++ b/Build/source/utils/asymptote/doc/Makefile.in @@ -1,8 +1,8 @@ MANFILES = asy.1 xasy.1x -ASYFILES = $(wildcard *.asy) latexusage.asy +ASYFILES = $(filter-out $(wildcard latexusage-*.asy),$(wildcard *.asy)) SOURCE = asymptote.texi version.texi options ASY = ../asy -dir ../base -config "" -render=0 -DOCFILES = asymptote.pdf CAD.pdf +DOCFILES = asymptote.pdf asy-latex.pdf CAD.pdf TeXShopAndAsymptote.pdf docdir = $(DESTDIR)@docdir@ infodir = $(DESTDIR)@infodir@ @@ -14,6 +14,12 @@ export docdir infodir INSTALL all: doc +asy-latex.pdf: + pdflatex asy-latex.dtx + +asymptote.sty: + pdflatex asy-latex.dtx + dvi: doc asymptote.dvi doc: $(DOCFILES) asy.1 faq latexusage.eps @@ -31,9 +37,9 @@ faq: %.pdf: %.asy $(ASY) -f pdf -noprc $< -latexusage.dvi: latexusage.tex +latexusage.dvi: latexusage.tex asymptote.sty rm -f latexusage-* - rm -f latexusage_.pre + rm -f latexusage.pre rm -f latexusage.aux latex latexusage $(ASY) -noprc latexusage-*.asy @@ -49,14 +55,14 @@ options: ../settings.cc $(ASY) -h 2>&1 | grep -iv Asymptote > options asy.1: options asy.1.begin asy.1.end - cat options | grep \^- | sed -e "s/-\(.*\) \([a-zA-Z].*\)/.TP\n.B -\1\n\2\./" | sed -e "/^.B/ s/-/\\\\-/g" | cat asy.1.begin - asy.1.end > asy.1 + cat options | grep \^- | sed -e "s/-\(.*\) \([a-zA-Z0-9].*\)/.TP\n.B -\1\n\2\./" | sed -e "/^.B/ s/-/\\\\-/g" | cat asy.1.begin - asy.1.end > asy.1 -asymptote.dvi: $(SOURCE) $(ASYFILES:.asy=.eps) +asymptote.dvi: $(SOURCE) $(ASYFILES:.asy=.eps) latexusage.pdf ln -sf asymptote.texi asymptote_.texi $(TEXI2DVI) asymptote_.texi mv asymptote_.dvi asymptote.dvi -asymptote.pdf: $(SOURCE) $(ASYFILES:.asy=.pdf) +asymptote.pdf: $(SOURCE) $(ASYFILES:.asy=.pdf) latexusage.pdf $(TEXI2DVI) --pdf asymptote.texi CAD.pdf: CAD.tex CAD1.eps @@ -65,12 +71,19 @@ CAD.pdf: CAD.tex CAD1.eps latex CAD dvipdf CAD +TeXShopAndAsymptote.pdf: TeXShopAndAsymptote.tex + latex TeXShopAndAsymptote + latex TeXShopAndAsymptote + dvipdf TeXShopAndAsymptote + clean: FORCE + -rm -f asy-latex.{aux,idx,ins,log,toc} -rm -f $(ASYFILES:.asy=.pdf) - -rm -f *.eps latexusage.{dvi,eps,log,aux,*.eps} latexusage-* latexusage_.pre + -rm -f *.eps latexusage.{dvi,eps,pdf,log,aux,*.eps} latexusage-* latexusage.pre -rm -f {asymptote,asymptote_}.{aux,cp,cps,dvi,fn,info,ky,log,pg,toc,tp,vr} -rm -f asymptote_.texi -rm -f CAD.{aux,dvi,log,toc} + -rm -f options asy.1 cd png && $(MAKE) clean install-man: @@ -102,6 +115,9 @@ uninstall-all: distclean: FORCE clean -rm -f version.texi Makefile -rm -f $(DOCFILES) - cd png && make distclean - cd FAQ && make distclean + cd png && $(MAKE) distclean + cd FAQ && $(MAKE) distclean FORCE: + +Makefile: Makefile.in + cd ..; config.status diff --git a/Build/source/utils/asymptote/doc/TeXShopAndAsymptote.tex b/Build/source/utils/asymptote/doc/TeXShopAndAsymptote.tex new file mode 100644 index 00000000000..13cb4f55420 --- /dev/null +++ b/Build/source/utils/asymptote/doc/TeXShopAndAsymptote.tex @@ -0,0 +1,96 @@ +\documentclass[11pt]{article} +\usepackage{geometry} +\geometry{letterpaper} + +\usepackage[parfill]{parskip} +\usepackage{graphicx} +\usepackage{amssymb} +\usepackage{epstopdf} + +\title{Integrating Asymptote and TeXShop for Mac OS X} +\author{Vishaal Rajani \& Cole Zmurchok \\ University of Alberta} +\date{\today} + + +\begin{document} +\maketitle +\begin{enumerate} +\item Download Asymptote and place the \emph{asymptote-x.xx.src.tgz} file +on the desktop. +\item Open Terminal and type the following. Note that you will +have to enter the root password for the final command. +\begin{verbatim} +cd Desktop +gunzip asymptote-x.xx.src.tgz +tar -xf asymptote-x.xx.src.tar +cd asymptote-x.xx +./configure +make all +sudo make install +\end{verbatim} +If you get an error at the \verb+./configure+ step, stating that you there +is \verb+no acceptable C+ \verb+compiler found in $PATH+, a solution +is to download and install Xcode here: \\ +\verb+http://developer.apple.com/TOOLS/Xcode/+. + +\item We now create the engine that will typeset Asymptote in TeXShop. The +easiest way to create this engine, which we will +call \emph{asyEngine.engine}, is to navigate +to \verb+~/Library/TeXShop/Engines+ and duplicate one of the +existing \emph{.engine} files. Open the duplicate file and delete the code +there. Type the following: +\newpage +\begin{verbatim} +#!/bin/sh +location=$(dirname "$1") +basename="${1%.tex}" +#process +cd $location +pdflatex "$1" +asy "${basename}"-*.asy +pdflatex "$1" +\end{verbatim} +Save this file as \emph{asyEngine.engine}. + +\item Now we set our engine to be executable. In the terminal, navigate to +the Engines directory and type: + +\begin{verbatim} +chmod +x asyEngine.engine +\end{verbatim} + +\item Finally, in the terminal, type: + +\begin{verbatim} +defaults write TeXShop OtherTeXExtensions -array-add "asy" +\end{verbatim} + +This last command allows you choose the \emph{asyEngine} option from the +drop-down menu when you wish to typeset a document that includes asymptote. +\end{enumerate} + +Now, if you wish to typeset something simple, like the following red line, +create a new document in TeXShop and type: + +\begin{verbatim} +\documentclass[letterpaper,12pt]{article} +\usepackage{amsmath} +\usepackage{amssymb} +\usepackage{asymptote} + +\begin{document} +\begin{asy} + size(300); + draw((0,0)--(1,1),red); +\end{asy} +\end{document} +\end{verbatim} + +Choose the \emph{asyEngine} option from the drop-down menu and +press \emph{Typeset}. Your red line will be created in a PDF Document. + +On a final note, it is best to avoid using filenames with spaces in them. +For example, avoid filenames such as \verb+asy test.tex+ and instead use +filenames without spaces, such as \verb+asyTest.tex+. + +\end{document} diff --git a/Build/source/utils/asymptote/doc/asy-latex.dtx b/Build/source/utils/asymptote/doc/asy-latex.dtx new file mode 100644 index 00000000000..3cb386cd6b4 --- /dev/null +++ b/Build/source/utils/asymptote/doc/asy-latex.dtx @@ -0,0 +1,710 @@ +% \iffalse +% +%<*internal> +\begingroup +%</internal> +%<*batchfile> +\input docstrip.tex +\keepsilent +\preamble +____________________________ +The ASYMPTOTE package + +(C) 2003 Tom Prince +(C) 2003-2010 John Bowman +(C) 2010 Will Robertson + +Adapted from comment.sty + +Licence: GPL2+ + +\endpreamble +\nopostamble +\askforoverwritefalse +\generate{\file{asymptote.sty}{\from{\jobname.dtx}{pkg}}} +%</batchfile> +%<batchfile>\endbatchfile +%<*internal> +\generate{\file{\jobname.ins}{\from{\jobname.dtx}{batchfile}}} +\edef\tmpa{plain} +\ifx\tmpa\fmtname\endgroup\expandafter\bye\fi +\endgroup +\immediate\write18{makeindex -s gind.ist -o \jobname.ind \jobname.idx} +\immediate\write18{makeindex -s gglo.ist -o \jobname.gls \jobname.glo} +%</internal> +% +%<*driver> +\ProvidesFile{asy-latex.dtx} +%</driver> +%<pkg>\ProvidesPackage{asymptote} +%<*pkg> + [2011/05/15 v1.24 Asymptote style file for LaTeX] +%</pkg> +% +%<*driver> +\documentclass{ltxdoc} +\EnableCrossrefs +\CodelineIndex +\begin{document} + \DocInput{\jobname.dtx} +\end{document} +%</driver> +% \fi +% +% \GetFileInfo{asy-latex.dtx} +% \title{The \textsf{asymptote} package} +% \author{% +% John Bowman, Tom Prince, and Will Robertson +% } +% \date{\filedate\qquad\fileversion} +% \maketitle +% \begin{abstract} +% This package provides integration of inline and external Asymptote +% graphics within a \LaTeX\ document. +% \end{abstract} +% +% \tableofcontents +% +% \section{Introduction} +% +% This is the documentation for the \LaTeX\ package \texttt{asymptote} +% which accompanies the Asymptote drawing package. For further details on +% Asymptote, please see its documentation in \texttt{asymptote.pdf}. +% +% \section{User syntax} +% +% \subsection{Package loading and options} +% +% The package may take two options at load time: \texttt{inline} or +% \texttt{attach}. +% These options can also be set at any time with the +% \cmd\asysetup\marg{options} command, or specified individually in the +% optional argument to each \texttt{asy} environment or \texttt{asyinclude} +% command. +% +% The \texttt{inline} option uses Asymptote's `inline' mode whereby +% included graphics have their labels typeset in the environment of the +% document they are contained within. Otherwise the Asymptote graphics are +% self-contained and their formatting is independent of the document. +% +% The \texttt{attach} option allows generated graphics to be embedded +% within the PDF using the \texttt{attachfile2} package; please load that +% package separately if you wish to use it. The \texttt{attach} option +% takes precedence over the \texttt{inline} option. +% +% This package produces quite a number of output files, which by default +% are created in the same directory as the \LaTeX\ document that is being +% compiled. To keep things more tidy, you can specify an output directory +% for these files by defining the \cmd\asydir\ command. For example, if you +% wish to store the figure files in the subdirectory \texttt{asytmp/}, the +% you would write \verb|\renewcommand\asydir{asytmp}|. +% +% Alternatively (and tentatively), you may write \verb|dir=asytmp| in +% either the \texttt{asy} environment options or the options to +% \cmd\asysetup. +% +% \subsection{Commands for inserting Asymptote graphics} +% +% The main environment defined by the package is the \texttt{asy} +% environment, in which verbatim Asymptote code is placed that will be +% compiled for generating a graphic in the document. For example, +% \begin{verbatim} +% \begin{figure} +% \begin{asy}[ <options> ] +% <ASYMPTOTE CODE> +% \end{asy} +% \caption{...}\label{...} +% \end{verbatim} +% +% If you have Asymptote code in a separate file, you can include it with +% the \cmd\asyinclude\oarg{options}\marg{filename}\ command. +% +% For Asymptote code that should be included in \emph{every} graphic, +% define it using the \texttt{asydef} environment. +% +% \subsection{Graphics options} +% +% Both the \texttt{asy} environment and the \cmd\asyinclude\ command take +% optional parameters for controlling aspects of the graphics creation. In +% addition to locally setting \texttt{inline} and \texttt{attach}, the +% following options may also be used: +% \begin{description} +% \item[height] Height of the figure +% \item[width] Width of the figure +% \item[keepAspect] Maintain aspect ratio [default true] +% \item[viewportheight] Viewport height for 3D figures +% \item[viewportwidth] Viewport width for 3D figures +% \end{description} +% These may also be set globally using the \cmd\asysetup\ command. +% +% \section{Processing the document} +% +% After running \LaTeX\ on the document, it is necessary to process the +% Asymptote graphics so they can be included in the next compilation. The +% simplest procedure is a recipe such as +% \begin{verbatim} +% pdflatex mydoc +% asy mydoc-*.asy +% pdflatex mydoc +% \end{verbatim} +% This technique will recompile each graphic every time, however. To only +% recompile graphics that have changed, use the \texttt{latexmk} +% tool. Asymptote is distributed with a \texttt{latexmkrc} configuration +% file; place this file in a place where \texttt{latexmk} will find it and +% your document may be compiled, including the \texttt{asy} compilations, +% with \texttt{latexmk mydoc} or \texttt{latexmk --pdf mydoc}. +% +% \section{Implementation} +% +% \iffalse +%<*pkg> +% \fi +% +% \begin{macrocode} +\def\Asymptote{{\tt Asymptote}} +% \end{macrocode} +% +% \begin{macrocode} +\InputIfFileExists{\jobname.pre}{}{} +% \end{macrocode} +% +% \subsection{Allocations} +% +% \paragraph{Allocations} +% +% \begin{macrocode} +\newbox\ASYbox +\newcounter{asy} +% \end{macrocode} +% +% \begin{macrocode} +\newwrite\AsyStream +\newwrite\AsyPreStream +% \end{macrocode} +% +% \begin{macrocode} +\newif\ifASYinline +\newif\ifASYattach +\newif\ifASYkeepAspect +\ASYkeepAspecttrue +% \end{macrocode} +% +% \subsection{Packages} +% +% \begin{macrocode} +\RequirePackage{keyval} +\RequirePackage{ifthen} +\RequirePackage{color,graphicx} +% \end{macrocode} +% +% \paragraph{Emulating packages} +% We cannot assume that Asymptote users have recent +% \TeX\ distributions. (E.g., Fedora until recently still shipped teTeX.) +% So load \textsf{ifpdf} and \textsf{ifxetex} if they exist; otherwise, +% emulate them. +% +% In due course, delete this code and just load the packages. +% \begin{macrocode} +\IfFileExists{ifpdf.sty}{ + \RequirePackage{ifpdf} +}{ + \expandafter\newif\csname ifpdf\endcsname + \ifx\pdfoutput\@undefined\else + \ifcase\pdfoutput\else + \pdftrue + \fi + \fi +} +% \end{macrocode} +% +% \begin{macrocode} +\IfFileExists{ifxetex.sty}{ + \RequirePackage{ifxetex} +}{ + \expandafter\newif\csname ifxetex\endcsname + \ifx\XeTeXversion\@undefined\else + \xetextrue + \fi +} +% \end{macrocode} +% +% \begin{macro}{\CatchFileDef} +% Used for \cmd\asyinclude. +% \begin{macrocode} +\IfFileExists{catchfile.sty}{ + \RequirePackage{catchfile} +}{ + \newcommand\CatchFileDef[3]{% + \begingroup + \everyeof{% + \ENDCATCHFILEMARKER + \noexpand + }% + \long\def\@tempa##1\ENDCATCHFILEMARKER{% + \endgroup + \def#1{##1}% + }% + #3% + \expandafter\@tempa\@@input #2\relax + } +} +% \end{macrocode} +% \end{macro} +% +% \paragraph{Ensuring attachfile2 is loaded if [attach] is requested} +% \begin{macrocode} +\newif\if@asy@attachfile@loaded +% \end{macrocode} +% +% \begin{macrocode} +\AtBeginDocument{% + \@ifpackageloaded{attachfile2}{\@asy@attachfile@loadedtrue}{}% + \let\asy@check@attachfile\asy@check@attachfile@loaded +} +% \end{macrocode} +% +% \begin{macrocode} +\newcommand\asy@check@attachfile@loaded{% + \if@asy@attachfile@loaded\else + \PackageError{asymptote}{You must load the attachfile2 package}{^^J% + You have requested the [attach] option for some or all of your^^J% + Asymptote graphics, which requires the attachfile2 package.^^J% + Please load it in the document preamble.^^J% + }% + \fi +} +% \end{macrocode} +% +% \begin{macrocode} +\newcommand\asy@check@attachfile{% + \AtBeginDocument{\asy@check@attachfile@loaded}% + \let\asy@check@attachfile\@empty +} +% \end{macrocode} +% +% \paragraph{Macros} +% \begin{macrocode} +\def\csarg#1#2{\expandafter#1\csname#2\endcsname} +% \end{macrocode} +% +% \subsection{Package options} +% +% \begin{macrocode} +\DeclareOption{inline}{% + \ASYinlinetrue +} +\DeclareOption{attach}{% + \asy@check@attachfile + \ASYattachtrue +} +\ProcessOptions* +% \end{macrocode} +% +% \begin{macrocode} +\def\asydir{} +\def\ASYprefix{} +% \end{macrocode} +% +% +% \subsection{Testing for PDF output} +% Note this is not quite the same as \cs{ifpdf}, since we still want PDF +% output when using XeTeX. +% \begin{macrocode} +\newif\ifASYPDF +\ifxetex + \ASYPDFtrue +\else + \ifpdf + \ASYPDFtrue + \fi +\fi +\ifASYPDF + \def\AsyExtension{pdf} +\else + \def\AsyExtension{eps} +\fi +% \end{macrocode} +% +% \subsection{Bug squashing} +% +% \begin{macrocode} +\def\unquoteJobname#1"#2"#3\relax{% + \def\rawJobname{#1}% + \ifx\rawJobname\empty + \def\rawJobname{#2}% + \fi +} +\expandafter\unquoteJobname\jobname""\relax +% \end{macrocode} +% Work around jobname bug in MiKTeX 2.5 and 2.6: +% Turn stars in file names (resulting from spaces, etc.) into minus signs +% \begin{macrocode} +\def\fixstar#1*#2\relax{% + \def\argtwo{#2}% + \ifx\argtwo\empty + \gdef\Jobname{#1}% + \else + \fixstar#1-#2\relax + \fi +} +\expandafter\fixstar\rawJobname*\relax +% \end{macrocode} +% +% Work around bug in dvips.def: allow spaces in file names. +% \begin{macrocode} +\def\Ginclude@eps#1{% + \message{<#1>}% + \bgroup + \def\@tempa{!}% + \dimen@\Gin@req@width + \dimen@ii.1bp\relax + \divide\dimen@\dimen@ii + \@tempdima\Gin@req@height + \divide\@tempdima\dimen@ii + \special{PSfile=#1\space + llx=\Gin@llx\space + lly=\Gin@lly\space + urx=\Gin@urx\space + ury=\Gin@ury\space + \ifx\Gin@scalex\@tempa\else rwi=\number\dimen@\space\fi + \ifx\Gin@scaley\@tempa\else rhi=\number\@tempdima\space\fi + \ifGin@clip clip\fi}% + \egroup +} +% \end{macrocode} +% +% \subsection{Input/Output} +% +% \begin{macrocode} +\immediate\openout\AsyPreStream=\jobname.pre\relax +\AtEndDocument{\immediate\closeout\AsyPreStream} +% \end{macrocode} +% +% \begin{macrocode} +\def\WriteAsyLine#1{% + \immediate\write\AsyStream{\detokenize{#1}}% +} +% \end{macrocode} +% +% \begin{macrocode} +\def\globalASYdefs{} +\def\WriteGlobalAsyLine#1{% + \expandafter\g@addto@macro + \expandafter\globalASYdefs + \expandafter{\detokenize{#1^^J}}% +} +% \end{macrocode} +% +% \subsection{Commands for verbatim processing environments} +% +% \begin{macrocode} +\def\ProcessAsymptote#1{% + \begingroup + \def\CurrentAsymptote{#1}% + \let\do\@makeother \dospecials + \@makeother\^^L% and whatever other special cases + \catcode`\ =10 + \endlinechar`\^^M \catcode`\^^M=12 \xAsymptote +} +% \end{macrocode} +% Need lots of comment chars here because \meta{line end} is no longer a +% space character. +% \begin{macrocode} +\begingroup + \catcode`\^^M=12 \endlinechar=-1\relax% + \gdef\xAsymptote{% + \expandafter\ProcessAsymptoteLine% + } + \gdef\ProcessAsymptoteLine#1^^M{% + \def\@tempa{#1}% + {% + \escapechar=-1\relax% + \xdef\@tempb{\string\\end\string\{\CurrentAsymptote\string\}}% + }% + \ifx\@tempa\@tempb% + \edef\next{\endgroup\noexpand\end{\CurrentAsymptote}}% + \else% + \ThisAsymptote{#1}% + \let\next\ProcessAsymptoteLine% + \fi% + \next% + } +\endgroup +% \end{macrocode} +% +% \subsection{User interface} +% +% \begin{macrocode} +\newcommand\asy[1][]{% + \stepcounter{asy}% + \setkeys{ASYkeys}{#1}% +% \end{macrocode} +% Disable the "inline" option if "attach" is enabled: +% \begin{macrocode} + \ifASYattach + \ASYinlinefalse + \fi +% \end{macrocode} +% +% \begin{macrocode} + \ifx\asydir\empty\else + \def\ASYprefix{\asydir/}% + \fi + \immediate\write\AsyPreStream{% + \noexpand\InputIfFileExists{% + \ASYprefix\noexpand\jobname-\the\c@asy.pre}{}{}% + } + \asy@write@graphic@header + \let\ThisAsymptote\WriteAsyLine + \ProcessAsymptote{asy}% +} +% \end{macrocode} +% +% \begin{macrocode} +\def\endasy{% + \asy@finalise@stream + \asy@input@graphic +} +% \end{macrocode} +% +% \begin{macrocode} +\def\asy@write@graphic@header{% + \immediate\openout\AsyStream=\ASYprefix\jobname-\the\c@asy.asy\relax + \gdef\AsyFile{\ASYprefix\Jobname-\the\c@asy}% + \immediate\write\AsyStream{% + if(!settings.multipleView) settings.batchView=false;^^J% + \ifxetex + settings.tex="xelatex";^^J% + \else\ifASYPDF + settings.tex="pdflatex";^^J% + \fi\fi + \ifASYinline + settings.inlinetex=true;^^J% + deletepreamble();^^J% + \fi + defaultfilename="\Jobname-\the\c@asy";^^J% + if(settings.render < 0) settings.render=4;^^J% + settings.outformat="";^^J% + \ifASYattach + settings.inlineimage=false;^^J% + settings.embed=false;^^J% + settings.toolbar=true;^^J% + \else + settings.inlineimage=true;^^J% + settings.embed=true;^^J% + settings.toolbar=false;^^J% + viewportmargin=(2,2);^^J% + \fi + \globalASYdefs + }% +} +\def\asy@expand@keepAspect{% + \ifASYkeepAspect keepAspect=true% + \else keepAspect=false% + \fi% +} +% \end{macrocode} +% +% \begin{macrocode} +\def\asy@finalise@stream{% +% \end{macrocode} +% Setting \verb|size()|. Only inserted if one of the dimensions is +% set explicitly (i.e., if both height and width are not empty). +% \begin{macrocode} + \ifx\ASYwidth\@empty + \ifx\ASYheight\@empty + % write nothing! + \else + \immediate\write\AsyStream{size(0,\ASYheight,\asy@expand@keepAspect);}% + \fi + \else + \ifx\ASYheight\@empty + \immediate\write\AsyStream{size(\ASYwidth,0,\asy@expand@keepAspect);}% + \else + \immediate\write\AsyStream{size(\ASYwidth,\ASYheight,\asy@expand@keepAspect);}% + \fi + \fi +% \end{macrocode} +% Setting \verb|viewportsize=()|. Same logic as for \verb|size()|. +% Note that \cs{ASYviewportwidth} varies according to \cs{ASYattach}, +% by default, so it needs to be fully expanded before checking if it equals +% zero. +% \begin{macrocode} + \edef\ASYviewportwidth{\ASYviewportwidth}% locally "freeze" viewportwidth + \ifx\ASYviewportwidth\@empty + \ifx\ASYviewportheight\@empty + % write nothing! + \else + \immediate\write\AsyStream{viewportsize=(0,\ASYviewportheight);}% + \fi + \else + \ifx\ASYviewportheight\@empty + \immediate\write\AsyStream{viewportsize=(\ASYviewportwidth,0);}% + \else + \immediate\write\AsyStream{% + viewportsize=(\ASYviewportwidth,\ASYviewportheight);}% + \fi + \fi + \immediate\closeout\AsyStream +} +% \end{macrocode} +% +% \begin{macrocode} +\def\asy@input@graphic{% + \ifASYinline + \IfFileExists{"\AsyFile.tex"}{% + \catcode`:=12\relax + \@@input"\AsyFile.tex"\relax + }{% + \PackageWarning{asymptote}{file `\AsyFile.tex' not found}% + }% + \else + \IfFileExists{"\AsyFile.\AsyExtension"}{% + \ifASYattach + \ifASYPDF + \IfFileExists{"\AsyFile+0.pdf"}{% + \setbox\ASYbox=\hbox{\includegraphics[hiresbb]{"\AsyFile+0".pdf}}% + }{% + \setbox\ASYbox=\hbox{\includegraphics[hiresbb]{"\AsyFile".pdf}}% + }% + \else + \setbox\ASYbox=\hbox{\includegraphics[hiresbb]{"\AsyFile.eps"}}% + \fi + \textattachfile{\AsyFile.\AsyExtension}{\phantom{\copy\ASYbox}}% + \vskip-\ht\ASYbox + \indent + \box\ASYbox + \else + \ifASYPDF + \includegraphics[hiresbb]{"\AsyFile".pdf}% + \else + \includegraphics[hiresbb]{"\AsyFile.eps"}% + \fi + \fi + }{% +% \end{macrocode} +% 3D PRC figures require inline mode. +% \begin{macrocode} + \IfFileExists{"\AsyFile.tex"}{% + \catcode`:=12 + \@@input"\AsyFile.tex"\relax + }{% + \PackageWarning{asymptote}{% + file `\AsyFile.\AsyExtension' not found% + }% + }% + }% + \fi +} +% \end{macrocode} +% +% \begin{macrocode} +\def\asydef{% + \let\ThisAsymptote\WriteGlobalAsyLine + \ProcessAsymptote{asydef}% +} +% \end{macrocode} +% +% \begin{macrocode} +\newcommand\asyinclude[2][]{% + \begingroup + \stepcounter{asy}% + \setkeys{ASYkeys}{#1}% + \ifASYattach + \ASYinlinefalse + \fi + \ifx\asydir\empty\else + \def\ASYprefix{\asydir/}% + \fi + \immediate\write\AsyPreStream{% + \noexpand\InputIfFileExists{% + \ASYprefix\noexpand\jobname-\the\c@asy.pre}{}{}% + } + \asy@write@graphic@header + \IfFileExists{#2.asy}{% + \CatchFileDef\@tempa{#2.asy}{% + \let\do\@makeother + \dospecials + \endlinechar=10\relax + } + }{ + \IfFileExists{#2}{% + \CatchFileDef\@tempa{#2}{% + \let\do\@makeother + \dospecials + \endlinechar=10\relax + } + }{ + \PackageWarning{asymptote}{file #2 not found}% + } + } + \immediate\write\AsyStream{\unexpanded\expandafter{\@tempa}}% + \asy@finalise@stream + \asy@input@graphic + \endgroup +} +% \end{macrocode} +% +% \begin{macrocode} +\newcommand{\ASYanimategraphics}[5][]{% + \IfFileExists{_#3.pdf}{% + \animategraphics[{#1}]{#2}{_#3}{#4}{#5}% + }{} +} +% \end{macrocode} +% +% \subsection{Keys for graphics processing} +% +% \begin{macrocode} +\newcommand\asysetup[1]{\setkeys{ASYkeys}{#1}} +% \end{macrocode} +% +% \begin{macrocode} +\define@key{ASYkeys}{dir}{% + \def\asydir{#1}% +} +\def\ASYwidth{} +\define@key{ASYkeys}{width}{% + \edef\ASYwidth{\the\dimexpr#1\relax}% +} +\def\ASYheight{} +\define@key{ASYkeys}{height}{% + \edef\ASYheight{\the\dimexpr#1\relax}% +} +\define@key{ASYkeys}{keepAspect}[true]{% + \ifthenelse{\equal{#1}{true}} + {\ASYkeepAspecttrue} + {\ASYkeepAspectfalse}% +} +\def\ASYviewportwidth{\ASYdefaultviewportwidth} +\def\ASYdefaultviewportwidth{% + \ifASYattach \@empty \else \the\linewidth \fi +} +\define@key{ASYkeys}{viewportwidth}{% + \edef\ASYviewportwidth{\the\dimexpr#1\relax}% +} +\def\ASYviewportheight{} +\define@key{ASYkeys}{viewportheight}{% + \edef\ASYviewportheight{\the\dimexpr#1\relax}% +} +% \end{macrocode} +% +% \begin{macrocode} +\define@key{ASYkeys}{inline}[true]{% + \ifthenelse{\equal{#1}{true}} + {\ASYinlinetrue} + {\ASYinlinefalse}% +} +\define@key{ASYkeys}{attach}[true]{% + \ifthenelse{\equal{#1}{true}} + {\ASYattachtrue} + {\ASYattachfalse}% +} +% \end{macrocode} +% +% \iffalse +%</pkg> +% \fi +% +% \Finale +% diff --git a/Build/source/utils/asymptote/doc/asy.1 b/Build/source/utils/asymptote/doc/asy.1 deleted file mode 100644 index d9e680befc7..00000000000 --- a/Build/source/utils/asymptote/doc/asy.1 +++ /dev/null @@ -1,287 +0,0 @@ -.\" Hey, EMACS: -*- nroff -*- -.TH ASY 1 "1 Dec 2004" -.SH NAME -asy \- Asymptote: a script-based vector graphics language -.SH SYNOPSIS -.B asy -.RI [ options ] -.RI [ file \ ...] -.SH DESCRIPTION -\fBAsymptote\fP is a powerful descriptive vector graphics language for -technical drawings, inspired by MetaPost but with an improved C++-like syntax. -Asymptote provides for figures the same high-quality level of typesetting that -LaTeX does for scientific text. -.SH OPTIONS -If no arguments are given, Asymptote runs in interactive mode. -.PP -If "\-" is given as the file argument, Asymptote reads from standard input. -.PP -A summary of options is included below. The effect of most options -can be negated by prepending -.B no -to the option name. -Default values for most options may also be entered in the -file -.B .asy/config.asy -in the user's home directory using the long form: -.PP - import settings; - batchView=true; -.PP -For a complete -description, see the Info files. -.TP -.B \-V,\-View -View output; command-line only. -.TP -.B \-a,\-align C|B|T|Z -Center, Bottom, Top, or Zero page alignment [C]. -.TP -.B \-antialias n -Antialiasing width for rasterized output [2]. --arcballradius pixels Arcball radius [750] -.TP -.B \-auto3D -Automatically activate 3D scene [true]. --autobillboard 3D labels always face viewer by default [true] -.TP -.B \-autoimport string -Module to automatically import. -.TP -.B \-autoplain -Enable automatic importing of plain [true]. -.TP -.B \-autoplay -Autoplay 3D animations [false]. -.TP -.B \-autorotate -Enable automatic PDF page rotation [false]. -.TP -.B \-batchMask -Mask fpu exceptions in batch mode [false]. -.TP -.B \-batchView -View output in batch mode [false]. -.TP -.B \-bw -Convert all colors to black and white [false]. -.TP -.B \-cd directory -Set current directory; command-line only. -.TP -.B \-cmyk -Convert rgb colors to cmyk [false]. -.TP -.B \-c,\-command string -Command to autoexecute. -.TP -.B \-compact -Conserve memory at the expense of speed [false]. -.TP -.B \-d,\-debug -Enable debugging messages [false]. -.TP -.B \-divisor n -Garbage collect using purge(divisor=n) [2]. -.TP -.B \-doubleclick ms -Emulated double-click timeout [200]. -.TP -.B \-embed -Embed rendered preview image [true]. -.TP -.B \-exitonEOF -Exit interactive mode on EOF [true]. -.TP -.B \-fitscreen -Fit rendered image to screen [true]. -.TP -.B \-framedelay ms -Additional frame delay [0]. -.TP -.B \-framerate frames/s -Animation speed [30]. -.TP -.B \-globalwrite -Allow write to other directory [false]. -.TP -.B \-gray -Convert all colors to grayscale [false]. -.TP -.B \-h,\-help -Show summary of options; command-line only. -.TP -.B \-historylines n -Retain n lines of history [1000]. -.TP -.B \-iconify -Iconify rendering window [false]. -.TP -.B \-inlineimage -Generate inline embedded image [false]. -.TP -.B \-inlinetex -Generate inline TeX code [false]. -.TP -.B \-interactiveMask -Mask fpu exceptions in interactive mode [true]. -.TP -.B \-interactiveView -View output in interactive mode [true]. -.TP -.B \-interactiveWrite -Write expressions entered at the prompt to stdout [true]. -.TP -.B \-k,\-keep -Keep intermediate files [false]. -.TP -.B \-keepaux -Keep intermediate LaTeX .aux files [false]. -.TP -.B \-level n -Postscript level [3]. -.TP -.B \-l,\-listvariables -List available global functions and variables [false]. -.TP -.B \-localhistory -Use a local interactive history file [false]. -.TP -.B \-loop -Loop 3D animations [false]. -.TP -.B \-m,\-mask -Mask fpu exceptions; command-line only. -.TP -.B \-maxtile pair -Maximum rendering tile size [(0,0)]. -.TP -.B \-maxviewport pair -Maximum viewport size [(2048,2048)]. -.TP -.B \-multiline -Input code over multiple lines at the prompt [false]. -.TP -.B \-multipleView -View output from multiple batch-mode files [false]. -.TP -.B \-multisample n -Multisampling width for screen images [4]. -.TP -.B \-O,\-offset pair -PostScript offset [(0,0)]. -.TP -.B \-f,\-outformat format -Convert each output file to specified format. -.TP -.B \-o,\-outname name -Alternative output directory/filename. -.TP -.B \-p,\-parseonly -Parse file [false]. -.TP -.B \-pdfreload -Automatically reload document in pdfviewer [false]. -.TP -.B \-pdfreloaddelay usec -Delay before attempting initial pdf reload [750000]. -.TP -.B \-position pair -Initial 3D rendering screen position [(0,0)]. -.TP -.B \-prc -Embed 3D PRC graphics in PDF output [true]. -.TP -.B \-prompt string -Prompt [> ]. -.TP -.B \-prompt2 string -Continuation prompt for multiline input [..]. -.TP -.B \-q,\-quiet -Suppress welcome message [false]. -.TP -.B \-render n -Render 3D graphics using n pixels per bp (-1=auto) [-1]. -.TP -.B \-resizestep step -Resize step [1.2]. -.TP -.B \-reverse -reverse 3D animations [false]. -.TP -.B \-rgb -Convert cmyk colors to rgb [false]. -.TP -.B \-safe -Disable system call [true]. -.TP -.B \-scroll n -Scroll standard output n lines at a time [0]. -.TP -.B \-spinstep deg/s -Spin speed [60]. -.TP -.B \-svgemulation -Emulate unimplemented SVG shading [false]. -.TP -.B \-tabcompletion -Interactive prompt auto-completion [true]. -.TP -.B \-tex engine -latex|pdflatex|xelatex|tex|pdftex|context|none [latex]. -.TP -.B \-thick -Render thick 3D lines [true]. -.TP -.B \-thin -Render thin 3D lines [true]. -.TP -.B \-threads -Use POSIX threads for 3D rendering [true]. -.TP -.B \-toolbar -Show 3D toolbar in PDF output [true]. -.TP -.B \-s,\-translate -Show translated virtual machine code [false]. -.TP -.B \-twice -Run LaTeX twice (to resolve references) [false]. -.TP -.B \-twosided -Use two-sided 3D lighting model for rendering [true]. -.TP -.B \-u,\-user string -General purpose user string. -.TP -.B \-v,\-verbose -Increase verbosity level (can specify multiple times) [0]. -.TP -.B \-version -Show version; command-line only. -.TP -.B \-wait -Wait for child processes to finish before exiting [false]. -.TP -.B \-warn string -Enable warning; command-line only. -.TP -.B \-where -Show where listed variables are declared [false]. -.TP -.B \-zoomfactor factor -Zoom step factor [1.05]. -.TP -.B \-zoomstep step -Mouse motion zoom step [0.1]. - -.SH SEE ALSO -Asymptote is documented fully in the asymptote Info page. -The manual can also be accessed in interactive mode with the "help" command. - -.SH AUTHOR -Asymptote was written by Andy Hammerlindl, John Bowman, and Tom Prince. -.PP -This manual page was written by Hubert Chan for the Debian project (but may -be used by others). diff --git a/Build/source/utils/asymptote/doc/asymptote.pdf b/Build/source/utils/asymptote/doc/asymptote.pdf Binary files differindex d480d1c6d84..5ae18cf90b3 100644 --- a/Build/source/utils/asymptote/doc/asymptote.pdf +++ b/Build/source/utils/asymptote/doc/asymptote.pdf diff --git a/Build/source/utils/asymptote/doc/asymptote.sty b/Build/source/utils/asymptote/doc/asymptote.sty index 4db253d4095..6518baba61f 100644 --- a/Build/source/utils/asymptote/doc/asymptote.sty +++ b/Build/source/utils/asymptote/doc/asymptote.sty @@ -1,304 +1,398 @@ -%%% Asymptote style file for LaTeX -%%% Contributed by Tom Prince 14 May 2003 -%%% Modified by John Bowman -%%% Adapted from comment.sty (Under GPL v2+) - -\ProvidesPackage{asymptote}[2010/07/10 v1.15 Asymptote style file for LaTeX] +%% +%% This is file `asymptote.sty', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% asy-latex.dtx (with options: `pkg') +%% ____________________________ +%% The ASYMPTOTE package +%% +%% (C) 2003 Tom Prince +%% (C) 2003-2010 John Bowman +%% (C) 2010 Will Robertson +%% +%% Adapted from comment.sty +%% +%% Licence: GPL2+ +%% +\ProvidesPackage{asymptote} + [2011/05/15 v1.24 Asymptote style file for LaTeX] +\def\Asymptote{{\tt Asymptote}} +\InputIfFileExists{\jobname.pre}{}{} +\newbox\ASYbox +\newcounter{asy} +\newwrite\AsyStream +\newwrite\AsyPreStream +\newif\ifASYinline +\newif\ifASYattach +\newif\ifASYkeepAspect +\ASYkeepAspecttrue \RequirePackage{keyval} \RequirePackage{ifthen} -\newif\ifASYdefaultinline -\newif\ifASYdefaultattach -\DeclareOption{inline}{\ASYdefaultinlinetrue} -\DeclareOption{attach}{\ASYdefaultattachtrue} -\ProcessOptions* - -\def\unquoteJobname#1"#2"#3\relax{\def\rawJobname{#1}% - \ifx\rawJobname\empty\def\rawJobname{#2}\fi} -\expandafter\unquoteJobname\jobname""\relax -% Work around jobname bug in MiKTeX 2.5 and 2.6: -% Turn stars in file names (resulting from spaces, etc.) into minus signs -\def\fixstar#1*#2\relax{\def\argtwo{#2}\ifx\argtwo\empty\gdef\Jobname{#1}\else -\fixstar#1-#2\relax\fi} -\expandafter\fixstar\rawJobname*\relax - \RequirePackage{color,graphicx} - -\def\makeinnocent#1{\catcode`#1=12 } +\IfFileExists{ifpdf.sty}{ + \RequirePackage{ifpdf} +}{ + \expandafter\newif\csname ifpdf\endcsname + \ifx\pdfoutput\@undefined\else + \ifcase\pdfoutput\else + \pdftrue + \fi + \fi +} +\IfFileExists{ifxetex.sty}{ + \RequirePackage{ifxetex} +}{ + \expandafter\newif\csname ifxetex\endcsname + \ifx\XeTeXversion\@undefined\else + \xetextrue + \fi +} +\IfFileExists{catchfile.sty}{ + \RequirePackage{catchfile} +}{ + \newcommand\CatchFileDef[3]{% + \begingroup + \everyeof{% + \ENDCATCHFILEMARKER + \noexpand + }% + \long\def\@tempa##1\ENDCATCHFILEMARKER{% + \endgroup + \def#1{##1}% + }% + #3% + \expandafter\@tempa\@@input #2\relax + } +} +\newif\if@asy@attachfile@loaded +\AtBeginDocument{% + \@ifpackageloaded{attachfile2}{\@asy@attachfile@loadedtrue}{}% + \let\asy@check@attachfile\asy@check@attachfile@loaded +} +\newcommand\asy@check@attachfile@loaded{% + \if@asy@attachfile@loaded\else + \PackageError{asymptote}{You must load the attachfile2 package}{^^J% + You have requested the [attach] option for some or all of your^^J% + Asymptote graphics, which requires the attachfile2 package.^^J% + Please load it in the document preamble.^^J% + }% + \fi +} +\newcommand\asy@check@attachfile{% + \AtBeginDocument{\asy@check@attachfile@loaded}% + \let\asy@check@attachfile\@empty +} \def\csarg#1#2{\expandafter#1\csname#2\endcsname} -\newwrite\AsyStream -\newwrite\AsyPreStream -\newread\AsyTestStream - -\def\AsyInput#1{\openin\AsyTestStream=#1 -\ifeof\AsyTestStream -\else - \input #1 -\fi -\closein\AsyTestStream% +\DeclareOption{inline}{% + \ASYinlinetrue } - -\AsyInput{\jobname.pre} - -\immediate\openout\AsyPreStream=\jobname.pre - -\newif\ifASYinline -\newif\ifASYattach +\DeclareOption{attach}{% + \asy@check@attachfile + \ASYattachtrue +} +\ProcessOptions* +\def\asydir{} +\def\ASYprefix{} \newif\ifASYPDF - -\ifx\pdfoutput\undefined -\else -\ifcase\pdfoutput +\ifxetex + \ASYPDFtrue \else -\ASYPDFtrue + \ifpdf + \ASYPDFtrue + \fi \fi +\ifASYPDF + \def\AsyExtension{pdf} +\else + \def\AsyExtension{eps} \fi - -\newbox\ASYbox -\newcounter{asy} - -\def\ProcessAsymptote#1% start it all off -{\begingroup +\def\unquoteJobname#1"#2"#3\relax{% + \def\rawJobname{#1}% + \ifx\rawJobname\empty + \def\rawJobname{#2}% + \fi +} +\expandafter\unquoteJobname\jobname""\relax +\def\fixstar#1*#2\relax{% + \def\argtwo{#2}% + \ifx\argtwo\empty + \gdef\Jobname{#1}% + \else + \fixstar#1-#2\relax + \fi +} +\expandafter\fixstar\rawJobname*\relax +\def\Ginclude@eps#1{% + \message{<#1>}% + \bgroup + \def\@tempa{!}% + \dimen@\Gin@req@width + \dimen@ii.1bp\relax + \divide\dimen@\dimen@ii + \@tempdima\Gin@req@height + \divide\@tempdima\dimen@ii + \special{PSfile=#1\space + llx=\Gin@llx\space + lly=\Gin@lly\space + urx=\Gin@urx\space + ury=\Gin@ury\space + \ifx\Gin@scalex\@tempa\else rwi=\number\dimen@\space\fi + \ifx\Gin@scaley\@tempa\else rhi=\number\@tempdima\space\fi + \ifGin@clip clip\fi}% + \egroup +} +\immediate\openout\AsyPreStream=\jobname.pre\relax +\AtEndDocument{\immediate\closeout\AsyPreStream} +\def\WriteAsyLine#1{% + \immediate\write\AsyStream{\detokenize{#1}}% +} +\def\globalASYdefs{} +\def\WriteGlobalAsyLine#1{% + \expandafter\g@addto@macro + \expandafter\globalASYdefs + \expandafter{\detokenize{#1^^J}}% +} +\def\ProcessAsymptote#1{% + \begingroup \def\CurrentAsymptote{#1}% - \let\do\makeinnocent \dospecials - \makeinnocent\^^L% and whatever other special cases - \endlinechar`\^^M \catcode`\^^M=12 \xAsymptote} -{\catcode`\^^M=12 \endlinechar=-1 % + \let\do\@makeother \dospecials + \@makeother\^^L% and whatever other special cases + \catcode`\ =10 + \endlinechar`\^^M \catcode`\^^M=12 \xAsymptote +} +\begingroup + \catcode`\^^M=12 \endlinechar=-1\relax% \gdef\xAsymptote{% - \expandafter\ProcessAsymptoteLine} - \gdef\ProcessAsymptoteLine#1^^M{\def\test{#1} - \csarg\ifx{End\CurrentAsymptote Test}\test - \edef\next{\noexpand\EndOfAsymptote{\CurrentAsymptote}}% - \else \ThisAsymptote{#1}\let\next\ProcessAsymptoteLine - \fi \next} -} - -\def\ASYstringmeaning#1{\expandafter\ASYgobblearrow\meaning#1} -\def\ASYstringcsnoescape#1{\expandafter\ASYgobbleescape\string#1} -{\escapechar-1 - \expandafter\expandafter\expandafter\gdef - \expandafter\expandafter\expandafter\ASYgobblearrow - \expandafter\string\csname macro:->\endcsname{} -} -\def\ASYgobbleescape#1{\ifnum`\\=`#1 \else #1\fi} - -\def\WriteAsyLine#1{\def\ASYtmp{#1}% - \immediate\write\AsyStream{\ASYstringmeaning\ASYtmp}} - -\def\gedefappend#1#2{% - \toks@ = \expandafter{#1}% - \global\edef#1{\the\toks@ #2}% -}% -\def\globalASYdefs{} -\def\WriteGlobalAsyLine#1{\def\ASYtmp{#1^^J}% -\gedefappend\globalASYdefs{\ASYstringmeaning\ASYtmp}} - -\def\EndOfAsymptote#1{\endgroup\end{#1}% - \csname After#1Asymptote\endcsname} -\def\AsymptoteEndDef#1{{\escapechar=-1\relax - \csarg\xdef{End#1Test}{\string\\end\string\{#1\string\}}% - }} - -\def\AfterasyAsymptote{% - \ifx\ASYwidth\empty - \ifx\ASYheight\empty + \expandafter\ProcessAsymptoteLine% + } + \gdef\ProcessAsymptoteLine#1^^M{% + \def\@tempa{#1}% + {% + \escapechar=-1\relax% + \xdef\@tempb{\string\\end\string\{\CurrentAsymptote\string\}}% + }% + \ifx\@tempa\@tempb% + \edef\next{\endgroup\noexpand\end{\CurrentAsymptote}}% + \else% + \ThisAsymptote{#1}% + \let\next\ProcessAsymptoteLine% + \fi% + \next% + } +\endgroup +\newcommand\asy[1][]{% + \stepcounter{asy}% + \setkeys{ASYkeys}{#1}% + \ifASYattach + \ASYinlinefalse + \fi + \ifx\asydir\empty\else + \def\ASYprefix{\asydir/}% + \fi + \immediate\write\AsyPreStream{% + \noexpand\InputIfFileExists{% + \ASYprefix\noexpand\jobname-\the\c@asy.pre}{}{}% + } + \asy@write@graphic@header + \let\ThisAsymptote\WriteAsyLine + \ProcessAsymptote{asy}% +} +\def\endasy{% + \asy@finalise@stream + \asy@input@graphic +} +\def\asy@write@graphic@header{% + \immediate\openout\AsyStream=\ASYprefix\jobname-\the\c@asy.asy\relax + \gdef\AsyFile{\ASYprefix\Jobname-\the\c@asy}% + \immediate\write\AsyStream{% + if(!settings.multipleView) settings.batchView=false;^^J% + \ifxetex + settings.tex="xelatex";^^J% + \else\ifASYPDF + settings.tex="pdflatex";^^J% + \fi\fi + \ifASYinline + settings.inlinetex=true;^^J% + deletepreamble();^^J% + \fi + defaultfilename="\Jobname-\the\c@asy";^^J% + if(settings.render < 0) settings.render=4;^^J% + settings.outformat="";^^J% + \ifASYattach + settings.inlineimage=false;^^J% + settings.embed=false;^^J% + settings.toolbar=true;^^J% \else - \immediate\write\AsyStream{size(0,\ASYheight);}% + settings.inlineimage=true;^^J% + settings.embed=true;^^J% + settings.toolbar=false;^^J% + viewportmargin=(2,2);^^J% \fi - \else - \ifx\ASYheight\empty - \immediate\write\AsyStream{size(\ASYwidth,0);}% + \globalASYdefs + }% +} +\def\asy@expand@keepAspect{% + \ifASYkeepAspect keepAspect=true% + \else keepAspect=false% + \fi% +} +\def\asy@finalise@stream{% + \ifx\ASYwidth\@empty + \ifx\ASYheight\@empty + % write nothing! \else - \immediate\write\AsyStream{size(\ASYwidth,\ASYheight);}% + \immediate\write\AsyStream{size(0,\ASYheight,\asy@expand@keepAspect);}% \fi - \fi - \ifASYattach - \def\ASYdefaultviewportwidth{0}% \else - \def\ASYdefaultviewportwidth{\the\linewidth}% + \ifx\ASYheight\@empty + \immediate\write\AsyStream{size(\ASYwidth,0,\asy@expand@keepAspect);}% + \else + \immediate\write\AsyStream{size(\ASYwidth,\ASYheight,\asy@expand@keepAspect);}% + \fi \fi - \ifx\ASYviewportwidth\empty - \ifx\ASYviewportheight\empty + \edef\ASYviewportwidth{\ASYviewportwidth}% locally "freeze" viewportwidth + \ifx\ASYviewportwidth\@empty + \ifx\ASYviewportheight\@empty + % write nothing! \else \immediate\write\AsyStream{viewportsize=(0,\ASYviewportheight);}% \fi \else - \ifx\ASYviewportheight\empty + \ifx\ASYviewportheight\@empty \immediate\write\AsyStream{viewportsize=(\ASYviewportwidth,0);}% \else - \immediate\write% - \AsyStream{viewportsize=(\ASYviewportwidth,\ASYviewportheight);}% + \immediate\write\AsyStream{% + viewportsize=(\ASYviewportwidth,\ASYviewportheight);}% \fi \fi - \gdef\ASYwidth{}% - \gdef\ASYheight{}% - \gdef\ASYviewportwidth{\ASYdefaultviewportwidth}% - \gdef\ASYviewportheight{}% \immediate\closeout\AsyStream - +} +\def\asy@input@graphic{% \ifASYinline - \openin\AsyTestStream=\AsyFile.tex - \else - \ifASYPDF - \openin\AsyTestStream=\AsyFile.pdf - \else - \openin\AsyTestStream=\AsyFile.eps - \fi - \fi - \ifeof\AsyTestStream - \ifASYinline + \IfFileExists{"\AsyFile.tex"}{% + \catcode`:=12\relax + \@@input"\AsyFile.tex"\relax + }{% \PackageWarning{asymptote}{file `\AsyFile.tex' not found}% - \closein\AsyTestStream% - \else - \closein\AsyTestStream% - \openin\AsyTestStream=\AsyFile.tex - \ifeof\AsyTestStream + }% + \else + \IfFileExists{"\AsyFile.\AsyExtension"}{% + \ifASYattach \ifASYPDF - \PackageWarning{asymptote}{file `\AsyFile.pdf' not found}% + \IfFileExists{"\AsyFile+0.pdf"}{% + \setbox\ASYbox=\hbox{\includegraphics[hiresbb]{"\AsyFile+0".pdf}}% + }{% + \setbox\ASYbox=\hbox{\includegraphics[hiresbb]{"\AsyFile".pdf}}% + }% \else - \PackageWarning{asymptote}{file `\AsyFile.eps' not found}% + \setbox\ASYbox=\hbox{\includegraphics[hiresbb]{"\AsyFile.eps"}}% \fi + \textattachfile{\AsyFile.\AsyExtension}{\phantom{\copy\ASYbox}}% + \vskip-\ht\ASYbox + \indent + \box\ASYbox \else - \catcode`:=12 - \input \AsyFile.tex% - \fi - \closein\AsyTestStream% - \fi - \else - \closein\AsyTestStream% - \ifASYinline - \catcode`:=12 - \input \AsyFile.tex% - \else - \ifASYattach \ifASYPDF - \openin\AsyTestStream=\AsyFile+0.pdf - \fi - \ifeof\AsyTestStream - \setbox\ASYbox=\hbox{\includegraphics[hiresbb]{\AsyFile}}% + \includegraphics[hiresbb]{"\AsyFile".pdf}% \else - \setbox\ASYbox=\hbox{\includegraphics[hiresbb]{\AsyFile+0}}% + \includegraphics[hiresbb]{"\AsyFile.eps"}% \fi - \textattachfile{\AsyFile.pdf}{\phantom{\copy\ASYbox}}% - \vskip-\ht\ASYbox% - \indent% - \box\ASYbox% - \closein\AsyTestStream% - \else - \includegraphics[hiresbb]{\AsyFile}% \fi - \fi + }{% + \IfFileExists{"\AsyFile.tex"}{% + \catcode`:=12 + \@@input"\AsyFile.tex"\relax + }{% + \PackageWarning{asymptote}{% + file `\AsyFile.\AsyExtension' not found% + }% + }% + }% \fi - \relax% - \endgroup} -\gdef\ASYwidth{}% +} +\def\asydef{% + \let\ThisAsymptote\WriteGlobalAsyLine + \ProcessAsymptote{asydef}% +} +\newcommand\asyinclude[2][]{% + \begingroup + \stepcounter{asy}% + \setkeys{ASYkeys}{#1}% + \ifASYattach + \ASYinlinefalse + \fi + \ifx\asydir\empty\else + \def\ASYprefix{\asydir/}% + \fi + \immediate\write\AsyPreStream{% + \noexpand\InputIfFileExists{% + \ASYprefix\noexpand\jobname-\the\c@asy.pre}{}{}% + } + \asy@write@graphic@header + \IfFileExists{#2.asy}{% + \CatchFileDef\@tempa{#2.asy}{% + \let\do\@makeother + \dospecials + \endlinechar=10\relax + } + }{ + \IfFileExists{#2}{% + \CatchFileDef\@tempa{#2}{% + \let\do\@makeother + \dospecials + \endlinechar=10\relax + } + }{ + \PackageWarning{asymptote}{file #2 not found}% + } + } + \immediate\write\AsyStream{\unexpanded\expandafter{\@tempa}}% + \asy@finalise@stream + \asy@input@graphic + \endgroup +} +\newcommand{\ASYanimategraphics}[5][]{% + \IfFileExists{_#3.pdf}{% + \animategraphics[{#1}]{#2}{_#3}{#4}{#5}% + }{} +} +\newcommand\asysetup[1]{\setkeys{ASYkeys}{#1}} +\define@key{ASYkeys}{dir}{% + \def\asydir{#1}% +} +\def\ASYwidth{} \define@key{ASYkeys}{width}{% - \gdef\ASYwidth{#1}% + \edef\ASYwidth{\the\dimexpr#1\relax}% } -\gdef\ASYheight{}% +\def\ASYheight{} \define@key{ASYkeys}{height}{% - \gdef\ASYheight{#1}% + \edef\ASYheight{\the\dimexpr#1\relax}% +} +\define@key{ASYkeys}{keepAspect}[true]{% + \ifthenelse{\equal{#1}{true}} + {\ASYkeepAspecttrue} + {\ASYkeepAspectfalse}% +} +\def\ASYviewportwidth{\ASYdefaultviewportwidth} +\def\ASYdefaultviewportwidth{% + \ifASYattach \@empty \else \the\linewidth \fi } -\gdef\ASYviewportwidth{\ASYdefaultviewportwidth}% \define@key{ASYkeys}{viewportwidth}{% - \gdef\ASYviewportwidth{#1}% + \edef\ASYviewportwidth{\the\dimexpr#1\relax}% } -\gdef\ASYviewportheight{}% +\def\ASYviewportheight{} \define@key{ASYkeys}{viewportheight}{% - \gdef\ASYviewportheight{#1}% -} -\define@key{ASYkeys}{attach}[true]{% - \ifthenelse{\equal{#1}{true}}{\global\ASYattachtrue}{\global\ASYattachfalse}% + \edef\ASYviewportheight{\the\dimexpr#1\relax}% } \define@key{ASYkeys}{inline}[true]{% - \ifthenelse{\equal{#1}{true}}{\global\ASYinlinetrue}{\global\ASYinlinefalse}% + \ifthenelse{\equal{#1}{true}} + {\ASYinlinetrue} + {\ASYinlinefalse}% } -\newcommand\asy[1][]{% - \begingroup - \let\par\empty - \stepcounter{asy}% - \global\let\ifASYinline\ifASYdefaultinline - \global\let\ifASYattach\ifASYdefaultattach - \setkeys{ASYkeys}{#1}% - \ifASYattach - \global\ASYinlinefalse - \fi - \immediate\write\AsyPreStream% - {\@backslashchar AsyInput{\jobname-\the\c@asy.pre}} - \immediate\openout\AsyStream=\jobname-\the\c@asy.asy - \gdef\AsyFile{\Jobname-\the\c@asy}% - \immediate\write\AsyStream{if(!settings.multipleView)}% - \immediate\write\AsyStream{ settings.batchView=false;}% - \ifx\XeTeXversion\undefined - \ifASYPDF - \immediate\write\AsyStream{settings.tex="pdflatex";}% - \fi - \else - \immediate\write\AsyStream{settings.tex="xelatex";}% - \ASYPDFtrue - \fi - - \ifASYinline - \immediate\write\AsyStream{settings.inlinetex=true;}% - \immediate\write\AsyStream{deletepreamble();}% - \fi - \immediate\write\AsyStream{defaultfilename="\AsyFile";}% - \immediate\write\AsyStream{if(settings.render < 0) settings.render=4;}% - \ifASYattach - \immediate\write\AsyStream{settings.inlineimage=false;}% - \immediate\write\AsyStream{settings.embed=false;}% - \immediate\write\AsyStream{settings.outformat="pdf";}% - \immediate\write\AsyStream{settings.toolbar=true;}% - \else - \immediate\write\AsyStream{settings.inlineimage=true;}% - \immediate\write\AsyStream{settings.embed=true;}% - \immediate\write\AsyStream{settings.outformat="";}% - \immediate\write\AsyStream{settings.toolbar=false;}% - \immediate\write\AsyStream{viewportmargin=(2,2);}% - \fi - \immediate\write\AsyStream{\globalASYdefs}% - \let\ThisAsymptote\WriteAsyLine% - \ProcessAsymptote{asy}% +\define@key{ASYkeys}{attach}[true]{% + \ifthenelse{\equal{#1}{true}} + {\ASYattachtrue} + {\ASYattachfalse}% } -\AsymptoteEndDef{asy} -\def\asydef{% - \let\ThisAsymptote\WriteGlobalAsyLine% - \ProcessAsymptote{asydef}} -\AsymptoteEndDef{asydef} -\def\AfterasydefAsymptote{} - -\AtEndDocument{\immediate\closeout\AsyPreStream} - -\newcommand{\ASYanimategraphics}[5][]{% -\openin\AsyTestStream=_#3.pdf -\ifeof\AsyTestStream% -\else% -\animategraphics[{#1}]{#2}{_#3}{#4}{#5}% -\fi% -} - -% Work around bug in dvips.def: allow spaces in file names. -\def\Ginclude@eps#1{% - \message{<#1>}% - \bgroup - \def\@tempa{!}% - \dimen@\Gin@req@width - \dimen@ii.1bp% - \divide\dimen@\dimen@ii - \@tempdima\Gin@req@height - \divide\@tempdima\dimen@ii - \special{PSfile=#1\space - llx=\Gin@llx\space - lly=\Gin@lly\space - urx=\Gin@urx\space - ury=\Gin@ury\space - \ifx\Gin@scalex\@tempa\else rwi=\number\dimen@\space\fi - \ifx\Gin@scaley\@tempa\else rhi=\number\@tempdima\space\fi - \ifGin@clip clip\fi}% - \egroup} - -\def\Asymptote{{\tt Asymptote}} - -%%% Local Variables: -%%% mode: latex -%%% TeX-master: "shared" -%%% End: diff --git a/Build/source/utils/asymptote/doc/asymptote.texi b/Build/source/utils/asymptote/doc/asymptote.texi index 6fd28e78456..9a2d6baa88b 100644 --- a/Build/source/utils/asymptote/doc/asymptote.texi +++ b/Build/source/utils/asymptote/doc/asymptote.texi @@ -382,8 +382,8 @@ The @code{ImageMagick} package from @url{http://www.imagemagick.org/script/binary-releases.php} @noindent -is required to support output formats other than @acronym{EPS} and -@acronym{PDF} (@pxref{convert}). +is required to support output formats other than @acronym{EPS}, +@acronym{PDF}, @acronym{SVG}, and @acronym{PNG} (@pxref{convert}). The @code{Python} interpreter from @url{http://www.python.org} is only required if you wish to try out the graphical user interface (@pxref{GUI}). @@ -532,7 +532,7 @@ under @code{Microsoft Windows XP}: @enumerate @item Click on the @code{Start} button; @item Right-click on @code{My Computer}; -@item Choose @code{Properties} from the popup menu; +@item Choose @code{View system information}; @item Click the @code{Advanced} tab; @item Click the @code{Environment Variables} button. @end enumerate @@ -788,14 +788,19 @@ application for the extension @code{asy}). @noindent @cindex @code{-V} This method, known as @emph{batch mode}, outputs a @code{PostScript} -file @code{test.eps}. The @code{-V} option opens up a @code{PostScript} -viewer window so you can immediately view the result: +file @code{test.eps}. If you prefer @acronym{PDF} output, use +the command line +@verbatim +asy -V -f pdf test +@end verbatim +In either case, the @code{-V} option opens up a viewer window so you +can immediately view the result: @sp 1 @center @image{diagonal} @cindex @code{bp} @noindent -The @code{--} connector joins the two points @code{(0,0)} and -@code{(100,100)} with a line segment. +Here, the @code{--} connector joins the two points @code{(0,0)} and +@code{(100,100)} with a line segment. @section Drawing in interactive mode Another method is @emph{interactive mode}, where @code{Asymptote} reads @@ -3260,12 +3265,14 @@ If exactly one of @code{x} or @code{y} is 0, no size restriction is imposed in that direction; it will be scaled the same as the other direction. +@cindex @code{keepAspect} @cindex @code{Aspect} If @code{keepAspect} is set to @code{Aspect} or @code{true}, the picture will be scaled with its aspect ratio preserved such that the final width is no more than @code{x} and the final height is no more than @code{y}. +@cindex @code{keepAspect} @cindex @code{IgnoreAspect} If @code{keepAspect} is set to @code{IgnoreAspect} or @code{false}, the picture will be scaled in both directions so that the final width @@ -3668,6 +3675,10 @@ will be set to the end-of-file, and both reading and writing operations will be enabled. For security reasons, writing to files in directories other than the current directory is allowed only if the @code{-globalwrite} (or @code{-nosafe}) command-line option is specified. +@cindex @code{mktemp} +The function @code{string mktemp(string s)} may be used to create and +return the name of a unique temporary file in the current directory +based on the string @code{s}. @cindex @code{stdin} @cindex @code{stdout} @@ -3691,6 +3702,8 @@ write(file file, suffix suffix=none); @cindex @code{flush} @cindex @code{endl} @cindex @code{newl} +@cindex @code{DOSendl} +@cindex @code{DOSnewl} @cindex @code{tab} @cindex @code{comma} If @code{file} is not specified, @code{stdout} is used and @@ -3701,6 +3714,8 @@ or one-dimensional arrays. The @code{suffix} may be one of the following: @code{none} (do nothing), @code{flush} (output buffered data), @code{endl} (terminate with a newline and flush), @code{newl} (terminate with a newline), +@code{DOSendl} (terminate with a DOS newline and flush), +@code{DOSnewl} (terminate with a DOS newline), @code{tab} (terminate with a tab), or @code{comma} (terminate with a comma). Here are some simple examples of data output: @verbatim @@ -4631,6 +4646,16 @@ write(f(4,3)); @noindent and outputs 43. +@cindex @code{keyword} +@cindex keyword-only +Parameters can be specified as ``keyword-only'' by putting @code{keyword} +immediately before the parameter name, as in @code{int f(int keyword x)} or +@code{int f(int keyword x=77)}. This forces the caller of the function to use +a named argument to give a value for this parameter. That is, @code{f(x=42)} +is legal, but @code{f(25)} is not. Keyword-only parameters must be listed +after normal parameters in a function definition. + + As a technical detail, we point out that, since variables of the same name but different signatures are allowed in the same scope, the code @verbatim @@ -4715,6 +4740,17 @@ If no arguments are packed, then a zero-length array (as opposed to arguments are ignored for rest formals and the rest argument is not bound to a keyword. +In some cases, keyword-only parameters are helpful to avoid arguments intended +for the rest parameter to be assigned to other parameters. For example, here +the use of @code{keyword} is to avoid @code{pnorm(1.0,2.0,0.3)} matching +@code{1.0} to @code{p}. +@verbatim +real pnorm(real keyword p=2.0 ... real[] v) +{ + return sum(v^p)^(1/p); +} +@end verbatim + The overloading resolution in @code{Asymptote} is similar to the function matching rules used in C++. Every argument match is given a score. Exact matches score better than matches with casting, and @@ -5081,9 +5117,10 @@ themselves (in which case they are each initialized to empty arrays). @cindex @code{array} @item T[] array(int n, T value, int depth=intMax) -returns an array consisting of @code{n} deep copies of a 0, 1, or 2 -dimensional array @code{T value}. If @code{depth} is specified, this -deep copying recurses to no more than the number of levels specified. +returns an array consisting of @code{n} copies of @code{value}. +If @code{value} is itself an array, a deep copy of @code{value} is made +for each entry. If @code{depth} is specified, this deep copying only +recurses to the specified number of levels. @cindex @code{sequence} @item int[] sequence(int n) @@ -5931,7 +5968,7 @@ to the type. This is regardless of what fields the variable actually possesses. @cindex @code{asymptote.sty} @code{Asymptote} comes with a convenient @code{LaTeX} style file -@code{asymptote.sty} (version 1.15 or later) that makes @code{LaTeX} +@code{asymptote.sty} that makes @code{LaTeX} @code{Asymptote}-aware. Entering @code{Asymptote} code directly into the @code{LaTeX} source file, at the point where it is needed, keeps figures organized and avoids the need to invent new file @@ -5940,8 +5977,7 @@ names for each figure. Simply add the line and enclose your @code{Asymptote} code within a @code{\begin@{asy@}...\end@{asy@}} environment. As with the @code{LaTeX} @code{comment} environment, the @code{\end@{asy@}} command -must appear on a line by itself, with no leading spaces or trailing -commands/comments. +must appear on a line by itself, with no trailing commands/comments. The sample @code{LaTeX} file below, named @code{latexusage.tex}, can be run as follows: @@ -5959,11 +5995,11 @@ asy latexusage-*.asy pdflatex latexusage @end verbatim @noindent -To switch between using @code{latex} and @code{pdflatex} you may first -need to remove the files @code{latexusage-*}, @code{latexusage.pre}, and -@code{latexusage.aux}. +To switch between using inline Asymptote code with @code{latex} and +@code{pdflatex} you may first need to remove the files @code{latexusage-*.tex}. @cindex @code{latexmk} +@cindex @code{perl} An even better method for processing a @code{LaTeX} file with embedded @code{Asymptote} code is to use the @code{latexmk} utility from @quotation @@ -5981,16 +6017,26 @@ latexmk -pdf latexusage will then call @code{Asymptote} automatically, recompiling only the figures that have changed. Since each figure is compiled in a separate system process, this method also tends to use less memory. +External @code{Asymptote} code in @code{filename.asy} should be included with +@cindex @code{asyinclude} +@verbatim +\asyinclude[<options>]{<filename.asy>} +@end verbatim +@noindent +so that @code{latexmk} will recognize when the code is changed. Note that +@code{latemk} requires @code{perl}, available from @url{http://www.perl.org/}. @cindex @code{width} @cindex @code{height} +@cindex @code{keepAspect} @cindex @code{viewportwidth} @cindex @code{viewportheight} @cindex @code{attach} @cindex @code{inline} -One can specify @code{width}, @code{height}, +One can specify @code{width}, @code{height}, @code{keepAspect}, @code{viewportwidth}, @code{viewportheight}, @code{attach}, and @code{inline}. -@code{keyval}-style options to the @code{asy} environment. +@code{keyval}-style options to the @code{asy} and @code{asyinclude} +environments. Three-dimensional @acronym{PRC} files may either be embedded within the page (the default) or attached as annotated (but printable) attachments, using the @code{attach} option and the @code{attachfile2} @@ -7493,21 +7539,29 @@ Here is an example that uses logarithmic scaling of the function values: @sp 1 @center @image{logimage} -One can also draw an image directly from a two-dimensional pen array: +One can also draw an image directly from a two-dimensional pen array +or a function @code{pen f(int, int)}: @verbatim void image(picture pic=currentpicture, pen[][] data, pair initial, pair final, bool transpose=(initial.x < final.x && initial.y < final.y), bool copy=true, bool antialias=false); +void image(picture pic=currentpicture, pen f(int, int), int width, int height, + pair initial, pair final, bool antialias=false); @end verbatim @noindent -as illustrated in the following example: +as illustrated in the following examples: @anchor{penimage} @verbatiminclude penimage.asy @sp 1 @center @image{penimage} +@anchor{penfunctionimage} +@verbatiminclude penfunctionimage.asy +@sp 1 +@center @image{penfunctionimage} + For convenience, the module @code{palette} also defines functions that may be used to construct a pen array from a given function and palette: @verbatim @@ -8273,6 +8327,16 @@ Module @code{three} also defines the three-dimensional margins @code{BeginDotMargin3}, @code{EndDotMargin3}, @code{DotMargin3}, @code{DotMargins3}, @code{Margin3}, and @code{TrueMargin3}. +@cindex @code{pixel} +The routine +@verbatim +void pixel(picture pic=currentpicture, triple v, pen p=currentpen, + real width=1); +@end verbatim +@noindent +can be used to draw on picture @code{pic} a pixel of width @code{width} at +position @code{v} using pen @code{p}. + Further three-dimensional examples are provided in the files @code{near_earth.asy}, @code{conicurv.asy}, and (in the @code{animations} subdirectory) @code{cube.asy}. @@ -9568,11 +9632,12 @@ Mark Henning, Steve Melenchuk, Martin Wiebusch, and Stefan Knorr. @c LocalWords: vectorfieldsphere RightView FrontView BackView BottomView CTZ @c LocalWords: addViews outprefix addAllViews xsplinetype ysplinetype rotateX @c LocalWords: usplinetype vsplinetype leftbutton middlebutton rightbutton -@c LocalWords: rotateY rotateZ wheelup zoomin wheeldown zoomout TeXLive +@c LocalWords: rotateY rotateZ wheelup zoomin wheeldown zoomout TeXLive pnorm @c LocalWords: viewportshift signedint signedness psview multiplatform nowarn @c LocalWords: singlereal singleint writeoverloaded dvisvg reddash lexorder @c LocalWords: bigdiagonal autobillboard dvisvgm maxtiles hyperrefOptions @c LocalWords: setpagesize pdfborder controlsystem OmitTickInterval SixViews @c LocalWords: OmitTickIntervals tickmodifiers autorotated SixViewsUS latexmk @c LocalWords: ThreeViewsUS ThreeViewsFR SixViewsFR ThreeViews partialsum -@c LocalWords: defaultrender Vidiassov latexmkrc +@c LocalWords: defaultrender Vidiassov latexmkrc mktemp DOSendl DOSnewl perl +@c LocalWords: filename asyinclude latemk penfunctionimage diff --git a/Build/source/utils/asymptote/doc/diatom.asy b/Build/source/utils/asymptote/doc/diatom.asy index 2ded75bf0ea..23673dcadf5 100644 --- a/Build/source/utils/asymptote/doc/diatom.asy +++ b/Build/source/utils/asymptote/doc/diatom.asy @@ -115,7 +115,7 @@ for(int taxon=0; taxon < n; ++taxon) { if(taxon == final) yaxis(pic,Right,LeftTicks("%",0,10),above=true); add(shift(location,0)*pic); - location += pic.userMax.x; + location += pic.userMax().x; } add(new void(frame f, transform) { diff --git a/Build/source/utils/asymptote/doc/extra/intro.asy b/Build/source/utils/asymptote/doc/extra/intro.asy index 5d7ce12b184..fcafefb32a6 100644 --- a/Build/source/utils/asymptote/doc/extra/intro.asy +++ b/Build/source/utils/asymptote/doc/extra/intro.asy @@ -50,7 +50,6 @@ item("4000 downloads/month from primary\hfill\\ {\tt asymptote.sourceforge.net} site alone."); item("80\ 000 lines of low-level C++ code."); item("36\ 000 lines of high-level Asymptote code."); -item("Latest stable release: Version 2.00 (LGPL)."); if(long) { title("Vector Graphics"); diff --git a/Build/source/utils/asymptote/doc/install-sh b/Build/source/utils/asymptote/doc/install-sh index a9244eb0786..6781b987bdb 100755 --- a/Build/source/utils/asymptote/doc/install-sh +++ b/Build/source/utils/asymptote/doc/install-sh @@ -1,7 +1,7 @@ #!/bin/sh # install - install a program, script, or datafile -scriptversion=2011-01-19.21; # UTC +scriptversion=2009-04-28.21; # UTC # This originates from X11R5 (mit/util/scripts/install.sh), which was # later released in X11R6 (xc/config/util/install.sh) with the @@ -156,10 +156,6 @@ while test $# -ne 0; do -s) stripcmd=$stripprog;; -t) dst_arg=$2 - # Protect names problematic for `test' and other utilities. - case $dst_arg in - -* | [=\(\)!]) dst_arg=./$dst_arg;; - esac shift;; -T) no_target_directory=true;; @@ -190,10 +186,6 @@ if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then fi shift # arg dst_arg=$arg - # Protect names problematic for `test' and other utilities. - case $dst_arg in - -* | [=\(\)!]) dst_arg=./$dst_arg;; - esac done fi @@ -208,11 +200,7 @@ if test $# -eq 0; then fi if test -z "$dir_arg"; then - do_exit='(exit $ret); exit $ret' - trap "ret=129; $do_exit" 1 - trap "ret=130; $do_exit" 2 - trap "ret=141; $do_exit" 13 - trap "ret=143; $do_exit" 15 + trap '(exit $?); exit' 1 2 13 15 # Set umask so as not to create temps with too-generous modes. # However, 'strip' requires both read and write access to temps. @@ -240,9 +228,9 @@ fi for src do - # Protect names problematic for `test' and other utilities. + # Protect names starting with `-'. case $src in - -* | [=\(\)!]) src=./$src;; + -*) src=./$src;; esac if test -n "$dir_arg"; then @@ -264,7 +252,12 @@ do echo "$0: no destination specified." >&2 exit 1 fi + dst=$dst_arg + # Protect names starting with `-'. + case $dst in + -*) dst=./$dst;; + esac # If destination is a directory, append the input filename; won't work # if double slashes aren't ignored. @@ -392,7 +385,7 @@ do case $dstdir in /*) prefix='/';; - [-=\(\)!]*) prefix='./';; + -*) prefix='./';; *) prefix='';; esac @@ -410,7 +403,7 @@ do for d do - test X"$d" = X && continue + test -z "$d" && continue prefix=$prefix$d if test -d "$prefix"; then diff --git a/Build/source/utils/asymptote/doc/latexusage.pre b/Build/source/utils/asymptote/doc/latexusage.pre deleted file mode 100644 index fd737b3a1e4..00000000000 --- a/Build/source/utils/asymptote/doc/latexusage.pre +++ /dev/null @@ -1,3 +0,0 @@ -\AsyInput{latexusage-1.pre} -\AsyInput{latexusage-2.pre} -\AsyInput{latexusage-3.pre} diff --git a/Build/source/utils/asymptote/doc/latexusage.tex b/Build/source/utils/asymptote/doc/latexusage.tex index ae555a476bd..f3c858348b9 100644 --- a/Build/source/utils/asymptote/doc/latexusage.tex +++ b/Build/source/utils/asymptote/doc/latexusage.tex @@ -9,14 +9,14 @@ % Use this form with latex or pdflatex to create PDF attachments by default: %\usepackage[attach]{asymptote} -% Enable this line to support PDF hyperlinks: -%\usepackage{hyperref}\hypersetup{setpagesize=false,unicode} - % Enable this line to support the attach option: %\usepackage[dvips]{attachfile2} \begin{document} +% Optional subdirectory for asy files (no spaces): +\def\asydir{} + \begin{asydef} // Global Asymptote definitions can be put here. import three; @@ -81,8 +81,8 @@ and height to \LaTeX\ explicitly. This 3D example can be viewed interactively either with Adobe Reader or Asymptote's fast OpenGL-based renderer. To support {\tt latexmk}, 3D figures should specify \verb+inline=true+. It is sometimes desirable to embed 3D files as annotated -attachments; this requires the optional \verb+\usepackage{attachfile2}+ -package and the \verb+attach=true+ option: +attachments; this requires the \verb+attach=true+ option as well as the +\verb+attachfile2+ \LaTeX\ package. \begin{center} \begin{asy}[height=4cm,inline=true,attach=false] currentprojection=orthographic(5,4,2); diff --git a/Build/source/utils/asymptote/doc/options b/Build/source/utils/asymptote/doc/options deleted file mode 100644 index 742bbd8702b..00000000000 --- a/Build/source/utils/asymptote/doc/options +++ /dev/null @@ -1,88 +0,0 @@ -Usage: ../asy [options] [file ...] - -Options (negate by replacing - with -no): - --V,-View View output; command-line only --a,-align C|B|T|Z Center, Bottom, Top, or Zero page alignment [C] --antialias n Antialiasing width for rasterized output [2] --arcballradius pixels Arcball radius [750] --auto3D Automatically activate 3D scene [true] --autobillboard 3D labels always face viewer by default [true] --autoimport string Module to automatically import --autoplain Enable automatic importing of plain [true] --autoplay Autoplay 3D animations [false] --autorotate Enable automatic PDF page rotation [false] --batchMask Mask fpu exceptions in batch mode [false] --batchView View output in batch mode [false] --bw Convert all colors to black and white [false] --cd directory Set current directory; command-line only --cmyk Convert rgb colors to cmyk [false] --c,-command string Command to autoexecute --compact Conserve memory at the expense of speed [false] --d,-debug Enable debugging messages [false] --divisor n Garbage collect using purge(divisor=n) [2] --doubleclick ms Emulated double-click timeout [200] --embed Embed rendered preview image [true] --exitonEOF Exit interactive mode on EOF [true] --fitscreen Fit rendered image to screen [true] --framedelay ms Additional frame delay [0] --framerate frames/s Animation speed [30] --globalwrite Allow write to other directory [false] --gray Convert all colors to grayscale [false] --h,-help Show summary of options; command-line only --historylines n Retain n lines of history [1000] --iconify Iconify rendering window [false] --inlineimage Generate inline embedded image [false] --inlinetex Generate inline TeX code [false] --interactiveMask Mask fpu exceptions in interactive mode [true] --interactiveView View output in interactive mode [true] --interactiveWrite Write expressions entered at the prompt to stdout [true] --k,-keep Keep intermediate files [false] --keepaux Keep intermediate LaTeX .aux files [false] --level n Postscript level [3] --l,-listvariables List available global functions and variables [false] --localhistory Use a local interactive history file [false] --loop Loop 3D animations [false] --m,-mask Mask fpu exceptions; command-line only --maxtile pair Maximum rendering tile size [(0,0)] --maxviewport pair Maximum viewport size [(2048,2048)] --multiline Input code over multiple lines at the prompt [false] --multipleView View output from multiple batch-mode files [false] --multisample n Multisampling width for screen images [4] --O,-offset pair PostScript offset [(0,0)] --f,-outformat format Convert each output file to specified format --o,-outname name Alternative output directory/filename --p,-parseonly Parse file [false] --pdfreload Automatically reload document in pdfviewer [false] --pdfreloaddelay usec Delay before attempting initial pdf reload [750000] --position pair Initial 3D rendering screen position [(0,0)] --prc Embed 3D PRC graphics in PDF output [true] --prompt string Prompt [> ] --prompt2 string Continuation prompt for multiline input [..] --q,-quiet Suppress welcome message [false] --render n Render 3D graphics using n pixels per bp (-1=auto) [-1] --resizestep step Resize step [1.2] --reverse reverse 3D animations [false] --rgb Convert cmyk colors to rgb [false] --safe Disable system call [true] --scroll n Scroll standard output n lines at a time [0] --spinstep deg/s Spin speed [60] --svgemulation Emulate unimplemented SVG shading [false] --tabcompletion Interactive prompt auto-completion [true] --tex engine latex|pdflatex|xelatex|tex|pdftex|context|none [latex] --thick Render thick 3D lines [true] --thin Render thin 3D lines [true] --threads Use POSIX threads for 3D rendering [true] --toolbar Show 3D toolbar in PDF output [true] --s,-translate Show translated virtual machine code [false] --twice Run LaTeX twice (to resolve references) [false] --twosided Use two-sided 3D lighting model for rendering [true] --u,-user string General purpose user string --v,-verbose Increase verbosity level (can specify multiple times) [0] --version Show version; command-line only --wait Wait for child processes to finish before exiting [false] --warn string Enable warning; command-line only --where Show where listed variables are declared [false] --zoomfactor factor Zoom step factor [1.05] --zoomstep step Mouse motion zoom step [0.1] - diff --git a/Build/source/utils/asymptote/doc/penfunctionimage.asy b/Build/source/utils/asymptote/doc/penfunctionimage.asy new file mode 100644 index 00000000000..38951e550d5 --- /dev/null +++ b/Build/source/utils/asymptote/doc/penfunctionimage.asy @@ -0,0 +1,27 @@ +import palette; + +size(200); + +real fracpart(real x) {return (x-floor(x));} + +pair pws(pair z) { + pair w=(z+exp(pi*I/5)/0.9)/(1+z/0.9*exp(-pi*I/5)); + return exp(w)*(w^3-0.5*I); +} + +int N=512; + +pair a=(-1,-1); +pair b=(0.5,0.5); +real dx=(b-a).x/N; +real dy=(b-a).y/N; + +pen f(int u, int v) { + pair z=a+(u*dx,v*dy); + pair w=pws(z); + real phase=degrees(w,warn=false); + real modulus=w == 0 ? 0: fracpart(log(abs(w))); + return hsv(phase,1,sqrt(modulus)); +} + +image(f,N,N,(0,0),(300,300),antialias=true); diff --git a/Build/source/utils/asymptote/doc/png/Makefile.in b/Build/source/utils/asymptote/doc/png/Makefile.in index af5ba0c8b31..38b92bc03d1 100644 --- a/Build/source/utils/asymptote/doc/png/Makefile.in +++ b/Build/source/utils/asymptote/doc/png/Makefile.in @@ -1,4 +1,5 @@ -ASYFILES = $(notdir $(wildcard ../*.asy)) latexusage.asy +ASYFILES = $(notdir $(filter-out $(wildcard ../latexusage-*.asy),$(wildcard ../*.asy))) + SOURCE = ../asymptote.texi ../version.texi ../options ASY = ../asy -dir ../base -config "" -render=0 @@ -16,13 +17,13 @@ latexusage.png: ../latexusage.eps convert -alpha Off -density 144x144 +antialias -geometry 50%x \ ../latexusage.eps latexusage.png -index.html: $(SOURCE) $(ASYFILES:.asy=.png) +index.html: $(SOURCE) $(ASYFILES:.asy=.png) latexusage.png makeinfo --html ../asymptote -o . asymptote.info: $(SOURCE) makeinfo --no-warn --no-split ../asymptote -info: $(SOURCE) $(ASYFILES:.asy=.png) +info: $(SOURCE) $(ASYFILES:.asy=.png) latexusage.png makeinfo --no-split ../asymptote html: index.html @@ -48,3 +49,6 @@ uninstall: -cd $(infodir)/asymptote && rm -f asymptote.info *.png -rmdir $(infodir)/asymptote FORCE: + +Makefile: Makefile.in + cd ../..; config.status diff --git a/Build/source/utils/asymptote/doc/png/asymptote.info b/Build/source/utils/asymptote/doc/png/asymptote.info index e72ff70242c..55fbad3858a 100644 --- a/Build/source/utils/asymptote/doc/png/asymptote.info +++ b/Build/source/utils/asymptote/doc/png/asymptote.info @@ -1,7 +1,7 @@ This is asymptote.info, produced by makeinfo version 4.13 from ../asymptote.texi. -This file documents `Asymptote', version 2.02. +This file documents `Asymptote', version 2.10. `http://asymptote.sourceforge.net' @@ -23,7 +23,7 @@ File: asymptote.info, Node: Top, Next: Description, Up: (dir) Asymptote ********* -This file documents `Asymptote', version 2.02. +This file documents `Asymptote', version 2.10. `http://asymptote.sourceforge.net' @@ -347,10 +347,10 @@ file::). `http://www.imagemagick.org/script/binary-releases.php' -is required to support output formats other than EPS and PDF (*note -convert::). The `Python' interpreter from `http://www.python.org' is -only required if you wish to try out the graphical user interface -(*note GUI::). +is required to support output formats other than EPS, PDF, SVG, and PNG +(*note convert::). The `Python' interpreter from +`http://www.python.org' is only required if you wish to try out the +graphical user interface (*note GUI::). Example code will be installed by default in the `examples' subdirectory of the installation directory (by default, `C:\Program @@ -454,7 +454,7 @@ ASYMPTOTE_PSVIEWER="C:\Program Files\Ghostgum\gsview\gsview32.exe"; 2. Right-click on `My Computer'; - 3. Choose `Properties' from the popup menu; + 3. Choose `View system information'; 4. Click the `Advanced' tab; @@ -655,12 +655,14 @@ Desktop `asy' icon (or make `Asymptote' the default application for the extension `asy'). This method, known as _batch mode_, outputs a `PostScript' file -`test.eps'. The `-V' option opens up a `PostScript' viewer window so -you can immediately view the result: +`test.eps'. If you prefer PDF output, use the command line +asy -V -f pdf test + In either case, the `-V' option opens up a viewer window so you can +immediately view the result: -The `--' connector joins the two points `(0,0)' and `(100,100)' with a -line segment. +Here, the `--' connector joins the two points `(0,0)' and `(100,100)' +with a line segment. 3.2 Drawing in interactive mode =============================== @@ -711,7 +713,7 @@ draw((0,0)--(2,1),Arrow); To connect several points and create a cyclic path, use the `cycle' keyword: -size(100,100); +size(3cm); draw((0,0)--(1,0)--(1,1)--(0,1)--cycle); @@ -2893,7 +2895,9 @@ existing data will be preserved, the position will be set to the end-of-file, and both reading and writing operations will be enabled. For security reasons, writing to files in directories other than the current directory is allowed only if the `-globalwrite' (or `-nosafe') -command-line option is specified. +command-line option is specified. The function `string mktemp(string +s)' may be used to create and return the name of a unique temporary +file in the current directory based on the string `s'. There are two special files: `stdin', which reads from the keyboard, and `stdout', which writes to the terminal. The implicit initializer @@ -2914,8 +2918,10 @@ written before the data `x'. An arbitrary number of data values may be listed when writing scalars or one-dimensional arrays. The `suffix' may be one of the following: `none' (do nothing), `flush' (output buffered data), `endl' (terminate with a newline and flush), `newl' (terminate -with a newline), `tab' (terminate with a tab), or `comma' (terminate -with a comma). Here are some simple examples of data output: +with a newline), `DOSendl' (terminate with a DOS newline and flush), +`DOSnewl' (terminate with a DOS newline), `tab' (terminate with a tab), +or `comma' (terminate with a comma). Here are some simple examples of +data output: file fout=output("test.txt"); write(fout,1); // Writes "1" write(fout); // Writes a new line @@ -3654,6 +3660,13 @@ x=3; write(f(4,3)); and outputs 43. + Parameters can be specified as "keyword-only" by putting `keyword' +immediately before the parameter name, as in `int f(int keyword x)' or +`int f(int keyword x=77)'. This forces the caller of the function to +use a named argument to give a value for this parameter. That is, +`f(x=42)' is legal, but `f(25)' is not. Keyword-only parameters must +be listed after normal parameters in a function definition. + As a technical detail, we point out that, since variables of the same name but different signatures are allowed in the same scope, the code int f(int x, int x()) { @@ -3721,6 +3734,15 @@ subtract(... new int[] {10, 1, 2}); ignored for rest formals and the rest argument is not bound to a keyword. + In some cases, keyword-only parameters are helpful to avoid +arguments intended for the rest parameter to be assigned to other +parameters. For example, here the use of `keyword' is to avoid +`pnorm(1.0,2.0,0.3)' matching `1.0' to `p'. +real pnorm(real keyword p=2.0 ... real[] v) +{ + return sum(v^p)^(1/p); +} + The overloading resolution in `Asymptote' is similar to the function matching rules used in C++. Every argument match is given a score. Exact matches score better than matches with casting, and matches with @@ -3961,9 +3983,10 @@ of type `T[]'. arrays). `T[] array(int n, T value, int depth=intMax)' - returns an array consisting of `n' deep copies of a 0, 1, or 2 - dimensional array `T value'. If `depth' is specified, this deep - copying recurses to no more than the number of levels specified. + returns an array consisting of `n' copies of `value'. If `value' + is itself an array, a deep copy of `value' is made for each entry. + If `depth' is specified, this deep copying only recurses to the + specified number of levels. `int[] sequence(int n)' if `n >= 1' returns the array `{0,1,...,n-1}' (otherwise returns a @@ -4642,15 +4665,14 @@ File: asymptote.info, Node: LaTeX usage, Next: Base modules, Prev: Programmin *************** `Asymptote' comes with a convenient `LaTeX' style file `asymptote.sty' -(version 1.15 or later) that makes `LaTeX' `Asymptote'-aware. Entering -`Asymptote' code directly into the `LaTeX' source file, at the point -where it is needed, keeps figures organized and avoids the need to -invent new file names for each figure. Simply add the line -`\usepackage{asymptote}' at the beginning of your file and enclose your -`Asymptote' code within a `\begin{asy}...\end{asy}' environment. As -with the `LaTeX' `comment' environment, the `\end{asy}' command must -appear on a line by itself, with no leading spaces or trailing -commands/comments. +that makes `LaTeX' `Asymptote'-aware. Entering `Asymptote' code +directly into the `LaTeX' source file, at the point where it is needed, +keeps figures organized and avoids the need to invent new file names +for each figure. Simply add the line `\usepackage{asymptote}' at the +beginning of your file and enclose your `Asymptote' code within a +`\begin{asy}...\end{asy}' environment. As with the `LaTeX' `comment' +environment, the `\end{asy}' command must appear on a line by itself, +with no trailing commands/comments. The sample `LaTeX' file below, named `latexusage.tex', can be run as follows: @@ -4662,8 +4684,8 @@ or pdflatex latexusage asy latexusage-*.asy pdflatex latexusage - To switch between using `latex' and `pdflatex' you may first need to -remove the files `latexusage-*', `latexusage.pre', and `latexusage.aux'. + To switch between using inline Asymptote code with `latex' and +`pdflatex' you may first need to remove the files `latexusage-*.tex'. An even better method for processing a `LaTeX' file with embedded `Asymptote' code is to use the `latexmk' utility from @@ -4679,17 +4701,21 @@ in a file `latexmkrc' in the same directory. The command latexmk -pdf latexusage will then call `Asymptote' automatically, recompiling only the figures that have changed. Since each figure is compiled in a separate system -process, this method also tends to use less memory. +process, this method also tends to use less memory. External +`Asymptote' code in `filename.asy' should be included with +\asyinclude[<options>]{<filename.asy>} + so that `latexmk' will recognize when the code is changed. Note that +`latemk' requires `perl', available from `http://www.perl.org/'. - One can specify `width', `height', `viewportwidth', + One can specify `width', `height', `keepAspect', `viewportwidth', `viewportheight', `attach', and `inline'. `keyval'-style options to -the `asy' environment. Three-dimensional PRC files may either be -embedded within the page (the default) or attached as annotated (but -printable) attachments, using the `attach' option and the `attachfile2' -(or older `attachfile') `LaTeX' package. The default value of -`viewportwidth' is `\the\linewidth' for inline 3D figures and `0' for -attachments. The `inline' option generates inline `LaTeX' code instead -of EPS or PDF files. This makes 2D LaTeX symbols visible to the +the `asy' and `asyinclude' environments. Three-dimensional PRC files +may either be embedded within the page (the default) or attached as +annotated (but printable) attachments, using the `attach' option and +the `attachfile2' (or older `attachfile') `LaTeX' package. The default +value of `viewportwidth' is `\the\linewidth' for inline 3D figures and +`0' for attachments. The `inline' option generates inline `LaTeX' code +instead of EPS or PDF files. This makes 2D LaTeX symbols visible to the `\begin{asy}...\end{asy}' environment. In this mode, Asymptote correctly aligns 2D LaTeX symbols defined outside of `\begin{asy}...\end{asy}', but treats their size as zero; an optional @@ -4716,14 +4742,14 @@ option, labels might not show up in DVI viewers that cannot handle raw % Use this form with latex or pdflatex to create PDF attachments by default: %\usepackage[attach]{asymptote} -% Enable this line to support PDF hyperlinks: -%\usepackage{hyperref}\hypersetup{setpagesize=false,unicode} - % Enable this line to support the attach option: %\usepackage[dvips]{attachfile2} \begin{document} +% Optional subdirectory for asy files (no spaces): +\def\asydir{} + \begin{asydef} // Global Asymptote definitions can be put here. import three; @@ -4788,8 +4814,8 @@ and height to \LaTeX\ explicitly. This 3D example can be viewed interactively either with Adobe Reader or Asymptote's fast OpenGL-based renderer. To support {\tt latexmk}, 3D figures should specify \verb+inline=true+. It is sometimes desirable to embed 3D files as annotated -attachments; this requires the optional \verb+\usepackage{attachfile2}+ -package and the \verb+attach=true+ option: +attachments; this requires the \verb+attach=true+ option as well as the +\verb+attachfile2+ \LaTeX\ package. \begin{center} \begin{asy}[height=4cm,inline=true,attach=false] currentprojection=orthographic(5,4,2); @@ -6529,12 +6555,15 @@ palette("$f(x,y)$",range,(0,200),(100,250),Top,Palette, -One can also draw an image directly from a two-dimensional pen array: +One can also draw an image directly from a two-dimensional pen array or +a function `pen f(int, int)': void image(picture pic=currentpicture, pen[][] data, pair initial, pair final, bool transpose=(initial.x < final.x && initial.y < final.y), bool copy=true, bool antialias=false); - as illustrated in the following example: +void image(picture pic=currentpicture, pen f(int, int), int width, int height, + pair initial, pair final, bool antialias=false); + as illustrated in the following examples: size(200); @@ -6552,6 +6581,36 @@ image(v,(0,0),(1,1)); +import palette; + +size(200); + +real fracpart(real x) {return (x-floor(x));} + +pair pws(pair z) { + pair w=(z+exp(pi*I/5)/0.9)/(1+z/0.9*exp(-pi*I/5)); + return exp(w)*(w^3-0.5*I); +} + +int N=512; + +pair a=(-1,-1); +pair b=(0.5,0.5); +real dx=(b-a).x/N; +real dy=(b-a).y/N; + +pen f(int u, int v) { + pair z=a+(u*dx,v*dy); + pair w=pws(z); + real phase=degrees(w,warn=false); + real modulus=w == 0 ? 0: fracpart(log(abs(w))); + return hsv(phase,1,sqrt(modulus)); +} + +image(f,N,N,(0,0),(300,300),antialias=true); + + + For convenience, the module `palette' also defines functions that may be used to construct a pen array from a given function and palette: pen[] palette(real[] f, pen[] palette); @@ -7123,6 +7182,12 @@ illustrated in the example `arrows3.asy'. `BeginDotMargin3', `EndDotMargin3', `DotMargin3', `DotMargins3', `Margin3', and `TrueMargin3'. + The routine +void pixel(picture pic=currentpicture, triple v, pen p=currentpen, + real width=1); + can be used to draw on picture `pic' a pixel of width `width' at +position `v' using pen `p'. + Further three-dimensional examples are provided in the files `near_earth.asy', `conicurv.asy', and (in the `animations' subdirectory) `cube.asy'. @@ -7844,89 +7909,89 @@ Usage: ../asy [options] [file ...] Options (negate by replacing - with -no): --V,-View View output; command-line only --a,-align C|B|T|Z Center, Bottom, Top, or Zero page alignment [C] --antialias n Antialiasing width for rasterized output [2] --arcballradius pixels Arcball radius [750] --auto3D Automatically activate 3D scene [true] --autobillboard 3D labels always face viewer by default [true] --autoimport string Module to automatically import --autoplain Enable automatic importing of plain [true] --autoplay Autoplay 3D animations [false] --autorotate Enable automatic PDF page rotation [false] --batchMask Mask fpu exceptions in batch mode [false] --batchView View output in batch mode [false] --bw Convert all colors to black and white [false] --cd directory Set current directory; command-line only --cmyk Convert rgb colors to cmyk [false] --c,-command string Command to autoexecute --compact Conserve memory at the expense of speed [false] --d,-debug Enable debugging messages [false] --divisor n Garbage collect using purge(divisor=n) [2] --doubleclick ms Emulated double-click timeout [200] --embed Embed rendered preview image [true] --exitonEOF Exit interactive mode on EOF [true] --fitscreen Fit rendered image to screen [true] --framedelay ms Additional frame delay [0] --framerate frames/s Animation speed [30] --globalwrite Allow write to other directory [false] --gray Convert all colors to grayscale [false] --h,-help Show summary of options; command-line only --historylines n Retain n lines of history [1000] --iconify Iconify rendering window [false] --inlineimage Generate inline embedded image [false] --inlinetex Generate inline TeX code [false] --interactiveMask Mask fpu exceptions in interactive mode [true] --interactiveView View output in interactive mode [true] --interactiveWrite Write expressions entered at the prompt to stdout [true] --k,-keep Keep intermediate files [false] --keepaux Keep intermediate LaTeX .aux files [false] --level n Postscript level [3] --l,-listvariables List available global functions and variables [false] --localhistory Use a local interactive history file [false] --loop Loop 3D animations [false] --m,-mask Mask fpu exceptions; command-line only --maxtile pair Maximum rendering tile size [(0,0)] --maxviewport pair Maximum viewport size [(2048,2048)] --multiline Input code over multiple lines at the prompt [false] --multipleView View output from multiple batch-mode files [false] --multisample n Multisampling width for screen images [4] --O,-offset pair PostScript offset [(0,0)] --f,-outformat format Convert each output file to specified format --o,-outname name Alternative output directory/filename --p,-parseonly Parse file [false] --pdfreload Automatically reload document in pdfviewer [false] --pdfreloaddelay usec Delay before attempting initial pdf reload [750000] --position pair Initial 3D rendering screen position [(0,0)] --prc Embed 3D PRC graphics in PDF output [true] --prompt string Prompt [> ] --prompt2 string Continuation prompt for multiline input [..] --q,-quiet Suppress welcome message [false] --render n Render 3D graphics using n pixels per bp (-1=auto) [-1] --resizestep step Resize step [1.2] --reverse reverse 3D animations [false] --rgb Convert cmyk colors to rgb [false] --safe Disable system call [true] --scroll n Scroll standard output n lines at a time [0] --spinstep deg/s Spin speed [60] --svgemulation Emulate unimplemented SVG shading [false] --tabcompletion Interactive prompt auto-completion [true] --tex engine latex|pdflatex|xelatex|tex|pdftex|context|none [latex] --thick Render thick 3D lines [true] --thin Render thin 3D lines [true] --threads Use POSIX threads for 3D rendering [true] --toolbar Show 3D toolbar in PDF output [true] --s,-translate Show translated virtual machine code [false] --twice Run LaTeX twice (to resolve references) [false] --twosided Use two-sided 3D lighting model for rendering [true] --u,-user string General purpose user string --v,-verbose Increase verbosity level (can specify multiple times) [0] --version Show version; command-line only --wait Wait for child processes to finish before exiting [false] --warn string Enable warning; command-line only --where Show where listed variables are declared [false] --zoomfactor factor Zoom step factor [1.05] --zoomstep step Mouse motion zoom step [0.1] +-V,-View View output; command-line only +-a,-align C|B|T|Z Center, Bottom, Top, or Zero page alignment [C] +-antialias n Antialiasing width for rasterized output [2] +-arcballradius pixels Arcball radius [750] +-auto3D Automatically activate 3D scene [true] +-autobillboard 3D labels always face viewer by default [true] +-autoimport string Module to automatically import +-autoplain Enable automatic importing of plain [true] +-autoplay Autoplay 3D animations [false] +-autorotate Enable automatic PDF page rotation [false] +-batchMask Mask fpu exceptions in batch mode [false] +-batchView View output in batch mode [false] +-bw Convert all colors to black and white [false] +-cd directory Set current directory; command-line only +-cmyk Convert rgb colors to cmyk [false] +-c,-command string Command to autoexecute +-compact Conserve memory at the expense of speed [false] +-d,-debug Enable debugging messages [false] +-divisor n Garbage collect using purge(divisor=n) [2] +-doubleclick ms Emulated double-click timeout [200] +-embed Embed rendered preview image [true] +-exitonEOF Exit interactive mode on EOF [true] +-fitscreen Fit rendered image to screen [true] +-framedelay ms Additional frame delay [0] +-framerate frames/s Animation speed [30] +-globalwrite Allow write to other directory [false] +-gray Convert all colors to grayscale [false] +-h,-help Show summary of options; command-line only +-historylines n Retain n lines of history [1000] +-iconify Iconify rendering window [false] +-inlineimage Generate inline embedded image [false] +-inlinetex Generate inline TeX code [false] +-interactiveMask Mask fpu exceptions in interactive mode [true] +-interactiveView View output in interactive mode [true] +-interactiveWrite Write expressions entered at the prompt to stdout [true] +-k,-keep Keep intermediate files [false] +-keepaux Keep intermediate LaTeX .aux files [false] +-level n Postscript level [3] +-l,-listvariables List available global functions and variables [false] +-localhistory Use a local interactive history file [false] +-loop Loop 3D animations [false] +-m,-mask Mask fpu exceptions; command-line only +-maxtile pair Maximum rendering tile size [(0,0)] +-maxviewport pair Maximum viewport size [(2048,2048)] +-multiline Input code over multiple lines at the prompt [false] +-multipleView View output from multiple batch-mode files [false] +-multisample n Multisampling width for screen images [4] +-O,-offset pair PostScript offset [(0,0)] +-f,-outformat format Convert each output file to specified format +-o,-outname name Alternative output directory/filename +-p,-parseonly Parse file [false] +-pdfreload Automatically reload document in pdfviewer [false] +-pdfreloaddelay usec Delay before attempting initial pdf reload [750000] +-position pair Initial 3D rendering screen position [(0,0)] +-prc Embed 3D PRC graphics in PDF output [true] +-prompt string Prompt [> ] +-prompt2 string Continuation prompt for multiline input [..] +-q,-quiet Suppress welcome message [false] +-render n Render 3D graphics using n pixels per bp (-1=auto) [-1] +-resizestep step Resize step [1.2] +-reverse reverse 3D animations [false] +-rgb Convert cmyk colors to rgb [false] +-safe Disable system call [true] +-scroll n Scroll standard output n lines at a time [0] +-spinstep deg/s Spin speed [60] +-svgemulation Emulate unimplemented SVG shading [false] +-tabcompletion Interactive prompt auto-completion [true] +-tex engine latex|pdflatex|xelatex|tex|pdftex|context|none [latex] +-thick Render thick 3D lines [true] +-thin Render thin 3D lines [true] +-threads Use POSIX threads for 3D rendering [true] +-toolbar Show 3D toolbar in PDF output [true] +-s,-translate Show translated virtual machine code [false] +-twice Run LaTeX twice (to resolve references) [false] +-twosided Use two-sided 3D lighting model for rendering [true] +-u,-user string General purpose user string +-v,-verbose Increase verbosity level (can specify multiple times) [0] +-version Show version; command-line only +-wait Wait for child processes to finish before exiting [false] +-warn string Enable warning; command-line only +-where Show where listed variables are declared [false] +-zoomfactor factor Zoom step factor [1.05] +-zoomstep step Mouse motion zoom step [0.1] All boolean options can be negated by prepending `no' to the option name. @@ -8397,7 +8462,7 @@ Index (line 14) * -- <1>: Self & prefix operators. (line 6) -* --: Tutorial. (line 125) +* --: Tutorial. (line 127) * ---: Bezier curves. (line 83) * -=: Self & prefix operators. (line 6) @@ -8406,7 +8471,7 @@ Index * -u: Options. (line 183) * -V <1>: Tutorial. (line 19) * -V: Configuring. (line 6) -* ..: Tutorial. (line 125) +* ..: Tutorial. (line 127) * .asy: Search paths. (line 13) * /: Arithmetic & logical. (line 20) @@ -8415,7 +8480,7 @@ Index * 2D graphs: graph. (line 6) * 3D graphs: graph3. (line 6) * 3D grids: grid3. (line 6) -* 3D PostScript: three. (line 570) +* 3D PostScript: three. (line 576) * 3D rendering: Compiling from UNIX source. (line 16) * :: Arithmetic & logical. @@ -8438,7 +8503,7 @@ Index (line 28) * ^=: Self & prefix operators. (line 6) -* ^^: Tutorial. (line 132) +* ^^: Tutorial. (line 134) * a4: Configuring. (line 61) * abort: Data types. (line 322) * abs <1>: Mathematical functions. @@ -8464,18 +8529,18 @@ Index (line 48) * Airy: Mathematical functions. (line 48) -* alias <1>: Arrays. (line 186) +* alias <1>: Arrays. (line 187) * alias: Structures. (line 52) * align: Options. (line 167) * Align: label. (line 12) -* all: Arrays. (line 334) +* all: Arrays. (line 335) * Allow: Pens. (line 327) * AND: Arithmetic & logical. (line 80) * and: Bezier curves. (line 56) * angle: Data types. (line 68) * animate <1>: animation. (line 12) -* animate <2>: Files. (line 150) +* animate <2>: Files. (line 154) * animate: Configuring. (line 67) * animation: animation. (line 6) * annotate: annotate. (line 6) @@ -8505,7 +8570,7 @@ Index * arrow: label. (line 72) * Arrow: draw. (line 26) * arrow: Drawing commands. (line 31) -* arrow keys: Tutorial. (line 35) +* arrow keys: Tutorial. (line 37) * Arrow3: three. (line 543) * Arrows: draw. (line 26) * arrows: draw. (line 26) @@ -8523,6 +8588,7 @@ Index * asy: Import. (line 102) * asy-mode: Editing modes. (line 6) * asy.vim: Editing modes. (line 33) +* asyinclude: LaTeX usage. (line 44) * asymptote.sty: LaTeX usage. (line 6) * asymptote.xml: Editing modes. (line 49) * ASYMPTOTE_CONFIG: Options. (line 114) @@ -8536,7 +8602,7 @@ Index (line 6) * atleast: Bezier curves. (line 56) * attach <1>: graph. (line 415) -* attach: LaTeX usage. (line 46) +* attach: LaTeX usage. (line 49) * autoadjust: three. (line 354) * autoimport: Options. (line 110) * automatic scaling: graph. (line 682) @@ -8582,11 +8648,11 @@ Index * Bi_deriv: Mathematical functions. (line 48) * Billboard: three. (line 472) -* binary format: Files. (line 70) +* binary format: Files. (line 74) * binary operators: Arithmetic & logical. (line 6) * binarytree: binarytree. (line 6) -* binput: Files. (line 70) +* binput: Files. (line 74) * black stripes: three. (line 210) * Blank: draw. (line 26) * block.bottom: flowchart. (line 19) @@ -8609,10 +8675,10 @@ Index * BottomView: three. (line 381) * bounding box: Frames and pictures. (line 168) * Bounds: graph3. (line 20) -* boutput: Files. (line 70) +* boutput: Files. (line 74) * box <1>: three. (line 305) * box: Frames and pictures. (line 22) -* bp: Tutorial. (line 24) +* bp: Tutorial. (line 26) * break: Programming. (line 29) * breakpoints: Debugger. (line 21) * brick: Pens. (line 251) @@ -8648,11 +8714,11 @@ Index * CJK: unicode. (line 12) * clamped: graph. (line 37) * clear <1>: Debugger. (line 23) -* clear: Files. (line 88) +* clear: Files. (line 92) * clip: fill. (line 111) * CLZ: Arithmetic & logical. (line 80) -* cm: Tutorial. (line 61) +* cm: Tutorial. (line 63) * cmd: Configuring. (line 34) * cmyk: Pens. (line 34) * colatitude: Data types. (line 129) @@ -8662,16 +8728,16 @@ Index * coloredSegments: tube. (line 25) * colorless: Pens. (line 54) * colors: Pens. (line 51) -* comma: Files. (line 58) -* comma-separated-value mode: Arrays. (line 367) +* comma: Files. (line 60) +* comma-separated-value mode: Arrays. (line 368) * command-line options <1>: Options. (line 6) * command-line options: Configuring. (line 83) * comment character: Files. (line 15) -* compass directions: Tutorial. (line 104) +* compass directions: Tutorial. (line 106) * Compiling from UNIX source: Compiling from UNIX source. (line 6) -* complement: Arrays. (line 149) -* concat: Arrays. (line 182) +* complement: Arrays. (line 150) +* concat: Arrays. (line 183) * conditional <1>: Arithmetic & logical. (line 73) * conditional: Programming. (line 8) @@ -8691,11 +8757,11 @@ Index * controlSpecifier: Paths and guides. (line 379) * convert <1>: Options. (line 142) * convert <2>: animation. (line 6) -* convert <3>: Files. (line 150) +* convert <3>: Files. (line 154) * convert: Configuring. (line 67) * convertOptions: Options. (line 129) * Coons shading: fill. (line 74) -* copy: Arrays. (line 173) +* copy: Arrays. (line 174) * Cos: Mathematical functions. (line 20) * cos: Mathematical functions. @@ -8709,10 +8775,10 @@ Index * cross: Data types. (line 167) * crossframe: markers. (line 23) * crosshatch: Pens. (line 267) -* csv: Arrays. (line 367) +* csv: Arrays. (line 368) * CTZ: Arithmetic & logical. (line 80) -* cubicroots: Arrays. (line 323) +* cubicroots: Arrays. (line 324) * curl <1>: three. (line 6) * curl: Bezier curves. (line 63) * curlSpecifier: Paths and guides. (line 391) @@ -8724,7 +8790,7 @@ Index * custom tick locations: graph. (line 249) * cut: Paths and guides. (line 237) * cycle <1>: three. (line 6) -* cycle: Tutorial. (line 73) +* cycle: Tutorial. (line 75) * cyclic <1>: three. (line 502) * cyclic <2>: Arrays. (line 39) * cyclic: Paths and guides. (line 74) @@ -8751,11 +8817,11 @@ Index (line 17) * degrees: Data types. (line 73) * delete <1>: Arrays. (line 39) -* delete: Files. (line 145) +* delete: Files. (line 149) * description: Description. (line 6) -* diagonal: Arrays. (line 308) +* diagonal: Arrays. (line 309) * diamond: flowchart. (line 57) -* dimension: Arrays. (line 372) +* dimension: Arrays. (line 373) * dir <1>: three. (line 502) * dir <2>: Paths and guides. (line 98) * dir <3>: Data types. (line 85) @@ -8766,7 +8832,9 @@ Index * dirtime: Paths and guides. (line 152) * display: Configuring. (line 67) * do: Programming. (line 29) -* dot <1>: Arrays. (line 264) +* DOSendl: Files. (line 60) +* DOSnewl: Files. (line 60) +* dot <1>: Arrays. (line 265) * dot <2>: Data types. (line 98) * dot: draw. (line 83) * DotMargin: draw. (line 42) @@ -8775,7 +8843,7 @@ Index * DotMargins3: three. (line 559) * dotted: Pens. (line 95) * double deferred drawing: three. (line 256) -* double precision: Files. (line 70) +* double precision: Files. (line 74) * Draw: Frames and pictures. (line 147) * draw: draw. (line 110) * Draw: draw. (line 26) @@ -8788,7 +8856,7 @@ Index * dvisvgm: Configuring. (line 67) * E <1>: Mathematical functions. (line 48) -* E: Tutorial. (line 104) +* E: Tutorial. (line 106) * Editing modes: Editing modes. (line 6) * Ei: Mathematical functions. (line 48) @@ -8809,7 +8877,7 @@ Index * EndBar3: three. (line 543) * EndDotMargin: draw. (line 42) * EndDotMargin3: three. (line 559) -* endl: Files. (line 58) +* endl: Files. (line 60) * EndMargin: draw. (line 42) * EndMargin3: three. (line 559) * EndPenMargin: draw. (line 42) @@ -8818,15 +8886,15 @@ Index * EndPoint: label. (line 57) * envelope: Frames and pictures. (line 22) * environment variables: Configuring. (line 87) -* eof <1>: Arrays. (line 349) -* eof: Files. (line 88) -* eol <1>: Arrays. (line 349) -* eol: Files. (line 88) +* eof <1>: Arrays. (line 350) +* eof: Files. (line 92) +* eol <1>: Arrays. (line 350) +* eol: Files. (line 92) * EPS <1>: Options. (line 142) * EPS: label. (line 80) * erase <1>: Frames and pictures. (line 7) * erase <2>: Data types. (line 239) -* erase: Tutorial. (line 35) +* erase: Tutorial. (line 37) * erf: Mathematical functions. (line 6) * erfc: Mathematical functions. @@ -8836,7 +8904,7 @@ Index * errorbars: graph. (line 484) * eval: Import. (line 98) * evenodd <1>: Pens. (line 152) -* evenodd: Tutorial. (line 146) +* evenodd: Tutorial. (line 148) * exit <1>: Debugger. (line 57) * exit <2>: Interactive mode. (line 59) * exit: Data types. (line 331) @@ -8858,14 +8926,14 @@ Index (line 48) * fabs: Mathematical functions. (line 6) -* face: three. (line 578) +* face: three. (line 584) * factorial: Mathematical functions. (line 39) * Fedora: UNIX binary distributions. (line 15) * feynman: feynman. (line 6) * fft <1>: math. (line 26) -* fft: Arrays. (line 251) +* fft: Arrays. (line 252) * FFTW: Compiling from UNIX source. (line 58) * file <1>: Debugger. (line 45) @@ -8879,7 +8947,7 @@ Index * FillDraw: draw. (line 26) * filloutside: fill. (line 27) * fillrule: Pens. (line 152) -* find <1>: Arrays. (line 158) +* find <1>: Arrays. (line 159) * find: Data types. (line 224) * firstcut: Paths and guides. (line 247) * fit: Frames and pictures. (line 103) @@ -8888,7 +8956,7 @@ Index * floor: Mathematical functions. (line 26) * flowchart: flowchart. (line 6) -* flush: Files. (line 58) +* flush: Files. (line 60) * fmod: Mathematical functions. (line 6) * font: Pens. (line 192) @@ -8917,10 +8985,10 @@ Index (line 39) * geometry: geometry. (line 6) * getc: Files. (line 29) -* getpair: Files. (line 113) -* getreal: Files. (line 113) -* getstring: Files. (line 113) -* gettriple: Files. (line 113) +* getpair: Files. (line 117) +* getreal: Files. (line 117) +* getstring: Files. (line 117) +* gettriple: Files. (line 117) * glOptions <1>: Options. (line 129) * glOptions: three. (line 210) * GNU Scientific Library: Mathematical functions. @@ -8950,7 +9018,7 @@ Index * guide: Paths and guides. (line 300) * guide3: three. (line 6) * hatch: Pens. (line 267) -* height: LaTeX usage. (line 46) +* height: LaTeX usage. (line 49) * help <1>: Debugger. (line 30) * help <2>: Help. (line 6) * help: Interactive mode. (line 44) @@ -8960,11 +9028,11 @@ Index * hex: Data types. (line 280) * hexidecimal <1>: Pens. (line 59) * hexidecimal: Data types. (line 280) -* hidden surface removal: three. (line 578) +* hidden surface removal: three. (line 584) * histogram: Mathematical functions. (line 39) * history <1>: Interactive mode. (line 59) -* history: Files. (line 138) +* history: Files. (line 142) * historylines: Interactive mode. (line 64) * HookHead: draw. (line 26) * HookHead3: three. (line 543) @@ -8977,7 +9045,7 @@ Index * i_scaled: Mathematical functions. (line 48) * iconic: three. (line 210) -* identity <1>: Arrays. (line 305) +* identity <1>: Arrays. (line 306) * identity <2>: Mathematical functions. (line 6) * identity: Transforms. (line 24) @@ -8993,14 +9061,14 @@ Index * implicit linear solver: MetaPost. (line 10) * implicit scaling: Implicit scaling. (line 6) * import: Import. (line 46) -* inches: Tutorial. (line 61) +* inches: Tutorial. (line 63) * including images: label. (line 80) * increasing: math. (line 59) * inheritance: Structures. (line 181) * initialized: Arrays. (line 39) * initializers: Variable initializers. (line 6) -* inline: LaTeX usage. (line 46) +* inline: LaTeX usage. (line 49) * InOutTicks: graph3. (line 34) * input <1>: Interactive mode. (line 48) * input: Files. (line 11) @@ -9031,7 +9099,7 @@ Index * InTicks: graph3. (line 34) * intMax: Data types. (line 28) * intMin: Data types. (line 28) -* inverse <1>: Arrays. (line 311) +* inverse <1>: Arrays. (line 312) * inverse: Transforms. (line 16) * invert: three. (line 422) * invisible: Pens. (line 39) @@ -9044,8 +9112,12 @@ Index (line 48) * Kate: Editing modes. (line 49) * KDE editor: Editing modes. (line 49) +* keepAspect <1>: LaTeX usage. (line 49) +* keepAspect: Frames and pictures. (line 54) * keyboard bindings:: three. (line 169) * keys: Arrays. (line 39) +* keyword: Named arguments. (line 37) +* keyword-only: Named arguments. (line 37) * keywords: Named arguments. (line 6) * Korean: unicode. (line 12) * label: three. (line 466) @@ -9063,7 +9135,7 @@ Index * latex: Options. (line 142) * LaTeX fonts: Pens. (line 192) * LaTeX usage: LaTeX usage. (line 6) -* latexmk: LaTeX usage. (line 30) +* latexmk: LaTeX usage. (line 29) * latin1: latin1. (line 6) * latitude: Data types. (line 134) * latticeshade: fill. (line 32) @@ -9091,8 +9163,8 @@ Index * libsigsegv <1>: Help. (line 33) * libsigsegv: Functions. (line 88) * limits: graph. (line 636) -* line: Arrays. (line 349) -* line mode: Arrays. (line 349) +* line: Arrays. (line 350) +* line mode: Arrays. (line 350) * Linear: graph. (line 682) * linecap: Pens. (line 129) * linejoin: Pens. (line 138) @@ -9119,7 +9191,7 @@ Index * MacOS X binary distributions: MacOS X binary distributions. (line 6) * makepen: Pens. (line 300) -* map: Arrays. (line 140) +* map: Arrays. (line 141) * Margin: draw. (line 42) * Margin3: three. (line 559) * margins: three. (line 262) @@ -9135,7 +9207,7 @@ Index * mathematical functions: Mathematical functions. (line 6) * max <1>: three. (line 502) -* max <2>: Arrays. (line 230) +* max <2>: Arrays. (line 231) * max <3>: Frames and pictures. (line 7) * max: Paths and guides. (line 264) * maxbound: Data types. (line 104) @@ -9156,7 +9228,7 @@ Index * midpoint: Paths and guides. (line 166) * MidPoint: label. (line 57) * min <1>: three. (line 502) -* min <2>: Arrays. (line 223) +* min <2>: Arrays. (line 224) * min <3>: Frames and pictures. (line 7) * min: Paths and guides. (line 260) * minbound: Data types. (line 101) @@ -9164,8 +9236,9 @@ Index * mintimes: Paths and guides. (line 214) * miterjoin: Pens. (line 138) * miterlimit: Pens. (line 147) -* mm: Tutorial. (line 61) -* mode: Files. (line 84) +* mktemp: Files. (line 43) +* mm: Tutorial. (line 63) +* mode: Files. (line 88) * monotonic: graph. (line 37) * mouse: GUI. (line 6) * mouse bindings: three. (line 137) @@ -9174,14 +9247,14 @@ Index * multisample: three. (line 127) * multisampling: Compiling from UNIX source. (line 16) -* N: Tutorial. (line 104) -* name: Files. (line 84) +* N: Tutorial. (line 106) +* name: Files. (line 88) * named arguments: Named arguments. (line 6) * natural: graph. (line 37) * new <1>: Arrays. (line 109) * new: Structures. (line 6) * newframe: Frames and pictures. (line 7) -* newl: Files. (line 58) +* newl: Files. (line 60) * newton: Mathematical functions. (line 65) * next: Debugger. (line 42) @@ -9191,7 +9264,7 @@ Index * NoFill: draw. (line 26) * NoMargin: draw. (line 42) * NoMargin3: three. (line 559) -* none: Files. (line 58) +* none: Files. (line 60) * None: draw. (line 19) * normal: three. (line 488) * nosafe: Options. (line 162) @@ -9247,8 +9320,8 @@ Index * pack: label. (line 102) * packing: Rest arguments. (line 30) * pair <1>: Data types. (line 41) -* pair: Tutorial. (line 49) -* pairs: Arrays. (line 247) +* pair: Tutorial. (line 51) +* pairs: Arrays. (line 248) * paperheight: Configuring. (line 61) * papertype: Configuring. (line 61) * paperwidth: Configuring. (line 61) @@ -9262,7 +9335,7 @@ Index * path: Paths and guides. (line 7) * path markers: graph. (line 484) * path3: three. (line 6) -* path[]: Tutorial. (line 132) +* path[]: Tutorial. (line 134) * patterns <1>: patterns. (line 6) * patterns: Pens. (line 238) * PDF: Options. (line 142) @@ -9277,11 +9350,13 @@ Index * PenMargins2: three. (line 559) * PenMargins3: three. (line 559) * periodic: graph. (line 37) +* perl: LaTeX usage. (line 29) * perpendicular: geometry. (line 6) * perspective: three. (line 358) * picture: Frames and pictures. (line 35) * picture alignment: Frames and pictures. (line 209) * piecewisestraight: Paths and guides. (line 81) +* pixel: three. (line 566) * Pl: Mathematical functions. (line 48) * plain: plain. (line 6) @@ -9301,11 +9376,11 @@ Index (line 19) * postscript: Frames and pictures. (line 271) * PostScript fonts: Pens. (line 210) -* PostScript subpath: Tutorial. (line 132) +* PostScript subpath: Tutorial. (line 134) * pow10: Mathematical functions. (line 6) * prc: three. (line 231) -* precision: Files. (line 88) +* precision: Files. (line 92) * precontrol <1>: three. (line 502) * precontrol: Paths and guides. (line 128) * prefix operators: Self & prefix operators. @@ -9317,15 +9392,15 @@ Index * psview: Microsoft Windows. (line 16) * psviewer: Configuring. (line 6) * psviewerOptions: Options. (line 129) -* pt: Tutorial. (line 61) +* pt: Tutorial. (line 63) * public: Structures. (line 6) * push: Arrays. (line 39) * Python usage: Interactive mode. (line 80) -* quadraticroots: Arrays. (line 314) +* quadraticroots: Arrays. (line 315) * quarticroots: math. (line 22) * quit <1>: Debugger. (line 54) * quit <2>: Interactive mode. (line 59) -* quit: Tutorial. (line 35) +* quit: Tutorial. (line 37) * quote: Import. (line 116) * quotient: Arithmetic & logical. (line 6) @@ -9341,10 +9416,10 @@ Index (line 39) * randMax: Mathematical functions. (line 39) -* read: Arrays. (line 390) +* read: Arrays. (line 391) * reading: Files. (line 11) -* reading string arrays: Arrays. (line 359) -* readline: Files. (line 130) +* reading string arrays: Arrays. (line 360) +* readline: Files. (line 134) * real: Data types. (line 33) * realDigits: Data types. (line 33) * realEpsilon: Data types. (line 33) @@ -9359,7 +9434,7 @@ Index * reltime: Paths and guides. (line 158) * remainder: Mathematical functions. (line 6) -* rename: Files. (line 147) +* rename: Files. (line 151) * render <1>: Options. (line 142) * render: three. (line 47) * replace: Data types. (line 252) @@ -9369,10 +9444,10 @@ Index * restricted: Structures. (line 6) * return: Debugger. (line 48) * reverse <1>: three. (line 502) -* reverse <2>: Arrays. (line 145) +* reverse <2>: Arrays. (line 146) * reverse <3>: Paths and guides. (line 169) * reverse: Data types. (line 248) -* rewind: Files. (line 88) +* rewind: Files. (line 92) * rfind: Data types. (line 229) * rgb: Pens. (line 30) * Riemann zeta function: Mathematical functions. @@ -9394,10 +9469,10 @@ Index (line 6) * runtime imports: Import. (line 98) * Russian: unicode. (line 7) -* S: Tutorial. (line 104) +* S: Tutorial. (line 106) * safe: Options. (line 162) * save: Frames and pictures. (line 262) -* saveline: Files. (line 130) +* saveline: Files. (line 134) * scale: three. (line 452) * Scale: graph. (line 698) * scale <1>: graph. (line 682) @@ -9407,21 +9482,21 @@ Index * scale3: three. (line 449) * scaled graph: graph. (line 663) * scientific graph: graph. (line 396) -* scroll: Files. (line 104) -* search: Arrays. (line 163) +* scroll: Files. (line 108) +* search: Arrays. (line 164) * search paths: Search paths. (line 6) * Seascape: Frames and pictures. (line 100) * secondary axis: graph. (line 813) * secondaryX: graph. (line 813) * secondaryY: graph. (line 813) * seconds: Data types. (line 300) -* seek: Files. (line 88) -* seekeof: Files. (line 88) +* seek: Files. (line 92) +* seekeof: Files. (line 92) * segment: math. (line 50) * segmentation fault: Help. (line 33) * self operators: Self & prefix operators. (line 6) -* sequence: Arrays. (line 127) +* sequence: Arrays. (line 128) * settings <1>: Options. (line 114) * settings: Configuring. (line 23) * sgn: Mathematical functions. @@ -9435,7 +9510,7 @@ Index * showtarget: three. (line 338) * Si: Mathematical functions. (line 48) -* signedint: Files. (line 70) +* signedint: Files. (line 74) * SimpleHead: draw. (line 26) * simplex: simplex. (line 6) * simpson: Mathematical functions. @@ -9444,9 +9519,9 @@ Index (line 20) * sin: Mathematical functions. (line 6) -* single precision: Files. (line 70) -* singleint: Files. (line 70) -* singlereal: Files. (line 70) +* single precision: Files. (line 74) +* singleint: Files. (line 74) +* singlereal: Files. (line 74) * sinh: Mathematical functions. (line 6) * SixViews: three. (line 396) @@ -9467,8 +9542,8 @@ Index * slopefield: slopefield. (line 6) * solid: Pens. (line 95) * solids: solids. (line 9) -* solve: Arrays. (line 283) -* sort: Arrays. (line 189) +* solve: Arrays. (line 284) +* sort: Arrays. (line 190) * Spline <1>: graph3. (line 100) * Spline: graph. (line 34) * split: Data types. (line 261) @@ -9481,8 +9556,8 @@ Index * stack overflow: Functions. (line 88) * static: Static. (line 6) * stats: stats. (line 6) -* stdin: Files. (line 45) -* stdout: Files. (line 45) +* stdin: Files. (line 47) +* stdout: Files. (line 47) * step: Debugger. (line 39) * stickframe: markers. (line 16) * stop: Debugger. (line 10) @@ -9501,8 +9576,8 @@ Index * subpictures: Frames and pictures. (line 103) * substr: Data types. (line 244) * Subversion: Subversion. (line 6) -* sum: Arrays. (line 218) -* superpath: Tutorial. (line 132) +* sum: Arrays. (line 219) +* superpath: Tutorial. (line 134) * Suppress: Pens. (line 331) * SuppressQuiet: Pens. (line 335) * surface <1>: graph3. (line 100) @@ -9510,10 +9585,10 @@ Index * SVG: Options. (line 142) * SVN: Subversion. (line 6) * system <1>: Options. (line 162) -* system: Files. (line 155) +* system: Files. (line 159) * syzygy: syzygy. (line 6) -* tab: Files. (line 58) -* tab completion: Tutorial. (line 35) +* tab: Files. (line 60) +* tab completion: Tutorial. (line 37) * Tan: Mathematical functions. (line 20) * tan: Mathematical functions. @@ -9521,7 +9596,7 @@ Index * tanh: Mathematical functions. (line 6) * target: three. (line 338) -* tell: Files. (line 88) +* tell: Files. (line 92) * tension <1>: three. (line 6) * tension: Bezier curves. (line 56) * tensionSpecifier: Paths and guides. (line 385) @@ -9565,12 +9640,12 @@ Index * transform: Transforms. (line 6) * transform3: three. (line 432) * transparency: Pens. (line 222) -* transpose: Arrays. (line 210) +* transpose: Arrays. (line 211) * tree: tree. (line 9) * trembling: trembling. (line 6) * triangle: geometry. (line 6) * triangulate: contour. (line 157) -* tridiagonal: Arrays. (line 271) +* tridiagonal: Arrays. (line 272) * trigonometric integrals: Mathematical functions. (line 48) * triple: Data types. (line 108) @@ -9588,18 +9663,18 @@ Index * unfill: fill. (line 106) * UnFill: draw. (line 26) * unicode: unicode. (line 6) -* uniform: Arrays. (line 154) +* uniform: Arrays. (line 155) * Uninstall: Uninstall. (line 6) * unique: math. (line 64) * unit: Data types. (line 78) * unitbox <1>: three. (line 307) -* unitbox: Tutorial. (line 153) +* unitbox: Tutorial. (line 155) * unitcircle <1>: three. (line 274) -* unitcircle: Tutorial. (line 126) +* unitcircle: Tutorial. (line 128) * unitrand: Mathematical functions. (line 39) * unitsize <1>: Frames and pictures. (line 64) -* unitsize: Tutorial. (line 84) +* unitsize: Tutorial. (line 86) * UNIX binary distributions: UNIX binary distributions. (line 6) * unpacking: Rest arguments. (line 39) @@ -9608,7 +9683,7 @@ Index * update: Files. (line 35) * UpsideDown: Frames and pictures. (line 95) * usepackage: Frames and pictures. (line 291) -* user coordinates: Tutorial. (line 84) +* user coordinates: Tutorial. (line 86) * user-defined operators: User-defined operators. (line 6) * usleep: Data types. (line 337) @@ -9619,29 +9694,29 @@ Index (line 6) * vectorfield: graph. (line 975) * vectorfield3: graph3. (line 159) -* vectorization: Arrays. (line 328) +* vectorization: Arrays. (line 329) * verbatim: Frames and pictures. (line 271) * vertex-dependent colors: three. (line 81) * Vertical: flowchart. (line 81) -* viewportheight: LaTeX usage. (line 46) +* viewportheight: LaTeX usage. (line 49) * viewportmargin: three. (line 262) * viewportsize: three. (line 262) -* viewportwidth: LaTeX usage. (line 46) +* viewportwidth: LaTeX usage. (line 49) * views: three. (line 231) * vim: Editing modes. (line 33) * virtual functions: Structures. (line 181) * void: Data types. (line 10) -* W: Tutorial. (line 104) +* W: Tutorial. (line 106) * whatever: Paths and guides. (line 232) * Wheel: palette. (line 22) * wheel mouse: GUI. (line 6) * while: Programming. (line 29) -* white-space string delimiter mode: Arrays. (line 359) -* width: LaTeX usage. (line 46) +* white-space string delimiter mode: Arrays. (line 360) +* width: LaTeX usage. (line 49) * windingnumber: Paths and guides. (line 268) -* word: Arrays. (line 359) -* write <1>: Arrays. (line 399) -* write: Files. (line 50) +* word: Arrays. (line 360) +* write <1>: Arrays. (line 400) +* write: Files. (line 52) * X: three. (line 274) * xasy: GUI. (line 6) * xaxis3: graph3. (line 7) @@ -9649,11 +9724,11 @@ Index * xelatex: embed. (line 10) * xequals: graph. (line 294) * XEquals: graph. (line 280) -* xinput: Files. (line 70) +* xinput: Files. (line 74) * xlimits: graph. (line 636) * XOR: Arithmetic & logical. (line 80) -* xoutput: Files. (line 70) +* xoutput: Files. (line 74) * xpart: Data types. (line 89) * xscale: Transforms. (line 33) * xscale3: three. (line 440) @@ -9714,139 +9789,140 @@ Node: UNIX binary distributions11388 Node: MacOS X binary distributions12494 Node: Microsoft Windows13378 Ref: psview14088 -Node: Configuring15009 -Node: Search paths19230 -Node: Compiling from UNIX source20027 -Ref: multisampling20616 -Node: Editing modes23022 -Node: Subversion25454 -Node: Uninstall25917 -Node: Tutorial26267 -Ref: unitcircle30493 -Node: Drawing commands32429 -Node: draw34140 -Ref: arrows35288 -Node: fill40531 -Ref: gradient shading41575 -Node: clip45803 -Node: label46395 -Ref: Label47094 -Node: Bezier curves52819 -Node: Programming56396 -Ref: array iteration57210 -Node: Data types58291 -Ref: format67299 -Node: Paths and guides70902 -Ref: circle71156 -Ref: arctime76644 -Ref: extension80499 -Node: Pens87182 -Ref: fillrule94548 -Ref: basealign95445 -Ref: transparency98271 -Ref: makepen101714 -Ref: overwrite102552 -Node: Transforms103762 -Node: Frames and pictures105553 -Ref: envelope106694 -Ref: size107777 -Ref: unitsize108764 -Ref: shipout109824 -Ref: filltype112157 -Ref: add115294 -Ref: add about116240 -Ref: tex119178 -Node: Files120052 -Ref: cd121017 -Ref: scroll125449 -Node: Variable initializers128522 -Node: Structures131247 -Node: Operators138691 -Node: Arithmetic & logical139005 -Node: Self & prefix operators140979 -Node: User-defined operators141767 -Node: Implicit scaling142678 -Node: Functions143241 -Ref: stack overflow145994 -Node: Default arguments146558 -Node: Named arguments147297 -Node: Rest arguments149459 -Node: Mathematical functions152269 -Node: Arrays156876 -Ref: sort163926 -Ref: tridiagonal166330 -Ref: solve167558 -Node: Slices171751 -Node: Casts175641 -Node: Import177606 -Node: Static182833 -Node: LaTeX usage185727 -Node: Base modules191768 -Node: plain194268 -Node: simplex194920 -Node: math195193 -Node: interpolate197898 -Node: geometry198177 -Node: trembling198771 -Node: stats199122 -Node: patterns199382 -Node: markers199618 -Node: tree201401 -Node: binarytree201589 -Node: drawtree202178 -Node: syzygy202382 -Node: feynman202656 -Node: roundedpath202931 -Node: animation203214 -Ref: animate203631 -Node: embed204770 -Node: slide206373 -Node: MetaPost206713 -Node: unicode207429 -Node: latin1208317 -Node: babel208685 -Node: labelpath208914 -Node: labelpath3209734 -Node: annotate210045 -Node: CAD210516 -Node: graph210826 -Ref: ticks217955 -Ref: pathmarkers231234 -Ref: marker231699 -Ref: markuniform232050 -Ref: errorbars233841 -Ref: automatic scaling237897 -Node: palette248543 -Ref: images248661 -Ref: image252832 -Ref: logimage253310 -Ref: penimage254116 -Node: three254560 -Ref: PostScript3D279102 -Node: obj280794 -Node: graph3281046 -Ref: GaussianSurface286171 -Node: grid3287275 -Node: solids288015 -Node: tube288963 -Node: flowchart291198 -Node: contour295767 -Node: contour3300892 -Node: slopefield301199 -Node: ode302636 -Node: Options302896 -Ref: configuration file308741 -Ref: settings308741 -Ref: convert309942 -Node: Interactive mode312909 -Ref: history315062 -Node: GUI316367 -Node: GUI installation316870 -Node: GUI usage318000 -Node: PostScript to Asymptote318903 -Node: Help319659 -Node: Debugger321395 -Node: Credits323180 -Node: Index324112 +Node: Configuring15020 +Node: Search paths19234 +Node: Compiling from UNIX source20031 +Ref: multisampling20620 +Node: Editing modes23026 +Node: Subversion25458 +Node: Uninstall25921 +Node: Tutorial26271 +Ref: unitcircle30569 +Node: Drawing commands32505 +Node: draw34216 +Ref: arrows35364 +Node: fill40607 +Ref: gradient shading41651 +Node: clip45879 +Node: label46471 +Ref: Label47170 +Node: Bezier curves52895 +Node: Programming56472 +Ref: array iteration57286 +Node: Data types58367 +Ref: format67375 +Node: Paths and guides70978 +Ref: circle71232 +Ref: arctime76720 +Ref: extension80575 +Node: Pens87258 +Ref: fillrule94624 +Ref: basealign95521 +Ref: transparency98347 +Ref: makepen101790 +Ref: overwrite102628 +Node: Transforms103838 +Node: Frames and pictures105629 +Ref: envelope106770 +Ref: size107853 +Ref: unitsize108840 +Ref: shipout109900 +Ref: filltype112233 +Ref: add115370 +Ref: add about116316 +Ref: tex119254 +Node: Files120128 +Ref: cd121093 +Ref: scroll125778 +Node: Variable initializers128851 +Node: Structures131576 +Node: Operators139020 +Node: Arithmetic & logical139334 +Node: Self & prefix operators141308 +Node: User-defined operators142096 +Node: Implicit scaling143007 +Node: Functions143570 +Ref: stack overflow146323 +Node: Default arguments146887 +Node: Named arguments147626 +Node: Rest arguments150197 +Node: Mathematical functions153318 +Node: Arrays157925 +Ref: sort165013 +Ref: tridiagonal167417 +Ref: solve168645 +Node: Slices172838 +Node: Casts176728 +Node: Import178693 +Node: Static183920 +Node: LaTeX usage186814 +Node: Base modules193031 +Node: plain195531 +Node: simplex196183 +Node: math196456 +Node: interpolate199161 +Node: geometry199440 +Node: trembling200034 +Node: stats200385 +Node: patterns200645 +Node: markers200881 +Node: tree202664 +Node: binarytree202852 +Node: drawtree203441 +Node: syzygy203645 +Node: feynman203919 +Node: roundedpath204194 +Node: animation204477 +Ref: animate204894 +Node: embed206033 +Node: slide207636 +Node: MetaPost207976 +Node: unicode208692 +Node: latin1209580 +Node: babel209948 +Node: labelpath210177 +Node: labelpath3210997 +Node: annotate211308 +Node: CAD211779 +Node: graph212089 +Ref: ticks219218 +Ref: pathmarkers232497 +Ref: marker232962 +Ref: markuniform233313 +Ref: errorbars235104 +Ref: automatic scaling239160 +Node: palette249806 +Ref: images249924 +Ref: image254095 +Ref: logimage254573 +Ref: penimage255551 +Ref: penfunctionimage255772 +Node: three256496 +Ref: PostScript3D281241 +Node: obj282933 +Node: graph3283185 +Ref: GaussianSurface288310 +Node: grid3289414 +Node: solids290154 +Node: tube291102 +Node: flowchart293337 +Node: contour297906 +Node: contour3303031 +Node: slopefield303338 +Node: ode304775 +Node: Options305035 +Ref: configuration file310963 +Ref: settings310963 +Ref: convert312164 +Node: Interactive mode315131 +Ref: history317284 +Node: GUI318589 +Node: GUI installation319092 +Node: GUI usage320222 +Node: PostScript to Asymptote321125 +Node: Help321881 +Node: Debugger323617 +Node: Credits325402 +Node: Index326334 End Tag Table diff --git a/Build/source/utils/asymptote/doc/square.asy b/Build/source/utils/asymptote/doc/square.asy index 1bff4e438f5..6fd9d2314d7 100644 --- a/Build/source/utils/asymptote/doc/square.asy +++ b/Build/source/utils/asymptote/doc/square.asy @@ -1,2 +1,2 @@ -size(100,100); +size(3cm); draw((0,0)--(1,0)--(1,1)--(0,1)--cycle); |