Graphics, Figures & Tablesasymptote | Problem in Texmaker

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
mich202
Posts: 2
Joined: Sun Nov 06, 2011 12:19 pm

asymptote | Problem in Texmaker

Post by mich202 »

I'm trying to insert *.asy figures into Texmaker LaTeX code. Everything looks well. There is a text but there is no graphics in DVI file, no error messages. Any suggestions?

Texmaker 2.2.1, Asymptote 2.02 / Ubuntu

Here is my LaTeX Code:

Code: Select all

\documentclass[a4paper,10pt]{article}
\usepackage[utf8x]{inputenc}
\usepackage{asymptote}
\begin{document}
\begin{figure}
\centering
\begin{asy}
size (3cm);
draw (unitcircle);
\end{asy}
\caption{Embedded Asymptote figures are easy!}
\label{fig:embedded}
\end{figure}
\end{document}
Last edited by mich202 on Mon Nov 07, 2011 11:52 pm, edited 3 times in total.

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
shadgrind
Posts: 140
Joined: Thu Jul 16, 2009 12:39 am

asymptote | Problem in Texmaker

Post by shadgrind »

This is explained in Chapter 7 ("LaTeX Usage") of the Asymptote user manual. Basically, you have to run [pdf]latex on your LaTeX source file, then run asy on the generated *.asy files, then run [pdf]latex again on the LaTeX source file.

For example, with your sample code - which I saved in a file called asytest.tex - I did this:

Code: Select all

latex asytest.tex
asy asytest-1.asy
latex asytest.tex
After the first latex run I had to do a directory listing to see what the generated *.asy file was called. After running asy and then latex a second time the graphic showed up in the DVI file.
System: TeX Live 2012, Fedora 18 x86_64, GNU Emacs 24.2
mich202
Posts: 2
Joined: Sun Nov 06, 2011 12:19 pm

Re: asymptote | Problem in Texmaker

Post by mich202 »

First I tryied to understand a process and than I listed a directory to get know what files are created.
I set in TexMaker:

Options>Configure Texmaker>Quick build>PdfLaTex+Asymptote+PdfLaTex+Viev PDF

and it works. Thanks a lot.
Post Reply