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

Learn LaTeX easily with newest books:

The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis

The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more

LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis

User avatar
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