-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
generate prefigure assets using prefigure namespace (#864)
* generate prefigure assets using prefigure namespace * format * add test for prefigure * update changelog * format --------- Co-authored-by: Oscar Levin <[email protected]>
- Loading branch information
1 parent
41f08b3
commit 8b480a7
Showing
8 changed files
with
82 additions
and
47 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
|
||
<pretext xmlns:xi="http://www.w3.org/2001/XInclude"> | ||
<book> | ||
<title>Asymptote</title> | ||
<chapter xml:id="ch-foo"> | ||
<title>foo</title> | ||
<image xml:id="test"> | ||
<asymptote> | ||
size(4cm,6cm); | ||
pen canadared=rgb(235/256,45/256,55/256); | ||
real flagwidth=4, flagheight=2; | ||
path flag_outline=scale(flagwidth,flagheight)*unitsquare; | ||
path cbar1=scale(1,2)*unitsquare, cbar2=shift(3,0)*cbar1; | ||
path mapleleafleft= | ||
(0,-102) --(-5,-102)--(-2,-56) {dir(87)}..{dir(190)} | ||
(-8,-53) --(-51,-61)--(-45,-45){dir(70)}..{dir(141)} | ||
(-46,-41)--(-94,-3) --(-82,1) {dir(25)}..{dir(108)} | ||
(-81,6) --(-90,34) --(-63,29) {dir(348)}..{dir(67)} | ||
(-59,30) --(-54,43) --(-33,20) {dir(313)}..{dir(101)} | ||
(-27,23) --(-38,76) --(-21,62) {dir(330)}..{dir(63)} | ||
(-16,67) --(0,100); | ||
path mapleleafright=reflect((0,0),(0,1))*reverse(mapleleafleft); | ||
path mapleleaf=mapleleafleft--mapleleafright--cycle; | ||
filldraw(flag_outline,white,black); | ||
fill(cbar1,canadared); | ||
fill(cbar2,canadared); | ||
fill(shift(2,1)*scale(.008)*mapleleaf,canadared); | ||
draw(flag_outline); | ||
</asymptote> | ||
</image> | ||
|
||
<image width="60%"> | ||
<prefigure label="pftest" | ||
xmlns="https://prefigure.org"> | ||
<diagram dimensions="(300,300)" margins="5"> | ||
<definition>f(t,y) = (y[1], -pi*y[0]-0.3*y[1])</definition> | ||
<coordinates bbox="[-1,-3,6,3]"> | ||
<grid-axes xlabel="t"/> | ||
<de-solve function="f" t0="0" t1="bbox[2]" | ||
y0="(0,2)" name="oscillator" | ||
N="200"/> | ||
<plot-de-solution at="x" solution="oscillator" | ||
axes="(t,y0)" /> | ||
<plot-de-solution at="xprime" solution="oscillator" | ||
axes="(t,y1)" stroke="red" | ||
tactile-dash="9 9"/> | ||
<legend at="legend" anchor="(bbox[2], bbox[3])" | ||
alignment="sw" scale="0.9" opacity="0.5"> | ||
<item ref="x"><m>x(t)</m></item> | ||
<item ref="xprime"><m>x'(t)</m></item> | ||
</legend> | ||
</coordinates> | ||
</diagram> | ||
</prefigure> | ||
</image> | ||
</chapter> | ||
</book> | ||
</pretext> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters