texlive[71432] Master: asy-overview (4jun24)
commits+karl at tug.org
commits+karl at tug.org
Tue Jun 4 21:57:34 CEST 2024
Revision: 71432
https://tug.org/svn/texlive?view=revision&revision=71432
Author: karl
Date: 2024-06-04 21:57:34 +0200 (Tue, 04 Jun 2024)
Log Message:
-----------
asy-overview (4jun24)
Modified Paths:
--------------
trunk/Master/tlpkg/bin/tlpkg-ctan-check
trunk/Master/tlpkg/tlpsrc/collection-langenglish.tlpsrc
Added Paths:
-----------
trunk/Master/texmf-dist/doc/latex/asy-overview/
trunk/Master/texmf-dist/doc/latex/asy-overview/README
trunk/Master/texmf-dist/doc/latex/asy-overview/asy/
trunk/Master/texmf-dist/doc/latex/asy-overview/asy/jh.asy
trunk/Master/texmf-dist/doc/latex/asy-overview/asy_overview.pdf
trunk/Master/texmf-dist/doc/latex/asy-overview/asy_sty/
trunk/Master/texmf-dist/doc/latex/asy-overview/asy_sty/asy_tut.sty
trunk/Master/texmf-dist/doc/latex/asy-overview/asy_sty/colors.sty
trunk/Master/texmf-dist/doc/latex/asy-overview/src/
trunk/Master/texmf-dist/doc/latex/asy-overview/src/Makefile
trunk/Master/texmf-dist/doc/latex/asy-overview/src/appendix/
trunk/Master/texmf-dist/doc/latex/asy-overview/src/appendix/appendix.tex
trunk/Master/texmf-dist/doc/latex/asy-overview/src/asy_tut.tex
trunk/Master/texmf-dist/doc/latex/asy-overview/src/chapter1/
trunk/Master/texmf-dist/doc/latex/asy-overview/src/chapter1/asy/
trunk/Master/texmf-dist/doc/latex/asy-overview/src/chapter1/asy/unit_circle.asy
trunk/Master/texmf-dist/doc/latex/asy-overview/src/chapter1/asy/unit_circle_after.asy
trunk/Master/texmf-dist/doc/latex/asy-overview/src/chapter1/chapter1.tex
trunk/Master/texmf-dist/doc/latex/asy-overview/src/chapter1/main.tex
trunk/Master/texmf-dist/doc/latex/asy-overview/src/chapter2/
trunk/Master/texmf-dist/doc/latex/asy-overview/src/chapter2/asy/
trunk/Master/texmf-dist/doc/latex/asy-overview/src/chapter2/asy/cos.asy
trunk/Master/texmf-dist/doc/latex/asy-overview/src/chapter2/asy/exponential.asy
trunk/Master/texmf-dist/doc/latex/asy-overview/src/chapter2/asy/plot.asy
trunk/Master/texmf-dist/doc/latex/asy-overview/src/chapter2/asy/plot_after.asy
trunk/Master/texmf-dist/doc/latex/asy-overview/src/chapter2/chapter2.tex
trunk/Master/texmf-dist/doc/latex/asy-overview/src/chapter3/
trunk/Master/texmf-dist/doc/latex/asy-overview/src/chapter3/asy/
trunk/Master/texmf-dist/doc/latex/asy-overview/src/chapter3/asy/integral.asy
trunk/Master/texmf-dist/doc/latex/asy-overview/src/chapter3/asy/zoom.asy
trunk/Master/texmf-dist/doc/latex/asy-overview/src/chapter3/asy/zoom_iterate.asy
trunk/Master/texmf-dist/doc/latex/asy-overview/src/chapter3/asy/zoom_times.asy
trunk/Master/texmf-dist/doc/latex/asy-overview/src/chapter3/chapter3.tex
trunk/Master/texmf-dist/doc/latex/asy-overview/src/chapter4/
trunk/Master/texmf-dist/doc/latex/asy-overview/src/chapter4/asy/
trunk/Master/texmf-dist/doc/latex/asy-overview/src/chapter4/asy/planes.asy
trunk/Master/texmf-dist/doc/latex/asy-overview/src/chapter4/asy/vectors.asy
trunk/Master/texmf-dist/doc/latex/asy-overview/src/chapter4/asy/washer.asy
trunk/Master/texmf-dist/doc/latex/asy-overview/src/chapter4/chapter4.tex
trunk/Master/texmf-dist/doc/latex/asy-overview/src/chapter4/main_3d.tex
trunk/Master/texmf-dist/doc/latex/asy-overview/src/cover/
trunk/Master/texmf-dist/doc/latex/asy-overview/src/cover/cover.tex
trunk/Master/texmf-dist/doc/latex/asy-overview/src/cover/pp.jpg
trunk/Master/texmf-dist/doc/latex/asy-overview/src/preface/
trunk/Master/texmf-dist/doc/latex/asy-overview/src/preface/preface.tex
trunk/Master/tlpkg/tlpsrc/asy-overview.tlpsrc
Added: trunk/Master/texmf-dist/doc/latex/asy-overview/README
===================================================================
--- trunk/Master/texmf-dist/doc/latex/asy-overview/README (rev 0)
+++ trunk/Master/texmf-dist/doc/latex/asy-overview/README 2024-06-04 19:57:34 UTC (rev 71432)
@@ -0,0 +1,15 @@
+README for Asymptote Overview by Jim Hefferon
+
+Asymptote is a language for creating mathematical graphics. This document
+gives you a quick overview, illustrating with a few familiar Calculus
+examples. You can work through it in a couple of hours to decide if
+you want to have a try at a few of your own and then maybe start in with a
+tutorial or the official reference.
+
+HISTORY
+2024-Mar-12 Jim Hefferon Init
+ Jun-03 JH Upload to CTAN, version 1.04 in git
+
+LICENSE
+ CC-BY-SA-4 See the description here
+ https://creativecommons.org/licenses/by-sa/4.0/
Property changes on: trunk/Master/texmf-dist/doc/latex/asy-overview/README
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: trunk/Master/texmf-dist/doc/latex/asy-overview/asy/jh.asy
===================================================================
--- trunk/Master/texmf-dist/doc/latex/asy-overview/asy/jh.asy (rev 0)
+++ trunk/Master/texmf-dist/doc/latex/asy-overview/asy/jh.asy 2024-06-04 19:57:34 UTC (rev 71432)
@@ -0,0 +1,35 @@
+// Common definitions for asy_tut
+
+// Function to call the texpreamble() function
+void define_texpreamble() {
+ texpreamble("\usepackage{mathtools}
+ \usepackage[utf8]{inputenc}
+ \usepackage[osf,scaled=.92,loosest]{heuristica}
+ \usepackage[heuristica,vvarbb,bigdelims]{newtxmath}
+ \usepackage[T1]{fontenc}
+ \renewcommand*\oldstylenums[1]{\textosf{#1}}");
+}
+
+// Change default size of fonts
+import fontsize;
+defaultpen(fontsize(9pt)); // Like LaTeX \small
+
+// Colors: Morning in Vermont muted by Michelle Delapenha
+pen HIGHLIGHT_COLOR = rgb("A6121F"); // Ecstatic Red
+pen BACKGROUND_COLOR = rgb("8FB6D9"); // Blue Bell
+pen BOLD_COLOR = rgb("677319"); // Fern Frond
+pen LIGHT_COLOR =rgb("A1A60F"); // Fistfull of Green
+pen NEUTRAL_COLOR = rgb("BDBFAA"); // New Neutral
+
+// Generic 2D function
+path GENERIC_FCN_PLOT = (-0.25,0)..(1,0.35)..(2,0)..(3,-0.25)..(4,0)..(5.25,0.25);
+
+// Default materials for 3D surfaces
+import three;
+material figure_material = material(diffusepen=BOLD_COLOR+opacity(0.5),
+ emissivepen=BOLD_COLOR+white,
+ specularpen=BOLD_COLOR+white);
+material slice_material = material(diffusepen=BACKGROUND_COLOR+opacity(0.25),
+ emissivepen=BACKGROUND_COLOR,
+ specularpen=BACKGROUND_COLOR);
+pen boundary_pen = gray(0.2)+opacity(0.5);
Added: trunk/Master/texmf-dist/doc/latex/asy-overview/asy_overview.pdf
===================================================================
(Binary files differ)
Index: trunk/Master/texmf-dist/doc/latex/asy-overview/asy_overview.pdf
===================================================================
--- trunk/Master/texmf-dist/doc/latex/asy-overview/asy_overview.pdf 2024-06-04 19:56:34 UTC (rev 71431)
+++ trunk/Master/texmf-dist/doc/latex/asy-overview/asy_overview.pdf 2024-06-04 19:57:34 UTC (rev 71432)
Property changes on: trunk/Master/texmf-dist/doc/latex/asy-overview/asy_overview.pdf
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/pdf
\ No newline at end of property
Added: trunk/Master/texmf-dist/doc/latex/asy-overview/asy_sty/asy_tut.sty
===================================================================
--- trunk/Master/texmf-dist/doc/latex/asy-overview/asy_sty/asy_tut.sty (rev 0)
+++ trunk/Master/texmf-dist/doc/latex/asy-overview/asy_sty/asy_tut.sty 2024-06-04 19:57:34 UTC (rev 71432)
@@ -0,0 +1,149 @@
+% asy_tut.sty
+% Asymptote tutorial LaTeX style file for use by LaTeX files.
+%
+% 2024-Mar-12 JH Init.
+
+% \usepackage[utf8]{inputenc}
+% \usepackage[osf,scaled=.92,loosest]{heuristica}
+% \usepackage[heuristica,vvarbb,bigdelims]{newtxmath}
+% \usepackage[T1]{fontenc}
+% \renewcommand*\oldstylenums[1]{\textosf{#1}}
+
+\AtBeginDocument{\let\widering\relax} % Get rid of Command \widering already defined. Something to do with mf logo packages
+\usepackage{fourier}
+\usepackage[T1]{fontenc}
+
+% Get MetaFont logo
+\usepackage{mflogo}
+\usepackage{metalogox}
+
+\usepackage{../asy_sty/colors}
+
+\usepackage{mathtools}
+\usepackage{microtype}
+
+% urls and path names
+\usepackage[obeyspaces]{url}
+% \DeclareUrlCommand\path{\urlstyle{tt}}
+
+% Paper layout
+\usepackage[letterpaper,
+ top=1in, bottom=1in, textwidth=426pt,
+ includehead, ignorefoot]{geometry}
+
+% Page headers
+\usepackage{fancyhdr}
+\pagestyle{fancy}
+\fancyhead[L]{\thepage}
+\fancyhead[C]{}
+\fancyhead[R]{\textbf{The performance of new graduates}}
+\fancyfoot[L,C,R]{}
+\renewcommand{\headrulewidth}{0pt}
+\renewcommand{\footrulewidth}{0pt}
+
+\fancyhead{} % clear all header fields
+\fancyhead[RO,LE]{\textit{Page \thepage}}
+\fancyhead[RE,LO]{\textit{\nouppercase\leftmark}}
+\fancyfoot{} % clear all footer fields
+\renewcommand{\headrulewidth}{0.0pt}
+\renewcommand{\footrulewidth}{0.0pt}
+
+% Between chapters, if there is an even page then make it empty
+\let\origdoublepage\cleardoublepage
+\newcommand{\clearemptydoublepage}{%
+ \clearpage
+ {\pagestyle{empty}\origdoublepage}%
+}
+\let\cleardoublepage\clearemptydoublepage
+
+% Display of titles, including chapters and section headers
+\usepackage{titlesec}
+% General command
+% \titleformat{⟨command ⟩}[⟨shape⟩]{⟨format⟩}{⟨label ⟩}{⟨sep⟩}{⟨before-code⟩}[⟨after-code⟩]
+% \titlespacing*{⟨command ⟩}{⟨left⟩}{⟨before-sep⟩}{⟨after-sep⟩}[⟨right-sep⟩]
+\titleformat{\chapter}[hang]{\LARGE\bfseries\color{bold_color}}{Chapter \thechapter:}{0.5em}{}
+\titleformat{\section}[runin]{\bfseries\color{bold_color}}{}{0em}{}
+% \titleformat{\subsection}[runin]{}{}{0.5em}{}
+
+\titlespacing*{\chapter}
+ {0pt}{-11ex plus .1ex minus .2ex}{3.5ex minus .1ex}
+
+\assignpagestyle{\chapter}{empty}
+
+
+% Use Minted for the source code listings
+\usepackage{minted}
+% Bug in minted gives weird spacing in using bgcolor
+% https://github.com/gpoore/minted/issues/220
+% \usepackage{etoolbox}
+% \AtBeginEnvironment{snugshade*}{\par\vspace{-\FrameSep}}
+% \AfterEndEnvironment{snugshade*}{\par\vspace{-\FrameSep}}
+% \BeforeBeginEnvironment{minted}{\par\vspace{-\baselineskip}}
+% \AfterEndEnvironment{minted}{\par\vspace{-\baselineskip}}
+\setminted[Asymptote]{linenos=true,
+ % bgcolor=bgcolor,
+ frame=leftline,
+ fontsize=\footnotesize,
+ stepnumber=5,stepnumberoffsetvalues=true, % number lines multiple of five
+}
+\setmintedinline[Asymptote]{
+ fontsize=\small,
+}
+\setminted[TeX]{linenos=true,
+ % bgcolor=bgcolor,
+ frame=leftline,
+ fontsize=\footnotesize,
+ stepnumber=5,stepnumberoffsetvalues=true, % number lines multiple of five
+}
+\setmintedinline[TeX]{
+ fontsize=\small,
+}
+\setminted[Bash]{% bgcolor=bgcolor,
+ frame=leftline,
+ fontsize=\footnotesize}
+\setmintedinline[Bash]{
+ fontsize=\small,
+}
+\setminted[Python]{% bgcolor=bgcolor,
+ frame=leftline,
+ fontsize=\footnotesize}
+\setmintedinline[Python]{
+ fontsize=\small,
+}
+
+
+% You are often advised to put hyperref last, or almost last
+\usepackage[hidelinks,pdfa]{hyperref}
+\hypersetup{
+ bookmarks=false, % show bookmarks bar?
+ unicode=false, % non-Latin characters in Acrobat’s bookmarks
+ pdftoolbar=True, % show Acrobat’s toolbar?
+ pdfmenubar=True, % show Acrobat’s menu?
+ pdffitwindow=false, % window fit to page when opened
+ pdfstartview={FitH}, % fits the width of the page to the window
+ pdftitle={First Impressions of Asymptote}, % title
+ pdfauthor={Jim Hefferon}, % author
+ pdfsubject={Asymptote}, % subject of the document
+ pdfcreator={pdflatex}, % creator of the document
+ pdfproducer={pdflatex}, % producer of the document
+ pdfkeywords={Asymptote, mathematics, graphics}, % list of keywords
+ pdfnewwindow=false, % links in new PDF window
+ colorlinks=true, % false: boxed links; true: colored links
+ linkcolor=name_color, % color of internal links (change box color with linkbordercolor)
+ citecolor=name_color, % color of links to bibliography
+ filecolor=name_color, % color of file links
+ urlcolor=name_color % color of external links
+}
+
+
+% =============== Macros ===================
+\newcommand{\Asy}{\textit{Asymptote}}
+
+% ---------------------------------
+% Vertically center graphics
+% ex: \vcenteredhbox{\usegraphics{mygraph.png}}
+% From http://tex.stackexchange.com/questions/7219/how-to-vertically-center-two-images
+\newcommand*{\vcenteredhbox}[1]{\begingroup
+\setbox0=\hbox{#1}\parbox{\wd0}{\box0}\endgroup}
+
+
Property changes on: trunk/Master/texmf-dist/doc/latex/asy-overview/asy_sty/asy_tut.sty
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: trunk/Master/texmf-dist/doc/latex/asy-overview/asy_sty/colors.sty
===================================================================
--- trunk/Master/texmf-dist/doc/latex/asy-overview/asy_sty/colors.sty (rev 0)
+++ trunk/Master/texmf-dist/doc/latex/asy-overview/asy_sty/colors.sty 2024-06-04 19:57:34 UTC (rev 71432)
@@ -0,0 +1,22 @@
+% Morning in Vermont muted
+% Michelle Delapenha
+% This color theme consists of Ecstatic Red, Blue Bell, Fern Frond, New Neutral and Fistfull of Green.
+\usepackage{xcolor}
+\definecolor{EcstaticRed}{HTML}{A6121F}
+\definecolor{BlueBell}{HTML}{8FB6D9}
+\definecolor{FernFrond}{HTML}{677319}
+\definecolor{NewNeutral}{HTML}{BDBFAA}
+\definecolor{Fistfull of Green}{HTML}{A1A60F}
+% Provide some abstraction
+\colorlet{highlight_color}{EcstaticRed}
+\colorlet{background_color}{BlueBell}
+\colorlet{bold_color}{FernFrond}
+\colorlet{light_color}{Fistfull of Green}
+\colorlet{neutral_color}{NewNeutral}
+
+% Background for course listings
+% \definecolor{bgcolor}{rgb}{0.95,0.95,0.95}
+\colorlet{bgcolor}{neutral_color!25}%
+
+% Name on cover darker version of BlueBell
+\definecolor{name_color}{HTML}{4383BB}
\ No newline at end of file
Property changes on: trunk/Master/texmf-dist/doc/latex/asy-overview/asy_sty/colors.sty
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: trunk/Master/texmf-dist/doc/latex/asy-overview/src/Makefile
===================================================================
--- trunk/Master/texmf-dist/doc/latex/asy-overview/src/Makefile (rev 0)
+++ trunk/Master/texmf-dist/doc/latex/asy-overview/src/Makefile 2024-06-04 19:57:34 UTC (rev 71432)
@@ -0,0 +1,126 @@
+# Makefile for asy_tut
+#
+# Usage: This works for me.
+# For initial compilation, from my Linux command line I run this.
+# $ make all LATEX_TWICE=yes
+# I have TeX Live with Asymptote installed.
+
+# 2024-May-14 Jim Hefferon CC-BY-SA
+#
+# TODO
+
+SHELL=/bin/bash
+
+LATEX:=pdflatex -shell-escape # Need -shell-escape to get minted to run
+LATEXNONSTOP:=pdflatex -interaction=nonstopmode -shell-escape
+ASYMPTOTE:=asy
+ASYMPTOTE3D:=asy -inlineimage
+
+MAIN_FILE:=asy_tut
+
+all: asy_tut.pdf
+
+
+# =============================
+# Main document
+asy_tut.pdf: ../asy_sty/asy_tut.sty ../asy/jh.asy \
+ asy_tut.tex \
+ cover/cover.tex cover/pp.jpg \
+ preface/preface.tex \
+ chapter1/chapter1.tex \
+ chapter1/main.tex chapter1/main.pdf \
+ chapter1/asy/unit_circle.pdf chapter1/asy/unit_circle_after.pdf \
+ chapter2/chapter2.tex chapter2/asy/plot.pdf \
+ chapter2/asy/plot_after.pdf chapter2/asy/cos.pdf \
+ chapter2/asy/exponential.pdf \
+ chapter3/chapter3.tex chapter3/asy/zoom.pdf chapter3/asy/zoom_times.pdf \
+ chapter3/asy/zoom_iterate000.pdf chapter3/asy/integral.pdf \
+ chapter4/chapter4.tex chapter4/asy/vectors.asy chapter4/asy/vectors.tex \
+ chapter4/asy/planes.asy chapter4/asy/planes.tex \
+ chapter4/asy/washer.asy chapter4/asy/washer.tex \
+ chapter4/main_3d.tex chapter4/main_3d.pdf \
+ appendix/appendix.tex
+ifdef LATEX_TWICE
+ cd $(@D); \
+ $(LATEX) $(basename $(notdir $(@))); \
+ $(LATEX) $(basename $(notdir $(@)));
+else
+ cd $(@D); \
+ $(LATEX) $(basename $(notdir $(@)));
+endif
+
+
+# Chapter1
+chapter1/asy/unit_circle.pdf: chapter1/asy/unit_circle.asy
+ cd $(@D); \
+ $(ASYMPTOTE) $(basename $(notdir $(@)));
+
+chapter1/main.pdf: chapter1/asy/unit_circle_after.pdf chapter1/main.tex
+ cd $(@D); \
+ $(LATEX) $(basename $(notdir $(@)));
+
+chapter1/asy/unit_circle_after.pdf: chapter1/asy/unit_circle_after.asy
+ cd $(@D); \
+ $(ASYMPTOTE) $(basename $(notdir $(@)));
+
+# Chapter2
+chapter2/asy/plot.pdf: chapter2/asy/plot.asy
+ cd $(@D); \
+ $(ASYMPTOTE) $(basename $(notdir $(@)));
+
+chapter2/asy/plot_after.pdf: chapter2/asy/plot_after.asy ../asy/jh.asy
+ cd $(@D); \
+ $(ASYMPTOTE) $(basename $(notdir $(@)));
+
+chapter2/asy/cos.pdf: chapter2/asy/cos.asy ../asy/jh.asy
+ cd $(@D); \
+ $(ASYMPTOTE) $(basename $(notdir $(@)));
+
+chapter2/asy/exponential.pdf: chapter2/asy/exponential.asy ../asy/jh.asy
+ cd $(@D); \
+ $(ASYMPTOTE) $(basename $(notdir $(@)));
+
+# Chapter3
+chapter3/asy/zoom.pdf: chapter3/asy/zoom.asy ../asy/jh.asy
+ cd $(@D); \
+ $(ASYMPTOTE) $(basename $(notdir $(@)));
+
+chapter3/asy/zoom_times.pdf: chapter3/asy/zoom_times.asy ../asy/jh.asy
+ cd $(@D); \
+ $(ASYMPTOTE) $(basename $(notdir $(@)));
+
+chapter3/asy/zoom_iterate000.pdf: chapter3/asy/zoom_iterate.asy ../asy/jh.asy
+ cd $(@D); \
+ $(ASYMPTOTE) zoom_iterate; # no substring fcn?
+
+chapter3/asy/integral.pdf: chapter3/asy/integral.asy ../asy/jh.asy
+ cd $(@D); \
+ $(ASYMPTOTE) $(basename $(notdir $(@)));
+
+# Chapter4
+chapter4/asy/vectors.tex: chapter4/asy/vectors.asy ../asy/jh.asy
+ cd $(@D); \
+ $(ASYMPTOTE3D) $(basename $(notdir $(@)));
+
+chapter4/asy/planes.tex: chapter4/asy/planes.asy ../asy/jh.asy
+ cd $(@D); \
+ $(ASYMPTOTE3D) $(basename $(notdir $(@)));
+
+chapter4/asy/washer.tex: chapter4/asy/washer.asy ../asy/jh.asy
+ cd $(@D); \
+ $(ASYMPTOTE3D) $(basename $(notdir $(@)));
+
+chapter4/main_3d.pdf: chapter4/main_3d.tex chapter4/asy/vectors.asy chapter4/asy/vectors.tex ../asy/jh.asy
+ cd $(@D); \
+ $(LATEX) $(basename $(notdir $(@)));
+
+
+# Help
+.PHONY: help
+help: ## Display this help
+ @echo "make <target>"
+ @echo " all: make the Asymptote tutorial"
+ @echo " help: show this help"
+ @echo "To make the document from scratch: make all LATEX_TWICE=yes"
+
+
Property changes on: trunk/Master/texmf-dist/doc/latex/asy-overview/src/Makefile
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: trunk/Master/texmf-dist/doc/latex/asy-overview/src/appendix/appendix.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/asy-overview/src/appendix/appendix.tex (rev 0)
+++ trunk/Master/texmf-dist/doc/latex/asy-overview/src/appendix/appendix.tex 2024-06-04 19:57:34 UTC (rev 71432)
@@ -0,0 +1,24 @@
+% Appendix from Asymptote tutorial Jim Hefferon
+\chapter*{Appendix: File with defaults}
+Rather than copy and paste code common across graphics,
+we can put them in a separate file and import them.
+In the earlier \Asy{} sources the lines
+\begin{minted}{Asymptote}
+cd("../../../asy"); import jh; cd(""); define_texpreamble();
+\end{minted}
+will first run the commands in the file \path{../../../asy/jh.asy},
+and then run the function defined in that file.
+
+Here is the file.
+Its first few lines define the command to set the fonts,
+and changes the default font size.
+(This change leaves more room for graphic elements and
+also helps the graphics have a visually cohesive identity.)
+Then it defines a color scheme.\footnote{%
+ Thank you to \protect\texttt{color.adobe.com} user Michelle Delapenha.}
+Lastly, it defines the
+\mintinline{Asymptote}{material} defaults
+for 3D graphics.
+\begin{center}
+ \inputminted{Asymptote}{../asy/jh.asy}
+\end{center}
Property changes on: trunk/Master/texmf-dist/doc/latex/asy-overview/src/appendix/appendix.tex
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: trunk/Master/texmf-dist/doc/latex/asy-overview/src/asy_tut.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/asy-overview/src/asy_tut.tex (rev 0)
+++ trunk/Master/texmf-dist/doc/latex/asy-overview/src/asy_tut.tex 2024-06-04 19:57:34 UTC (rev 71432)
@@ -0,0 +1,58 @@
+\documentclass{book}
+\usepackage{../asy_sty/asy_tut}
+
+% For 3D PRC asymptote
+% See: https://github.com/vectorgraphics/asymptote/blob/master/doc/externalprc.tex
+% Compile .asy files with asy -inlineimage <fn>
+\RequirePackage{asymptote}
+\def\asydir{chapter4/asy/}
+\graphicspath{{asy/}}
+% uncomment for 3D graphics:
+\input chapter4/asy/vectors.pre
+\input chapter4/asy/planes.pre
+\input chapter4/asy/washer.pre
+\usepackage[bigfiles]{media9}
+
+
+\includeonly{
+ cover/cover,
+ preface/preface,
+ chapter1/chapter1,
+ chapter2/chapter2,
+ chapter3/chapter3,
+ chapter4/chapter4,
+ appendix/appendix
+}
+
+\begin{document}
+\frontmatter
+\newcommand{\includefiledir}{cover}
+\include{\includefiledir /cover}
+\renewcommand{\includefiledir}{preface}
+\include{\includefiledir /preface}
+\mainmatter
+\renewcommand{\includefiledir}{chapter1}
+\include{\includefiledir /chapter1}
+\renewcommand{\includefiledir}{chapter2}
+\include{\includefiledir /chapter2}
+\renewcommand{\includefiledir}{chapter3}
+\include{\includefiledir /chapter3}
+\renewcommand{\includefiledir}{chapter4}
+\include{\includefiledir /chapter4}
+\backmatter
+\renewcommand{\includefiledir}{appendix}
+\include{\includefiledir /appendix}
+\end{document}
+
+%
+% These lines tells gnu-emacs to typeset with the default tex engine
+% which requires Unicode encoding only (utf-8)
+% ^c^t^s for toggling synctex.
+% ^-Shift-Click to move from pdf to source, Command-Shift-Click on OSX
+%%% Local Variables:
+%%% mode: latex
+%%% TeX-engine: default
+%%% TeX-command-extra-options: " -shell-escape"
+%%% TeX-source-correlate-method-active: synctex
+%%% coding: utf-8
+%%% End:
Property changes on: trunk/Master/texmf-dist/doc/latex/asy-overview/src/asy_tut.tex
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: trunk/Master/texmf-dist/doc/latex/asy-overview/src/chapter1/asy/unit_circle.asy
===================================================================
--- trunk/Master/texmf-dist/doc/latex/asy-overview/src/chapter1/asy/unit_circle.asy (rev 0)
+++ trunk/Master/texmf-dist/doc/latex/asy-overview/src/chapter1/asy/unit_circle.asy 2024-06-04 19:57:34 UTC (rev 71432)
@@ -0,0 +1,19 @@
+// unit_circle.asy
+settings.outformat="pdf"; // Output PDF file
+
+import graph; // Module for plotting routines, including xaxis() and yaxis()
+
+unitsize(1.5cm); // One x unit or y unit will be 1.5cm.
+
+// Draw a unit circle
+draw(unitcircle);
+
+// Draw a generic angle
+real theta = radians(35);
+pair generic_pt = (cos(theta), sin(theta));
+draw((0,0)--generic_pt);
+dot("$(\cos\theta,\sin\theta)$",generic_pt,E);
+
+// Draw the axes
+xaxis("$x$",xmin=-1.2,xmax=1.2,Arrows(TeXHead));
+yaxis("$y$",ymin=-1.2,ymax=1.2,Arrows(TeXHead));
Added: trunk/Master/texmf-dist/doc/latex/asy-overview/src/chapter1/asy/unit_circle_after.asy
===================================================================
--- trunk/Master/texmf-dist/doc/latex/asy-overview/src/chapter1/asy/unit_circle_after.asy (rev 0)
+++ trunk/Master/texmf-dist/doc/latex/asy-overview/src/chapter1/asy/unit_circle_after.asy 2024-06-04 19:57:34 UTC (rev 71432)
@@ -0,0 +1,27 @@
+// unit_circle_after.asy
+settings.outformat="pdf";
+
+texpreamble("\usepackage{mathtools}
+ \usepackage[utf8]{inputenc}
+ \usepackage[osf,scaled=.92,loosest]{heuristica}
+ \usepackage[heuristica,vvarbb,bigdelims]{newtxmath}
+ \usepackage[T1]{fontenc}
+ \renewcommand*\oldstylenums[1]{\textosf{#1}}");
+
+import graph; // Module for plotting routines, including xaxis() and yaxis()
+
+unitsize(1.5cm); // One x unit or y unit will be 1.5cm.
+
+// Draw a unit circle
+draw(unitcircle);
+
+// Draw a generic angle
+real theta = radians(35);
+pair generic_pt = (cos(theta), sin(theta));
+draw((0,0)--generic_pt);
+dotfactor = 4;
+dot("$(\cos\theta,\sin\theta)$",generic_pt,E);
+
+// Draw the axes
+xaxis("\scriptsize $x$",xmin=-1.2,xmax=1.2,Arrows(TeXHead));
+yaxis("\scriptsize $y$",ymin=-1.2,ymax=1.2,Arrows(TeXHead));
Added: trunk/Master/texmf-dist/doc/latex/asy-overview/src/chapter1/chapter1.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/asy-overview/src/chapter1/chapter1.tex (rev 0)
+++ trunk/Master/texmf-dist/doc/latex/asy-overview/src/chapter1/chapter1.tex 2024-06-04 19:57:34 UTC (rev 71432)
@@ -0,0 +1,142 @@
+% Chapter 1 from Asymptote tutorial Jim Hefferon
+\chapter{A first graphic}
+Making an \Asy{} input file is like making a \LaTeX{} input file,
+so you already have a feel for the basics.
+To start,
+in your favorite editor open an \Asy{} input file \path{asy/unit_circle.asy}.
+\begin{minted}{Bash}
+jim at millstone:~/Documents/asy_tut/src$ cd asy
+jim at millstone:~/Documents/asy_tut/src/asy$ emacs unit_circle.asy
+\end{minted}
+Type this text into the file and save it, or
+copy it from this document's online source.
+\begin{center}
+ \inputminted{Asymptote}{chapter1/asy/unit_circle.asy}
+\end{center}
+Get the output file \path{unit_circle.pdf} by running \Asy{} on the source.
+\begin{minted}{Bash}
+jim at millstone:~/Documents/asy_tut/src/asy$ asy unit_circle
+\end{minted}
+%$ Make auctex recognize end of "math"
+You can see the result in any PDF viewer.
+\begin{center}
+ \includegraphics{chapter1/asy/unit_circle.pdf}
+\end{center}
+
+
+
+
+\section{What do we have here?}
+The input \path{unit_circle.asy} illustrates a number of things.
+Globally, it shows that you must declare variables such as line~12's
+\mintinline{Asymptote}{theta}, that
+commands end with a semicolon,
+and that comments are preceded by a double slash,
+\mintinline{Asymptote}{//}.
+
+Locally, line 2's \mintinline{Asymptote}{settings.outformat}
+variable fixes the format of output files to PDF so we needn't remember
+each time to do that from the command line.
+Line~4's \mintinline{Asymptote}{import}
+is like a \LaTeX{} \mintinline{TeX}{\usepackage{...}} in that
+it gives us access to a module, a collection of related commands and data.
+In this case it
+gives us commands to make plots.
+In this drawing we only use its axis-making commands
+but the second chapter has more about plots.
+
+In line~6 the \mintinline{Asymptote}{unitsize(1.5cm)} command means that
+if we describe a point $(x,y)$ then \Asy{} will interpret it as the
+location $x\cdot 1.5\text{\,cm}$ and $y\cdot 1.5\text{\,cm}$ from the origin.
+
+Line~9 is self-explanatory.
+Lines~12 through~15 draw the line segment from the origin to the
+point labeled $(\cos\theta,\sin\theta)$.
+(On line~15, in addition to drawing the dot, \Asy{} labels it and
+the \mintinline{Asymptote}{E} puts that label east of the dot.)
+% Note that if after seeing the drawing we decide to adjust the angle
+% then we just need to change one number, on line~12.
+
+Finally, lines 18 and~19 draw the axes.
+These commands have many options, most of which we did not use here,
+and we will see more of them later.
+
+One more thing.
+\Asy{} gets the point label $(\cos\theta,\sin\theta)$ and the axis labels
+by putting the given strings in a small file,
+running \LaTeX{} on it, and then extracting the result back into the
+output graphic.
+So your labels have access to all of \LaTeX's capabilities.
+
+
+
+
+
+\section{Adjustments}
+After you get a graphic draft there are always some tweaks.
+
+First, here the axis labels are too big.
+We will replace \mintinline{Asymptote}{"$x$"}
+with \mintinline{Asymptote}{"\scriptsize $x$"}.
+(We could instead omit the label by deleting the entire
+string and the comma after it,
+which illustrates that commands
+such as \mintinline{Asymptote}{"xaxis(..)"}
+can have a variable number of arguments.
+While you are working you may want to have open the \Asy{} reference
+for a list of the options.)
+
+Second, the dot showing the generic point on the unit circle is too big.
+In the revised source below we've adjusted the size by inserting
+\mintinline{Asymptote}{dotfactor = 4} in line~23
+(the default factor is $6$).
+
+Finally, the $(\cos\theta,\sin\theta)$ label is in a different font than
+the other mathematics in this overview.
+We want that \Asy, when making the small \LaTeX{} document to create the
+in-graphic text,
+will use the same font setup as the main \path{.tex} file.
+So below we added a
+\mintinline{Asymptote}{texpreamble("..")};~the
+string is long so for readability we've spread it across multiple lines.
+\begin{center}
+ \inputminted{Asymptote}{chapter1/asy/unit_circle_after.asy}
+\end{center}
+\begin{center}
+ \includegraphics{chapter1/asy/unit_circle_after.pdf}
+\end{center}
+
+
+
+\section{Include the graphic in a \LaTeX{} file}
+Open a new \LaTeX{} file \path{main.tex}.
+\begin{minted}{Bash}
+jim at millstone:~/Documents/asy_tut/src$ emacs main.tex
+\end{minted}
+Enter this text
+or copy it from this document's source.
+\begin{center}
+ \inputminted{TeX}{chapter1/main.tex}
+\end{center}
+This document shows two ways to include the graphic.
+Line~11 is straightforward because
+after you've iterated through some adjustments to the figure then you
+use \LaTeX's standard \mintinline{TeX}{\includegraphics{..}}.
+The other way, commented out,
+uses the \mintinline{TeX}{asymptote} \LaTeX{} package
+to include the \Asy{} source file with
+\mintinline{TeX}{\asyinclude{..}}.
+In this approach, getting the graphic is a three step process, where
+you run ``\mintinline{Bash}{pdflatex main}'' (of course
+you can instead use ``\mintinline{Bash}{xelatex main}'' or
+``\mintinline{Bash}{lualatex main}''), then you go into
+the \path{asy/} subdirectory and run
+``\mintinline{Bash}{asy <latex-filename>-1}''
+(here, ``\mintinline{Bash}{asy main-1}''), then go back to the
+\LaTeX{} file's directory and run ``\mintinline{Bash}{pdflatex main}'' once more.
+In either case here is the one-page output.
+\begin{center}
+ \framebox{\includegraphics[page=1,scale=0.325,trim=0.25in 5.9in 0.25in 0.25in]{chapter1/main.pdf}}
+\end{center}
+
+
Property changes on: trunk/Master/texmf-dist/doc/latex/asy-overview/src/chapter1/chapter1.tex
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: trunk/Master/texmf-dist/doc/latex/asy-overview/src/chapter1/main.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/asy-overview/src/chapter1/main.tex (rev 0)
+++ trunk/Master/texmf-dist/doc/latex/asy-overview/src/chapter1/main.tex 2024-06-04 19:57:34 UTC (rev 71432)
@@ -0,0 +1,16 @@
+% main.tex LaTeX demonstration file to use with Asymptote, Jim Hefferon
+\documentclass{article}
+\usepackage{graphicx}
+% \usepackage{asymptote} % If you use \asyinclude{..}
+% \renewcommand{\asydir}{asy} % Keep this doc's dir tidy, put stuff in asy/
+
+\begin{document}
+Once you get the graphic the way that you like it,
+include the output PDF in your \LaTeX{} file.
+\begin{center}
+ \includegraphics{asy/unit_circle_after.pdf}
+ % Can instead include the .asy source in the text body.
+ % \asyinclude{asy/unit_circle_after.asy}
+ % There is also an environment where you type the .asy source directly.
+\end{center}
+\end{document}
Property changes on: trunk/Master/texmf-dist/doc/latex/asy-overview/src/chapter1/main.tex
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: trunk/Master/texmf-dist/doc/latex/asy-overview/src/chapter2/asy/cos.asy
===================================================================
--- trunk/Master/texmf-dist/doc/latex/asy-overview/src/chapter2/asy/cos.asy (rev 0)
+++ trunk/Master/texmf-dist/doc/latex/asy-overview/src/chapter2/asy/cos.asy 2024-06-04 19:57:34 UTC (rev 71432)
@@ -0,0 +1,29 @@
+// cos.asy
+settings.outformat="pdf";
+cd("../../../asy"); import jh; cd(""); define_texpreamble();
+
+import graph;
+
+real fcn(real x) {
+ return( cos(x) ); // Many real functions such as cosine are built in
+}
+
+unitsize(1cm);
+real xmin = 0; real xmax = 2*pi; // Asymptote defines pi as a convenience
+real ymin = -1; real ymax = 1;
+
+path f = graph(fcn, xmin, xmax);
+draw(f, HIGHLIGHT_COLOR);
+
+// Axes with custom ticks
+real[] T = {pi/2, pi, 3*pi/2, 2*pi}; // Array of reals holds tick locations
+xaxis(xmin=xmin-0.2, xmax=xmax+0.2,
+ RightTicks("%", T, Size=2pt), // LaTeX % comment means tick label is blank
+ Arrows(TeXHead));
+labelx("$\frac{\pi}{2}$",pi/2); // Put in a label by hand, rather than a decimal
+labelx("$\pi$",pi);
+labelx("$\frac{3\pi}{2}$",3*pi/2, NW);
+labelx("$2\pi$",2*pi);
+yaxis(ymin=ymin-0.2, ymax=ymax+0.2,
+ LeftTicks(Step=1, OmitTick(0)),
+ Arrows(TeXHead));
Added: trunk/Master/texmf-dist/doc/latex/asy-overview/src/chapter2/asy/exponential.asy
===================================================================
--- trunk/Master/texmf-dist/doc/latex/asy-overview/src/chapter2/asy/exponential.asy (rev 0)
+++ trunk/Master/texmf-dist/doc/latex/asy-overview/src/chapter2/asy/exponential.asy 2024-06-04 19:57:34 UTC (rev 71432)
@@ -0,0 +1,54 @@
+// exponential.asy
+settings.outformat="pdf";
+cd("../../../asy"); import jh; cd(""); define_texpreamble();
+
+import graph;
+
+real fcn(real x) {
+ return( exp(x) );
+}
+real tangent_fcn(real x) {
+ return( 2*(x-log(2))+2 );
+}
+
+unitsize(1cm);
+real xmin = -3; real xmax = 1.25;
+real ymin = 0; real ymax = exp(xmax);
+
+path f = graph(fcn, xmin, xmax, n=300);
+path tan_line = graph(tangent_fcn, log(2)-0.5, log(2)+0.5);
+
+draw(f);
+draw(tan_line, HIGHLIGHT_COLOR);
+dotfactor = 4;
+dot(Label("$(\ln(2),2)$",filltype=Fill(white)), (log(2),2), 2*E);
+
+// Axes making graph paper
+pen GRAPHPAPERPEN=(0.25*LIGHT_COLOR+0.75*white)
+ +squarecap; // Make graph paper lines
+
+xaxis(axis=YEquals(ymax+0.2),
+ xmin=xmin-0.5, xmax=xmax+0.5,
+ p=nullpen,
+ ticks=RightTicks("%", Step=1, OmitTick(0), extend=true, pTick=GRAPHPAPERPEN));
+xaxis(axis=YEquals(ymin-0.2),
+ xmin=xmin-0.5, xmax=xmax+0.5,
+ p=nullpen,
+ ticks=RightTicks("%", Step=1, OmitTick(0), extend=true, pTick=GRAPHPAPERPEN));
+
+yaxis(axis=XEquals(xmin-0.2),
+ ymin=ymin-0.5, ymax=ymax+0.5,
+ p=nullpen,
+ ticks=LeftTicks("%", Step=1, OmitTick(0), extend=true, pTick=GRAPHPAPERPEN));
+yaxis(axis=XEquals(xmax+0.2),
+ ymin=ymin-0.5, ymax=ymax+0.5,
+ p=nullpen,
+ ticks=LeftTicks("%", Step=1, OmitTick(0), extend=true, pTick=GRAPHPAPERPEN));
+
+// Axes in black with ticks
+xaxis(xmin=xmin-0.2, xmax=xmax+0.2,
+ RightTicks(Step=1, step=0, Size=2pt),
+ Arrows(TeXHead));
+yaxis(ymin=ymin, ymax=ymax+0.2,
+ LeftTicks(Step=1, OmitTick(0), Size=2pt),
+ Arrow(TeXHead)); // Arrow singular means no bottom arrow
Added: trunk/Master/texmf-dist/doc/latex/asy-overview/src/chapter2/asy/plot.asy
===================================================================
--- trunk/Master/texmf-dist/doc/latex/asy-overview/src/chapter2/asy/plot.asy (rev 0)
+++ trunk/Master/texmf-dist/doc/latex/asy-overview/src/chapter2/asy/plot.asy 2024-06-04 19:57:34 UTC (rev 71432)
@@ -0,0 +1,40 @@
+// plot.asy
+settings.outformat="pdf";
+
+texpreamble("\usepackage[utf8]{inputenc}
+ \usepackage[osf,scaled=.92,loosest]{heuristica}
+ \usepackage[heuristica,vvarbb,bigdelims]{newtxmath}
+ \usepackage[T1]{fontenc}
+ \renewcommand*\oldstylenums[1]{\textosf{#1}}");
+
+import graph; // Access plotting routines
+
+// Function to be plotted
+real fcn(real x) {
+ return( x+(1/(x-1)) );
+}
+
+unitsize(1cm); // One x unit or y unit will be 1cm.
+
+// Nominal plot boundaries
+real xmin = -2; real xmax = 3;
+real ymin = -5; real ymax = 5;
+
+// Get the graph
+real left_x = 2*sqrt(2)-2; // From solving -5=x+(1/(x-1))
+real right_x = 3-sqrt(3); // From 5=x+(1/(x-1))
+path f_left = graph(fcn, xmin, left_x);
+path f_right = graph(fcn, right_x, xmax);
+
+// Draw
+draw((1,ymin)--(1,ymax), dashed); // Vert asymptote
+draw(f_left, red);
+draw(f_right, red);
+
+// Draw the axes, with ticks
+xaxis(xmin=xmin-0.2, xmax=xmax+0.2,
+ RightTicks(Step=1),
+ Arrows(TeXHead));
+yaxis(ymin=ymin-0.2, ymax=ymax+0.2,
+ LeftTicks(Step=1),
+ Arrows(TeXHead));
Added: trunk/Master/texmf-dist/doc/latex/asy-overview/src/chapter2/asy/plot_after.asy
===================================================================
--- trunk/Master/texmf-dist/doc/latex/asy-overview/src/chapter2/asy/plot_after.asy (rev 0)
+++ trunk/Master/texmf-dist/doc/latex/asy-overview/src/chapter2/asy/plot_after.asy 2024-06-04 19:57:34 UTC (rev 71432)
@@ -0,0 +1,35 @@
+// plot_after.asy
+cd("../../../asy"); import jh; cd(""); define_texpreamble();
+
+import graph; // Access plotting routines
+
+// Function to be plotted
+real fcn(real x) {
+ return( x+(1/(x-1)) );
+}
+
+unitsize(1cm);
+scale(Linear, Linear(0.5)); // Rescale the y axis by half
+
+// Nominal plot boundaries
+real xmin = -2; real xmax = 3;
+real ymin = -5; real ymax = 5;
+
+// Get the graph
+real left_x = 2*sqrt(2)-2; // From solving -5=x+(1/(x-1))
+real right_x = 3-sqrt(3); // From 5=x+(1/(x-1))
+path f_left = graph(fcn, xmin, left_x);
+path f_right = graph(fcn, right_x, xmax);
+
+// Draw
+draw(Scale((1,ymin))--Scale((1,ymax)), dashed); // Vert asymptote
+draw(f_left, HIGHLIGHT_COLOR);
+draw(f_right, HIGHLIGHT_COLOR);
+
+// Draw the axes, with ticks
+xaxis(xmin=xmin-0.2, xmax=xmax+0.2,
+ RightTicks(Step=1, OmitTick(0,1), Size=3pt),
+ Arrows(TeXHead));
+yaxis(ymin=ymin-0.4, ymax=ymax+0.4,
+ LeftTicks(Step=5, step=1, OmitTick(0), Size=3pt, size=2pt),
+ Arrows(TeXHead));
Added: trunk/Master/texmf-dist/doc/latex/asy-overview/src/chapter2/chapter2.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/asy-overview/src/chapter2/chapter2.tex (rev 0)
+++ trunk/Master/texmf-dist/doc/latex/asy-overview/src/chapter2/chapter2.tex 2024-06-04 19:57:34 UTC (rev 71432)
@@ -0,0 +1,162 @@
+% Chapter 2 from Asymptote tutorial Jim Hefferon
+\chapter{Plots}
+We will draw this function.
+\begin{equation*}
+ f(x)=x+\frac{1}{x-1}
+\end{equation*}
+It goes infinite at $x=1$ so
+we can't ask \Asy{} to plot all $x$'s.
+We will instead plot the $x$'s where the associated $y$'s
+are between $-5$ and~$5$.
+To find these
+we can use \textit{Sage} to solve
+$5=x+(1/(x-1))$ and $-5=x+(1/(x-1))$.
+\begin{minted}{Python}
+sage: x = var('x')
+sage: solve( [5==x+(1/(x-1))], x )
+[x == -sqrt(3) + 3, x == sqrt(3) + 3]
+sage: solve( [-5==x+(1/(x-1))], x )
+[x == -2*sqrt(2) - 2, x == 2*sqrt(2) - 2]
+sage: round(-sqrt(3) + 3, ndigits=3)
+1.268
+sage: round(2*sqrt(2) - 2, ndigits=3)
+0.828
+\end{minted}
+That leads to this source file \path{asy/plot.asy}.
+\begin{center}
+ \inputminted{Asymptote}{chapter2/asy/plot.asy}
+\end{center}
+Here is the resulting plot.
+\begin{center}
+ \includegraphics{chapter2/asy/plot.pdf}
+\end{center}
+
+
+
+\section{Adjustments}
+As earlier, on seeing the draft graphic we make some tweaks,
+which helps give a sense of some available options,
+leading to the
+source \path{asy/plot_after.asy} below.
+
+The axes go through the two $0$'s
+and the vertical asymptote passes through the~$1$.
+We can change the \mintinline{Asymptote}{xaxis(..)}
+command to say \mintinline{Asymptote}{RightTicks(Step=1, OmitTick(0,1))},
+and similarly change \mintinline{Asymptote}{yaxis(..)}.
+
+Although we limited the output range to between $y=-5$ and~$5$,
+the plot is still so tall that it is hard to fit on a page or slide.
+We make the $y$~unit height be half of the $x$ unit width by adding this command
+\begin{minted}{Asymptote}
+scale(Linear, Linear(0.5))
+\end{minted}
+(the \mintinline{Asymptote}{Linear} is in contrast with
+\mintinline{Asymptote}{Logarithmic}).
+The axes and graph now come out rescaled but
+we must also adjust the location
+of points, the ones defining the vertical asymptote line, using for example
+line~29's \mintinline{Asymptote}{Scale((1,ymin))}.
+
+That tweak of the $y$~axis causes the tick labels to be scrunched together,
+so we arrange that \Asy{} lists only every fifth label.
+\begin{minted}{Asymptote}
+ yaxis(ymin=ymin-0.4, ymax=ymax+0.4,
+ LeftTicks(Step=5, step=1, OmitTick(0), Size=3pt, size=2pt),
+ Arrows(TeXHead));
+\end{minted}
+That command also sets the length of the major and minor ticks.
+
+Here is \path{asy/plot_after.asy}
+(more on the first couple of lines in the next section).
+\begin{center}
+ \inputminted{Asymptote}{chapter2/asy/plot_after.asy}
+\end{center}
+Here is the output.
+\begin{center}
+ \includegraphics{chapter2/asy/plot_after.pdf}
+\end{center}
+
+
+
+\section{Defaults}
+Rather than copy and paste elements common across graphics
+such as the font commands or colors,
+we can put them in a separate file \path{jh.asy} and import them,
+as in the prior source's line~2.
+That file's source is in the Appendix.
+
+
+\section{Ticks}
+With plot ticks you often want something other
+than the default.
+We won't cover all of the options but there are a couple of things we have
+not yet seen that are especially useful.
+
+On a trigonometric graph
+\begin{center}
+ \includegraphics{chapter2/asy/cos.pdf}
+\end{center}
+you don't want the $x$~axis to say $1$, $2$, etc.,
+you want $\pi/2$, $\pi$, etc.
+You also don't want ``$3.14$,'' you want ``$\pi$.''
+This illustrates explicit ticks, on lines 19 and~21.
+\begin{center}
+ \inputminted{Asymptote}{chapter2/asy/cos.asy}
+\end{center}
+Note line~25's \mintinline{Asymptote}{NW}, which prints
+the $3\pi/2$ northwest of its tick.
+
+Our other tick example has a graph paper effect,
+where ticks in a light color extending across the graph.
+(I sometimes use this for lectures; here,
+to estimate by eye that the slope of the tangent line
+at $y=2$ is $2$.)
+\begin{center}
+ \includegraphics{chapter2/asy/exponential.pdf}
+\end{center}
+
+The source has a number of interesting features.
+\begin{center}
+ \inputminted{Asymptote}{chapter2/asy/exponential.asy}
+\end{center}
+The graph paper effect is due to the input in lines 30 through~46.
+The horizontal lines are a little clearer so we will cover them.
+They are created by the first two \mintinline{Asymptote}{yaxis(..)} commands,
+which produce two vertical axes, one on the left and one on the right,
+These are drawn with a \mintinline{Asymptote}{nullpen} so we don't see
+vertical black lines at those locations.
+What we do see are
+the ticks extending back and forth between them in the color given by
+\mintinline{Asymptote}{GRAPHPAPERPEN}, because of
+the \mintinline{Asymptote}{extend=true}.
+These ticks have a null label because of the
+\LaTeX{} comment character~\mintinline{Asymptote}{"%"}.
+(The $y$~axis on the left produces the horizontal
+graph paper marks between
+$x=\text{\mintinline{Asymptote}{xmin-0.2}}$ and the third $y$~axis at
+$x=0$, while the one on the right generates the marks
+from $x=0$ to $x=\text{\mintinline{Asymptote}{xmax+0.2}}$.)
+
+The commands from line~49 to the end produce the black line axes.
+% Note that \mintinline{Asymptote}{yaxis(..)} produces only one arrow.
+
+This is a long file but we will discuss a few finer points.
+One is that the $(\ln(2),2)$ label has a white background
+obscuring some of the graph paper lines, from the
+\mintinline{Asymptote}{Label("$(\ln(2),2)$",filltype=Fill(white))}
+command.
+Another is that the 300 in line~19's
+\mintinline{Asymptote}{f = graph(fcn, xmin, xmax, n=300)}
+is there because \Asy{} draws the graph by connecting dots that
+evaluate
+\mintinline{Asymptote}{fcn}
+at a finite number of points, and the default was too small so that
+the graphic had jaggies on the left.
+
+Finally, lines 18 and~19 as well as lines 27 and~28 make clear that
+essential to understanding \Asy{} is understanding the ideas of
+\mintinline{Asymptote}{path}
+and
+\mintinline{Asymptote}{pen}.
+That's the next chapter.
Property changes on: trunk/Master/texmf-dist/doc/latex/asy-overview/src/chapter2/chapter2.tex
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: trunk/Master/texmf-dist/doc/latex/asy-overview/src/chapter3/asy/integral.asy
===================================================================
--- trunk/Master/texmf-dist/doc/latex/asy-overview/src/chapter3/asy/integral.asy (rev 0)
+++ trunk/Master/texmf-dist/doc/latex/asy-overview/src/chapter3/asy/integral.asy 2024-06-04 19:57:34 UTC (rev 71432)
@@ -0,0 +1,36 @@
+// integral.asy
+settings.outformat="pdf";
+cd("../../../asy"); import jh; cd(""); define_texpreamble();
+
+import graph;
+
+unitsize(1cm);
+real xmin = 0; real xmax = 5;
+real ymin = 0; real ymax = 2.5;
+
+path f = shift(0,1.5)*GENERIC_FCN_PLOT;
+real a = 1; real b = 4; // Limits of integration
+real x = 2.85; // Location of dx-thick slice
+real x_time = times(f, x)[0];
+
+// Give the sides of the region of interest
+path left_side = (a,0)--(a,ymax);
+path right_side = (b,0)--(b,ymax);
+path bottom = (0,0)--(xmax,0);
+path region = buildcycle(left_side, f, right_side, bottom); // Return the boundary
+
+// Draw those
+fill(region, NEUTRAL_COLOR+opacity(0.5));
+draw(f, BOLD_COLOR);
+draw((x,0)--point(f,x_time), HIGHLIGHT_COLOR+squarecap);
+
+// Make the axes
+real[] T = {a, b, x};
+xaxis(xmin=xmin-0.2, xmax=xmax+0.2,
+ RightTicks("%", T, Size=2pt),
+ Arrows(TeXHead));
+labelx("$a$", a);
+labelx("$x$", x);
+labelx("$b$", b);
+yaxis(ymin=ymin-0.2, ymax=ymax+0.2,
+ Arrows(TeXHead));
Added: trunk/Master/texmf-dist/doc/latex/asy-overview/src/chapter3/asy/zoom.asy
===================================================================
--- trunk/Master/texmf-dist/doc/latex/asy-overview/src/chapter3/asy/zoom.asy (rev 0)
+++ trunk/Master/texmf-dist/doc/latex/asy-overview/src/chapter3/asy/zoom.asy 2024-06-04 19:57:34 UTC (rev 71432)
@@ -0,0 +1,32 @@
+// zoom.asy
+settings.outformat="pdf";
+cd("../../../asy"); import jh; cd(""); define_texpreamble();
+
+import graph;
+
+path generic_fcn_plot = (-0.25,0)..(1,0.35)..(2,0)..(3,-0.25)..(4,0)..(5.25,0.25);
+
+unitsize(1cm);
+real xmin = 0; real xmax = 5;
+real ymin = 0; real ymax = 2.5;
+
+path f = shift(0,1.5)*generic_fcn_plot; // Transform curve by shifting upwards
+real c = 3.1; // x location of tangency
+real c_time = times(f, c)[0];
+pair c_point = point(f,c_time); // Point of tangency
+pair d = dir(f, c_time); // Direction of tangent line
+real t_line_fcn(real x) { return (d.y/d.x)*(x-c_point.x) + c_point.y; }
+path t_line = graph(t_line_fcn, c-0.75, c+0.75);
+
+draw(f, BOLD_COLOR);
+draw(t_line, HIGHLIGHT_COLOR);
+dotfactor = 4;
+dot("$y-f(c)=f'(c)\cdot(x-c)$", c_point, 2*S, HIGHLIGHT_COLOR);
+
+real[] T = {c};
+xaxis(xmin=xmin-0.2, xmax=xmax+0.2,
+ RightTicks("%", T, Size=2pt),
+ Arrows(TeXHead));
+labelx("$c$", c);
+yaxis(ymin=ymin-0.2, ymax=ymax+0.2,
+ Arrows(TeXHead));
Added: trunk/Master/texmf-dist/doc/latex/asy-overview/src/chapter3/asy/zoom_iterate.asy
===================================================================
--- trunk/Master/texmf-dist/doc/latex/asy-overview/src/chapter3/asy/zoom_iterate.asy (rev 0)
+++ trunk/Master/texmf-dist/doc/latex/asy-overview/src/chapter3/asy/zoom_iterate.asy 2024-06-04 19:57:34 UTC (rev 71432)
@@ -0,0 +1,47 @@
+// zoom_iterate.asy
+settings.outformat="pdf";
+cd("../../../asy"); import jh; cd(""); define_texpreamble();
+
+import graph;
+
+path f = GENERIC_FCN_PLOT; // Shorter to type
+real c = 3.1;
+
+string OUTPUT_FN = "zoom_iterate%03d";
+for (int i=0; i<4; ++i) {
+ picture pic; // Generate a new picture
+ size(pic, 3cm, 0); // Will be 3cm wide, scaling units to make it so
+
+ // Zoomed-in window spans c minus delta to c plus delta
+ real delta = 1/2^(i);
+ real xmin = c-delta; real xmax = c+delta;
+
+ // Find f(c) on f, and get f'(c) as a pair
+ real c_time = times(f, c)[0];
+ pair c_point = point(f,c_time);
+ pair d = dir(f, c_time);
+ real t_line_fcn(real x) { return (d.y/d.x)*(x-c_point.x) + c_point.y; }
+ path t_line = graph(t_line_fcn, xmin, xmax);
+
+ // Limits of f to show
+ real left_time = times(f, xmin)[0];
+ real right_time = times(f, xmax)[0];
+ path f_shown = subpath(f, left_time, right_time);
+
+ // Draw f and tangent line
+ transform f_trans = shift(0, 0.5*delta)*shift(0, -1*c_point.y); // Shift f close to axis
+ draw(pic, f_trans*f_shown, BOLD_COLOR);
+ draw(pic, f_trans*t_line, HIGHLIGHT_COLOR);
+ dotfactor = 3;
+ dot(pic, f_trans*c_point, HIGHLIGHT_COLOR);
+
+ // Just the x axis
+ real[] T = {xmin, xmax};
+ xaxis(pic, xmin=xmin, xmax=xmax,
+ RightTicks("%", T, Size=2pt));
+ labelx(pic, format("$c-%03f$",delta), xmin);
+ labelx(pic, format("$c+%03f$",delta), xmax);
+
+ // Produce PDF output file
+ shipout(format(OUTPUT_FN,i), pic);
+}
Added: trunk/Master/texmf-dist/doc/latex/asy-overview/src/chapter3/asy/zoom_times.asy
===================================================================
--- trunk/Master/texmf-dist/doc/latex/asy-overview/src/chapter3/asy/zoom_times.asy (rev 0)
+++ trunk/Master/texmf-dist/doc/latex/asy-overview/src/chapter3/asy/zoom_times.asy 2024-06-04 19:57:34 UTC (rev 71432)
@@ -0,0 +1,23 @@
+// zoom_times.asy
+settings.outformat="pdf";
+cd("../../../asy"); import jh; cd(""); define_texpreamble();
+
+import graph;
+
+unitsize(1cm);
+real xmin = 0; real xmax = 5;
+real ymin = 0; real ymax = 2.5;
+
+path f = shift(0,1.5)*GENERIC_FCN_PLOT; // Shift it up by 1.5 y units
+
+draw(f, BOLD_COLOR);
+
+dotfactor = 4;
+real[] times = {1, 2, 2.5, 3, 4}; // Array of reals
+for (real t : times) {
+ pair pt_t = point(f, t); // Point on curve at that time
+ dot(format("$%0.02f$",t), pt_t, S, HIGHLIGHT_COLOR);
+}
+
+xaxis(xmin=xmin-0.2, xmax=xmax+0.2, Arrows(TeXHead));
+yaxis(ymin=ymin-0.2, ymax=ymax+0.2, Arrows(TeXHead));
Added: trunk/Master/texmf-dist/doc/latex/asy-overview/src/chapter3/chapter3.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/asy-overview/src/chapter3/chapter3.tex (rev 0)
+++ trunk/Master/texmf-dist/doc/latex/asy-overview/src/chapter3/chapter3.tex 2024-06-04 19:57:34 UTC (rev 71432)
@@ -0,0 +1,178 @@
+% Chapter 3 from Asymptote tutorial Jim Hefferon
+\chapter{Paths and pens}
+
+\section{Paths}
+This plots a function that is generic in that it isn't $f(x)=x^2$ or some
+other function derived from a simple expression.
+We will use this it for the classic Calculus
+lesson of zooming in on a point of tangency to
+illustrate that
+the curve is locally well-approximated by the line.
+\begin{center}
+ \includegraphics{chapter3/asy/zoom.pdf}
+\end{center}
+Here is the source of that graphic.
+\begin{center}
+ \inputminted{Asymptote}{chapter3/asy/zoom.asy}
+\end{center}
+Line~7's \mintinline{Asymptote}{generic_fcn_plot} is a
+\mintinline{Asymptote}{path}.
+It joins some points
+with smooth curves, using the \mintinline{Asymptote}{..} operator.
+(I often use this path
+so I included a copy in \path{jh.asy}
+as \mintinline{Asymptote}{GENERIC_FCN_PLOT}.)
+Earlier, when we drew a vertical asymptote line we instead connected two
+points with a \mintinline{Asymptote}{--} operator, which gives a line segment.
+
+In line~17, \Asy's
+\mintinline{Asymptote}{dir(..)} command gives the direction of the
+tangent line as a unit vector.
+The two lines after that produce its graph.
+As part of this, line~18 uses that \mintinline{Asymptote}{d.y} is the second
+component of the pair \mintinline{Asymptote}{d}
+and \mintinline{Asymptote}{d.x} is its first component,
+so the tangent line's slope is the ratio
+\mintinline{Asymptote}{d.y/d.x}.
+
+As to line~15's \mintinline{Asymptote}{c_time = times(f, c)[0]},
+\Asy{} joins the points with piecewise cubic Bézier curves,
+just as \MF{} and \MP{} do.
+These curves are
+parametrized by a variable called `time'.
+By definition, the initial point $(0,-25)$ is at time~$0$, the next point
+$(1,0.35)$ is at time~$1$, etc.
+(To forestall any confusion:~the time has nothing to do with the
+first coordinate, it comes from when the point is specified in the
+path.)
+Intermediate points have intermediate times.
+This illustrates, showing some times.
+\begin{center}
+ \includegraphics{chapter3/asy/zoom_times.pdf}
+\end{center}
+The \mintinline{Asymptote}{times(..)} command returns an array of times
+where the path it intersects the vertical line
+$x=\text{\mintinline{Asymptote}{c}}$.
+We extract the first one (in this case the only one) with the
+\mintinline{Asymptote}{[0]}.
+Then line~16's \mintinline{Asymptote}{c_point = point(f,c_time)} returns
+that point as a \mintinline{Asymptote}{pair}.
+(Incidentally, the time points need not be evenly spaced on a curve, meaning that
+there may be a different arc length between $t=2.0$ and~$2.5$ than there is
+between $t=2.5$ and~$3.0$.)
+
+The source for the prior graphic shows two useful aspects of
+\Asy{} that are new.
+\begin{center}
+ \inputminted{Asymptote}{chapter3/asy/zoom_times.asy}
+\end{center}
+The first aspect is in line~19.
+The \mintinline{Asymptote}{format("$%0.02f$",t)}
+turns the floating point number~$t$ into the string used in the label.
+
+A larger point is in lines~17 through~20, where the code has an iteration.
+One strength of \Asy{} is that it is a standard programming language,
+with clean constructs that are like those you use in other languages
+in your daily work.
+This iteration is over an array but an integer iteration
+\mintinline{Asymptote}{for(int i=0; i<4; ++i)}
+is in the next example.
+
+That next example shows zooming in on the
+point of tangency in four steps.
+Here's the output.
+\begin{center}
+ \hspace{2em}%
+ \vcenteredhbox{\includegraphics{chapter3/asy/zoom_iterate000.pdf}}%
+ \hspace{1em plus 1fill}%
+ \vcenteredhbox{\includegraphics{chapter3/asy/zoom_iterate001.pdf}}%
+ \hspace{1em plus 1fill}%
+ \vcenteredhbox{\includegraphics{chapter3/asy/zoom_iterate002.pdf}}%
+ \hspace{1em plus 1fill}%
+ \vcenteredhbox{\includegraphics{chapter3/asy/zoom_iterate003.pdf}}%
+ \hspace*{2em}%
+\end{center}
+
+The source \path{asy/zoom_iterate.asy}
+is more complex than the others that we have seen.
+One reason is that this one file produces four pictures,
+so that we needn't maintain
+four separate \path{.asy} files with lots of overlap.
+The four output files are produced in the loop between lines~11 and~47.
+Line~12 creates a new
+\mintinline{Asymptote}{picture}
+and line~46 outputs it.
+The files are named
+\path{zoom_iterate000.pdf} \ldots{} \path{zoom_iterate003.pdf};~the
+form of that name is given by the string
+\mintinline{Asymptote}{OUTPUT_FN}.
+\begin{center}
+ \inputminted{Asymptote}{chapter3/asy/zoom_iterate.asy}
+\end{center}
+
+Besides using a single input to create multiple output files,
+there are two other things that are new here.
+One is line~13's
+\mintinline{Asymptote}{size(pic, 3cm, 0)}.
+This makes each output graphic be three centimeters wide, and as tall as
+required, setting the size of the $x$ and~$y$ units as needed to
+get that width.
+The result is a zooming-in on successively shorter intervals of the $x$~axis.
+
+The other new thing
+is that when the $x$~axis interval is small, rescaling the units to make the
+entire figure three centimeters wide
+would put the plotted function very far above the
+$x$~axis.
+So we have moved the function down near the axis.
+This transformation applies not just to the function but also to the tangent
+line and to the point $(c,f(c))$, so we have broken this
+transformation out as a separate thing,
+line~32's
+\mintinline{Asymptote}{transform f_trans = shift(0,0.5*delta)*shift(0,-1*c_point.y)}.
+Transformations are applied with the star operator,
+as on lines~33, 34, and~36.
+
+In the next section we will see one more thing about paths,
+that if a path is closed then we can fill it.
+
+
+
+
+
+\section{Pens}
+When you draw something you need to specify some properties, such as its color
+or thickness if you are drawing a curve, or the font if you are
+writing text.
+\Asy{} binds those properties together as a
+\mintinline{Asymptote}{pen}.
+
+This source gives a picture showing the area computed with $\int_{a}^{b}f(x)\,dx$.
+\begin{center}
+ \inputminted{Asymptote}{chapter3/asy/integral.asy}
+\end{center}
+Here is the resulting graphic.
+\begin{center}
+ \includegraphics{chapter3/asy/integral.pdf}
+\end{center}
+The
+\mintinline{Asymptote}{buildcycle(left_side, f, right_side, bottom)}
+on line~20 is new.
+It takes the paths surrounding the region of interest and
+constructs the path that is its boundary.
+(A more common way to make a cyclic path is to end with
+\mintinline{Asymptote}{cycle}, as with
+\mintinline{Asymptote}{path triangle = (0,0)--(0,1)--(1,0)--cycle}.)
+
+Then line~23's \mintinline{Asymptote}{fill(region, NEUTRAL_COLOR+opacity(0.5))}
+covers the region using a pen that, in addition to
+its color, allows some of the material behind it to show through.
+Note that some PDF viewers have trouble with opacity so your results may vary,
+but one viewer that gives good results is Adobe's Reader.
+
+The \Asy{} reference gives many options for pens.
+Another is on line~25 where we draw the slice
+using the pen
+\mintinline{Asymptote}{HIGHLIGHT_COLOR+squarecap} so that the
+slice bottom lies flat on the axis.
+
Property changes on: trunk/Master/texmf-dist/doc/latex/asy-overview/src/chapter3/chapter3.tex
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: trunk/Master/texmf-dist/doc/latex/asy-overview/src/chapter4/asy/planes.asy
===================================================================
--- trunk/Master/texmf-dist/doc/latex/asy-overview/src/chapter4/asy/planes.asy (rev 0)
+++ trunk/Master/texmf-dist/doc/latex/asy-overview/src/chapter4/asy/planes.asy 2024-06-04 19:57:34 UTC (rev 71432)
@@ -0,0 +1,46 @@
+// planes.asy
+settings.outformat="pdf";
+settings.tex="pdflatex";
+settings.prc = true;
+settings.render = 0;
+cd("../../../asy"); import jh; cd(""); define_texpreamble();
+
+import graph3;
+projection default_projection = orthographic(3,1.5,0.5,up=Z);
+currentprojection = default_projection;
+currentlight = nolight;
+
+size3(0,5cm,0,keepAspect=true); // Make y=5cm tall
+
+// Define surfaces
+real rotation_degs = 30;
+path3 xy_edge = (0,0,0)--(3,0,0)--(3,4,0)--(0,4,0)--cycle;
+surface xy = surface(xy_edge);
+transform3 p_t = shift((0,2,0))*rotate(rotation_degs, X)*shift((0,-2,0));
+path3 p_edge = p_t*xy_edge;
+surface p = p_t*xy;
+
+// Draw surfaces
+draw(xy, surfacepen=figure_material);
+draw(xy_edge, boundary_pen);
+draw(p, surfacepen=figure_material);
+draw(p_edge, boundary_pen);
+
+// Draw the line of intersection
+draw((0,2,0)--(3,2,0), boundary_pen);
+
+// Normal vectors
+path3 n = (0,0,0)--(0,0,1.5);
+path3 n_xy = shift((3,2,0))*n;
+path3 n_p = p_t*shift((3,2,0))*n;
+draw(n_xy, HIGHLIGHT_COLOR, Arrow3(DefaultHead2));
+draw(n_p, HIGHLIGHT_COLOR, Arrow3(DefaultHead2));
+
+// Arc showing angle between normals
+triple v1 = (0,0,0.4); // Radius of the arc
+triple v2 = rotate(rotation_degs,X)*(v1);
+path3 n_angle_arc = arc(O, v1, v2);
+draw("$\theta$", shift((3,2,0))*n_angle_arc,
+ HIGHLIGHT_COLOR, Arrow3(DefaultHead2)); // Angle between normals
+draw("$\theta$", shift((3,2,0))*rotate(-90,X)*n_angle_arc,
+ HIGHLIGHT_COLOR, Arrow3(DefaultHead2)); // Angle between planes
Added: trunk/Master/texmf-dist/doc/latex/asy-overview/src/chapter4/asy/vectors.asy
===================================================================
--- trunk/Master/texmf-dist/doc/latex/asy-overview/src/chapter4/asy/vectors.asy (rev 0)
+++ trunk/Master/texmf-dist/doc/latex/asy-overview/src/chapter4/asy/vectors.asy 2024-06-04 19:57:34 UTC (rev 71432)
@@ -0,0 +1,55 @@
+// vectors.asy
+settings.outformat = "pdf";
+settings.tex = "pdflatex"; // For compiling in-pic text
+settings.prc = true; // Manipulable in a PDF file
+settings.render = 0; // Needed for "poster" image, i.e., picture to click on
+cd("../../../asy"); import jh; cd(""); define_texpreamble();
+
+import fontsize;
+
+import graph3;
+projection default_projection = orthographic(1,2,0.5,up=Z);
+currentprojection = default_projection;
+currentlight = nolight; // Avoid shadows
+
+unitsize(0.5cm);
+real xmin = 0; real xmax = 5;
+real ymin = 0; real ymax = 5;
+real zmin = 0; real zmax = 5;
+
+// Randomize: uncomment these to get a good seed, then use it in srand(..seed..).
+// int secs = seconds();
+// write(format("Seed for srand is %d",secs));
+// srand(secs);
+srand(1716139271);
+
+// Draw the vector in canonical position
+triple displacement = (2,1,1);
+draw((0,0,0)--displacement, HIGHLIGHT_COLOR, Arrow3(DefaultHead2));
+
+// Draw more of the same vector, offset from the origin
+int num_vector_target = 8;
+int num_vectors = 0;
+while (num_vectors < num_vector_target) {
+ real x_init = xmin+(xmax-xmin)*unitrand();
+ real y_init = ymin+(ymax-ymin)*unitrand();
+ real z_init = ymin+(ymax-ymin)*unitrand();
+ if ((x_init+displacement.x <= xmax) // Only draw if vector falls in picture
+ && (y_init+displacement.y <= ymax)
+ && (z_init+displacement.z <= ymax)) {
+ num_vectors = num_vectors+1;
+ triple init = (x_init,y_init,z_init);
+ draw(init--(init+displacement), BOLD_COLOR, Arrow3(DefaultHead2));
+ }
+}
+
+// Axes; note it says OutTicks instead of LeftTicks or RightTicks
+xaxis3("{\scriptsize $x$}", xmin=xmin, xmax=xmax+0.2,
+ OutTicks(Step=1, OmitTick(0), Size=2pt),
+ Arrow3(TeXHead2));
+yaxis3("{\scriptsize $y$}", ymin=ymin, ymax=ymax+0.2,
+ OutTicks(Step=1, OmitTick(0), Size=2pt),
+ Arrow3(TeXHead2));
+zaxis3("{\scriptsize $z$}", zmin=zmin, zmax=zmax+0.2,
+ OutTicks(Step=1, OmitTick(0), Size=2pt),
+ Arrow3(TeXHead2));
Added: trunk/Master/texmf-dist/doc/latex/asy-overview/src/chapter4/asy/washer.asy
===================================================================
--- trunk/Master/texmf-dist/doc/latex/asy-overview/src/chapter4/asy/washer.asy (rev 0)
+++ trunk/Master/texmf-dist/doc/latex/asy-overview/src/chapter4/asy/washer.asy 2024-06-04 19:57:34 UTC (rev 71432)
@@ -0,0 +1,48 @@
+// washer.asy
+settings.tex = "pdflatex";
+settings.outformat = "pdf";
+settings.render = 8; // Tweaked this until poster pic looked better
+settings.prc = true;
+cd("../../../asy"); import jh; cd(""); define_texpreamble();
+
+import graph3;
+projection default_projection = orthographic(3,1.5,0.5,up=Z);
+currentprojection = default_projection;
+currentlight = nolight;
+
+size3(0,5cm,0,keepAspect=true);
+
+real square(real x) {return x^2;}
+real ident(real x) {return x;}
+path f = graph(square, 0, 1);
+path fa = graph(ident, 0, 1);
+
+real c = 0.4; // Pt on y axis where slice is taken
+real delta_y = 0.2; // Thickness of washer
+
+// Make the washer
+transform3 washer_t = shift(0,c,0)*rotate(90, X);
+surface washer = washer_t*surface(reverse(scale(sqrt(c))*unitcircle) ^^ scale(c)*unitcircle);
+
+// Draw the washer
+draw(washer_t*scale3(c)*unitcircle3, HIGHLIGHT_COLOR);
+draw(washer_t*scale3(sqrt(c))*unitcircle3, HIGHLIGHT_COLOR);
+draw(washer, surfacepen=slice_material, light=nolight);
+
+// Draw the xy-plane area
+path3 pth = path3(fa&f); // Two paths joined with `&'
+draw(pth, gray(0.5));
+draw((c,c,0)--(sqrt(c),c,0), HIGHLIGHT_COLOR);
+draw(circle((0,1,0), 1, normal=Y), gray(0.5));
+
+// Draw surface of revolution formed by xy-plane area
+surface region = surface(pth, c=O, axis=Y);
+draw(region, surfacepen=figure_material, light=nolight);
+
+// Axes
+xaxis3(Label("$x$",position=EndPoint, align=W),
+ 0,1.5, black, Arrow3(TeXHead2));
+yaxis3(Label("$y$"),
+ 0,1.75, black, Arrow3(TeXHead2));
+zaxis3(Label(""),\
+ 0,1.25, black, Arrow3(TeXHead2));
Added: trunk/Master/texmf-dist/doc/latex/asy-overview/src/chapter4/chapter4.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/asy-overview/src/chapter4/chapter4.tex (rev 0)
+++ trunk/Master/texmf-dist/doc/latex/asy-overview/src/chapter4/chapter4.tex 2024-06-04 19:57:34 UTC (rev 71432)
@@ -0,0 +1,151 @@
+% Chapter 4 from Asymptote tutorial Jim Hefferon
+\def\asydir{chapter4/asy/}
+\chapter{3D}
+
+A strength of \Asy{} is its ability in three dimensions.
+It can easily draw what you want to draw, including
+% that it extends to three dimensions constructs for good-looking paths
+% that come from two-dimensional \MF{} and \MP.
+doing projections, which can be tricky to get right by eye.
+
+In addition, you can choose to make these graphics manipulable, so that you can
+use your mouse to turn them around or peek under them, and in
+general have an explore.
+This is great for a Calculus lecture so its what I'm showing here.
+
+Note that only some PDF viewers let you manipulate.
+For instance, Adobe's Reader works but the readers embedded in web
+browsers do not.
+To test your reader just click on the graphic below.
+(You may be asked to let the reader
+run the code that does the manipulation.)
+
+We start with a picture showing the vector of displacements $(2,1,1)$ at a
+number of initial points.
+% \begin{center}
+% \asyinclude{chapter4/asy/vectors}
+% \end{center}
+\begin{center}
+ \input chapter4/asy/vectors.tex
+\end{center}
+
+The input code has two different things going on.
+First, so that the vectors are scattered about,
+in lines 34--36 they get a randomly-chosen initial point.
+The randomization uses the seed from line~24.
+To find that number I uncommented lines 21--23 and commented out line~24,
+compiled the \path{.asy} file a couple of times
+until I got a scatter that I liked, and then I froze the seed.
+With that, the loop in
+lines~33--44 creates a randomly placed vector and
+draws it if the entire vector will show,
+until there are such eight vectors.
+\begin{center}
+ \inputminted{Asymptote}{chapter4/asy/vectors.asy}
+\end{center}
+The other thing in the code is the 3D stuff.
+It is surprisingly like the 2D constructs that we have seen.
+Line~10's
+\mintinline{Asymptote}{import graph3} gives access to
+\Asy's 3D routines, and extends them to axes and graph plotting.
+Some things are new, such as that instead of
+\mintinline{Asymptote}{pair}'s
+you want
+\mintinline{Asymptote}{triple}'s,
+and instead of
+\mintinline{Asymptote}{xaxis(..)}
+you say
+\mintinline{Asymptote}{xaxis3(..)}.
+But much of it is at least similar.
+
+The next graphic shows surfaces,
+which are genuinely different than what we saw in 2D.
+It illustrates that the angle between two
+intersecting planes is the same as the angle between their normal
+vectors.
+% \begin{center}
+% \asyinclude{chapter4/asy/planes.asy}
+% \end{center}
+\begin{center}
+ \vcenteredhbox{\input chapter4/asy/planes.tex }%
+\end{center}
+We can imagine that lines~19 and~20 set the location of the camera
+that is taking this picture.
+Even if we use a reader where the image is manipulable,
+we need a starting view.
+\begin{center}
+ \inputminted{Asymptote}{chapter4/asy/planes.asy}
+\end{center}
+
+This graphic's code
+spotlights the power of transforms.
+We don't have to give the equations of the planes or specify their normals.
+Instead, in line~17 we define the edge of
+the horizontal plane region and then in line~18 we create that
+as a surface.
+To get the other plane, the one at an angle,
+we make a transform \mintinline{Asymptote}{p_t} in line~19
+that basically rotates by \mintinline{Asymptote}{rotation_degs}
+about the $x$~axis.
+The new plane with its edge and its normal vector
+then comes from applying that transform
+to the horizontal plane, its edge, and its normal.
+
+To color the surfaces, in lines~24 and~26 we use
+\mintinline{Asymptote}{figure material}.
+We will reuse these later so the definition is in \path{jh.sty};
+see lines~28--35 in the Appendix.
+This coloring involves \mintinline{Asymptote}{opacity(..)} and
+note that you can indeed see through the planes to some extent.
+
+Finally, in lines~40--46 we take advantage of one of \Asy's many helper functions
+to find and draw the arc of the angle between the planes and the normals.
+
+Our last graphic is from the Calculus~I lecture on the volume of
+a surface of revolution, specifically using slices that are
+washers.
+We start with the $xy$~plane area between $y=x^2$ and $y=x$,
+here defined as line~33's \mintinline{Asymptote}{pth}.
+\begin{center}
+ \inputminted{Asymptote}{chapter4/asy/washer.asy}
+\end{center}
+In line~39 \Asy{} rotates that area about the $y$~axis, giving the 3D figure.
+% \begin{center}
+% \asyinclude{chapter4/asy/washer.asy}
+% \end{center}
+\begin{center}
+ \vcenteredhbox{\input chapter4/asy/washer.tex }%
+\end{center}
+
+
+
+
+
+\section{Include the graphic in a \LaTeX{} file}
+To illustrate including 3D output in your document we use
+\path{asy/vectors.asy}.
+Create the \LaTeX{} file \path{main_3d.tex}.
+\begin{center}
+ \inputminted{TeX}{chapter4/main_3d.tex}
+\end{center}
+Run \LaTeX{}.
+\begin{minted}{Bash}
+jim at millstone:~/Documents/asy_tut/src/chapter4$ pdflatex main_3d
+\end{minted}
+(As outlined in the document,
+another option that many people prefer
+is to instead use \mintinline{TeX}{\asyinclude{..}}.
+For that you first run \LaTeX{}, then go to the \path{asy/} subdirectory and
+run \mintinline{Bash}{asy -inlineimage main_3d-1} and then return
+to the starting to directory to run \LaTeX{} on the above document a
+second time.)
+Here is a shot of the output.
+\begin{center}
+ \framebox{\includegraphics[page=1,scale=0.325,trim=0.25in 5in 0.25in 0.25in]{chapter4/main_3d.pdf}}
+\end{center}
+In that output PDF,
+you should be able to click on the graphic and move it around
+(of course, your reader must supports this).
+
+
+
Property changes on: trunk/Master/texmf-dist/doc/latex/asy-overview/src/chapter4/chapter4.tex
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: trunk/Master/texmf-dist/doc/latex/asy-overview/src/chapter4/main_3d.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/asy-overview/src/chapter4/main_3d.tex (rev 0)
+++ trunk/Master/texmf-dist/doc/latex/asy-overview/src/chapter4/main_3d.tex 2024-06-04 19:57:34 UTC (rev 71432)
@@ -0,0 +1,24 @@
+% main_3d.tex LaTeX demonstraton file showing Asymptote 3D, Jim Hefferon
+\documentclass{article}
+\usepackage{graphicx}
+\graphicspath{ {asy/} } % Trailing slash, dirs in curly braces
+\usepackage{asymptote}
+\def\asydir{asy} % No trailing slash
+% For non-manipulable 3D figures, just compile with "asy vectors" and
+% include the PDF output as with 2D figures.
+% For manipulable 3D figures:
+% (1) Compile .asy file with "asy -inlineimage vectors".
+% It outputs a number of files, including .tex and .pre files.
+% (2) Include the .pre line here along with one of the lines in center below
+\input asy/vectors.pre
+
+\begin{document}
+Include the output graphic directly in the text body.
+\begin{center}
+% \asyinclude{asy/vectors.asy}
+ \input asy/vectors.tex %
+\end{center}
+If you use the commented-out way then run
+\texttt{asy -inlinimage <latex-fn>-1}
+between a pair of \LaTeX{} runs of this file.
+\end{document}
Property changes on: trunk/Master/texmf-dist/doc/latex/asy-overview/src/chapter4/main_3d.tex
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: trunk/Master/texmf-dist/doc/latex/asy-overview/src/cover/cover.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/asy-overview/src/cover/cover.tex (rev 0)
+++ trunk/Master/texmf-dist/doc/latex/asy-overview/src/cover/cover.tex 2024-06-04 19:57:34 UTC (rev 71432)
@@ -0,0 +1,28 @@
+% Cover from Asymptote tutorial Jim Hefferon
+\thispagestyle{empty}
+\begin{center}
+ \setlength{\unitlength}{1in}
+ \begin{picture}(6,8.5)(-0.25,-0.20)
+ \put(0,8){\begin{minipage}[t]{6in}
+ \begin{center}
+ \Huge\bf {\color{bold_color}First impressions of \Asy}
+ \end{center}
+ \end{minipage}}
+ \put(0,4.25){\begin{minipage}[t]{6in}
+ \centering
+ \vcenteredhbox{\includegraphics[height=6in]{cover/pp.jpg}}
+ \end{minipage}}
+ \put(0,0.75){\begin{minipage}[t]{6in}
+ \begin{center}
+ \LARGE {\color{name_color}Jim Hef{}feron}
+ \end{center}
+ \end{minipage}}
+\end{picture}
+\end{center}
+
+\newpage\thispagestyle{empty}
+\vspace*{\fill}
+\begin{flushright}
+Cover image C E Brock. Public domain, via Wikimedia Commons.
+\end{flushright}
+
Property changes on: trunk/Master/texmf-dist/doc/latex/asy-overview/src/cover/cover.tex
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: trunk/Master/texmf-dist/doc/latex/asy-overview/src/cover/pp.jpg
===================================================================
(Binary files differ)
Index: trunk/Master/texmf-dist/doc/latex/asy-overview/src/cover/pp.jpg
===================================================================
--- trunk/Master/texmf-dist/doc/latex/asy-overview/src/cover/pp.jpg 2024-06-04 19:56:34 UTC (rev 71431)
+++ trunk/Master/texmf-dist/doc/latex/asy-overview/src/cover/pp.jpg 2024-06-04 19:57:34 UTC (rev 71432)
Property changes on: trunk/Master/texmf-dist/doc/latex/asy-overview/src/cover/pp.jpg
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/octet-stream
\ No newline at end of property
Added: trunk/Master/texmf-dist/doc/latex/asy-overview/src/preface/preface.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/asy-overview/src/preface/preface.tex (rev 0)
+++ trunk/Master/texmf-dist/doc/latex/asy-overview/src/preface/preface.tex 2024-06-04 19:57:34 UTC (rev 71432)
@@ -0,0 +1,53 @@
+% Preface to Asymptote overview by Jim Hefferon
+\chapter*{Preface}
+\Asy{} is a language for drawing mathematical figures.
+It outputs vector graphics and fits well with \TeX, \LaTeX{}, and friends.
+It is great with two-dimensional graphics
+but it also sparkles with three dimensions,
+including that it
+extends to 3D algorithms from \MF{} and \MP{} that are elegant and that
+give beautiful curves.
+
+Last year I made a careful set of lecture slides for
+Calculus~I and~II, and
+I drew the figures with \Asy.
+It is wonderfully well-suited to the job.
+
+However, recently I mentioned this success to someone, who later told
+me that
+they had an online search for \Asy{} and found a technical reference,
+a long tutorial, and a gallery with many graphics,
+but really no quick overview.
+Rather than tackle what was there,
+they stuck with what they were using.
+
+Hence this document.
+It is short, adopting a few familiar Calculus graphics.
+It gives a feel for what you can do with \Asy, without being
+too much
+(although I believe that the examples use every feature of
+\Asy{} that I used for my lectures).
+You can work through it in an afternoon.
+If you do elect to try \Asy{} then
+\href{https://asymptote.sourceforge.io/}{its web site}
+has many more advanced resources.
+
+I hope that it is a help.
+
+\medskip\noindent
+\textit{Remark:} This is an introduction.
+Often I will do something one way, showing one option, when there
+are many ways to do it.
+For instance, you can include \Asy{} source in your \LaTeX{} document
+but here I have the source as standalone files.
+Another example is that I will take the \Asy{} files to be in a
+\path{asy/} subdirectory,
+while of course you can organize your work in many different ways.
+Showing only one option is just a question of going shorter.
+
+\medskip
+\begin{flushleft}
+Jim Hef{}feron \\
+University of Vermont \\
+2024-May-26
+\end{flushleft}
\ No newline at end of file
Property changes on: trunk/Master/texmf-dist/doc/latex/asy-overview/src/preface/preface.tex
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Modified: trunk/Master/tlpkg/bin/tlpkg-ctan-check
===================================================================
--- trunk/Master/tlpkg/bin/tlpkg-ctan-check 2024-06-04 19:56:34 UTC (rev 71431)
+++ trunk/Master/tlpkg/bin/tlpkg-ctan-check 2024-06-04 19:57:34 UTC (rev 71432)
@@ -61,7 +61,7 @@
askinclude askmaps asmeconf asmejour aspectratio
assignment association-matrix assoccnt asternote astro asyfig
asymptote-faq-zh-cn asymptote-by-example-zh-cn asymptote-manual-zh-cn
- asypictureb atbegshi atenddvi atendofenv atkinson atveryend
+ asy-overview asypictureb atbegshi atenddvi atendofenv atkinson atveryend
attachfile attachfile2
aucklandthesis augie auncial-new aurical aurl
auto-pst-pdf-lua autobreak autopdf
Added: trunk/Master/tlpkg/tlpsrc/asy-overview.tlpsrc
===================================================================
Modified: trunk/Master/tlpkg/tlpsrc/collection-langenglish.tlpsrc
===================================================================
--- trunk/Master/tlpkg/tlpsrc/collection-langenglish.tlpsrc 2024-06-04 19:56:34 UTC (rev 71431)
+++ trunk/Master/tlpkg/tlpsrc/collection-langenglish.tlpsrc 2024-06-04 19:57:34 UTC (rev 71432)
@@ -11,6 +11,7 @@
depend amslatex-primer
depend around-the-bend
depend ascii-chart
+depend asy-overview
depend biblatex-cheatsheet
depend components
depend comprehensive
More information about the tex-live-commits
mailing list.