Latex+Asymptote: embed 3D figure in pdf file under windows

Asymptote is a powerful graphics language that can produce pdf with 3D feature and be easily integrated with Latex.

Here are the steps needed to produce this pdf under windows, with TexMaker and MikTeK and of course asymptote.

First, installation:

  1. Install TexMaker (and MikTex or TexLive depending of your OS). Follow the french instructions here.
  2. Install Asymptote from the guide here. The installation of ImageMagic is not necessary. But psview and Ghostscript are needed. Remind that asymptote uses mingw.
  3. Configure TexMaker:
    1. The executable of asymptote should be set in Option -> Configure -> Commands. See this.
    2. The ‘Compilation Rapide’ or quick compil should be changed to the setting “PdfLatex + Asymptote + PdfLatex + Voir Pdf”. See here.

Then, use it:

  1. Download and expand the following archive (zip)
  2. Compile the TestAsymptote.tex file (this file is well inspired from the asymptote example). With Texmaker it is just openning the file and pressing ‘F1’. The pdf  file should be created.

Futur use:

  1. Remember to copy the asymptote.asy file in your project directory (included into the archive)
  2. The example I do is reading two ASCII text files and displaying the data in an interactive 3D box with axis.

 

More reading on this topic


Posted

in

by

Tags: