Graphics, Figures & TablesAsymptote, LaTeX integration

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
sgp
Posts: 30
Joined: Thu Jul 22, 2010 11:45 am

Asymptote, LaTeX integration

Post by sgp »

hi all,
i installed asymptote.exe that i downloaded from the sourceforge homepage. i dont know what to do next.

i tried this code from a pdf. but its showing many errors. should i add path or something like that to make LaTeX detect that asymtote is there in my system.

Code: Select all

\documentclass{article}
\usepackage[pdftex]{graphicx}
\usepackage{asymptote}
\begin{document}
\begin{figure}
\centering
\begin{subfloatenv}{Square.}
\begin{asy}
size(3cm,0);
fill(unitsquare,red);
\end{asy}
\label{fig:shapes:square}
\end{subfloatenv}\hfill%
\begin{subfloatenv}{Triangle.}
\begin{asy}
size(3cm,0);
fill(2N--E--W--cycle,green);
\end{asy}
\label{fig:shapes:triangle}
\end{subfloatenv}\hfill%
\begin{subfloatenv}{Circle.}
\begin{asy}
size(3cm,0);
fill(unitcircle,blue);
\end{asy}
\label{fig:shapes:circle}
\end{subfloatenv}
\caption{Threegeometricshapes.}
\label{fig:shapes}
\end{figure}

\end{document}
thanks in advance,
regards,
sgp.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Asymptote, LaTeX integration

Post by localghost »

At first I think you should read the integration guide (Section 2.2 - Compatibility with the subfig package, p. 4ff; with special attention to Figure 8) very carefully to learn what misses in your code sample [1]. And the asymptote manual (Chapter 7 - LaTeX Usage, p. 82ff) should leave no questions unanswered.

[1] Homepage of Dario Teixeira: Asymptote and LaTeX


Best regards
Thorsten
Post Reply