Script Summary: READ DESCRIPTION - Converts psTricks (geogebra) to Asymptote
In the Geogebra 4.0 Beta version (currently available at http://www.geogebra.org/webstart/4.0/), use the option
File > Export > Graphics View as Asymptote ... which contains a more comprehensive and bug-proof export option. Some documentation is available at http://www.artofproblemsolving.com/Wiki/index.p....
Converts GeoGebra psTricks-data into Asymptote syntax. To use:
Open the PSTricks data in GeoGebra. To do so, in GeoGebra, on the top menu, go to
File > Export > Graphic Views as PSTricks (or similar), or press
Ctrl+Shift+T. Customize any of the desired options, and then click
Generate PSTricks, and copy (
Ctrl+A, Ctrl+C) the resulting code.
Paste the code in any Firefox text form (e.g, a forum post), then highlight/select the pasted code. Press
Ctrl+Alt+J, and the PSTricks syntax will be converted to Asymptote syntax. To compactify the resulting code, re-select the code with
Ctrl+A (not the mouse) and press
On the AoPS/ML forums:
To use the built-in GeoGebra extension on the forums, click on the GeoGebra button, then double click the resulting small GeoGebra popup window for the full version, and then press
Ctrl+Shift+T to retrieve the PSTricks data. Then, follow the steps above.
On AoPS/ML forum and blog posts, a button stating
Convert GGB to ASY will be added to the button menu on top of the post textarea. If nothing in the textarea is highlighted, then clicking on the button will convert any PSTricks data in the post to Asymptote syntax (note: it does not add the
asy tags itself, and it may also tamper any non-PSTricks text in the textarea). This code will be automatically compactified. Alternatively, if anything in the textarea is highlighted, then clicking on the button will convert any PSTricks data in the highlighted selection to Asymptote syntax (again,
asy tags are not added).
Caution: The conversion only works on PSTricks generated by Geogebra. It will lose certain data, including dot colors and fill colors (both deliberately; dot colors to avoid default coloring, and fill transparency is more difficult to implement in asymptote), as well as axes/grids. Certain complicated LaTeX textboxes in Geogebra code may cause the Asymptote code to give an error, and colored/bold/etc textboxes are not fully supported. Labels may appear in slightly different positions relative to their positions in the Geogebra diagram.
- To change the size of the Asymptote diagram, edit the line
- To change the default pen, edit the line
dp = linewidth(0.7) + fontsize(10);.
- To change the style of all dots in the Asymptote diagram, edit the line
pen dotstyle = black;or
pen ds = black;.
- To change the distance of labels from their respective points, edit the line
real labelscalefactor = 0.5;or
real lsf = 0.5;. Alternatively, increase the size of the diagram or decrease the default font size.
- To change the Asymptote window, edit the line containing the