3

I work with miktex and TeXnicCenter an want to make graphics with Asymptote in .tex-files. But the following code

\documentclass[a4paper]{article}
\usepackage{asymptote}
\begin{document}
\begin{asy}
draw((0,0) -- (2,0));
\end{asy}
\end{document}

produces zero failers but no Picture.

This is pdfTeX, Version 3.14159265-2.6-1.40.19 (MiKTeX 2.9.6745 64-bit) (preloaded format=pdflatex 2018.8.6)  7 AUG 2019 13:18
entering extended mode
**./VAsymptote.tex
(VAsymptote.tex
LaTeX2e <2018-04-01> patch level 5
("C:\Program Files\MiKTeX 2.9\tex\latex\base\article.cls"
Document Class: article 2014/09/29 v1.4h Standard LaTeX document class
("C:\Program Files\MiKTeX 2.9\tex\latex\base\size10.clo"
File: size10.clo 2014/09/29 v1.4h Standard LaTeX file (size option)
)
\c@part=\count80
\c@section=\count81
\c@subsection=\count82
\c@subsubsection=\count83
\c@paragraph=\count84
\c@subparagraph=\count85
\c@figure=\count86
\c@table=\count87
\abovecaptionskip=\skip41
\belowcaptionskip=\skip42
\bibindent=\dimen102
)
("C:\Program Files\MiKTeX 2.9\tex\latex\asymptote\asymptote.sty"
Package: asymptote 2016/11/26 v1.33 Asymptote style file for LaTeX
\ASYbox=\box26
\ASYdimen=\dimen103
\c@asy=\count88
\AsyStream=\write3
\AsyPreStream=\write4

("C:\Program Files\MiKTeX 2.9\tex\latex\graphics\keyval.sty"
Package: keyval 2014/10/28 v1.15 key=value parser (DPC)
\KV@toks@=\toks14
) ("C:\Program Files\MiKTeX 2.9\tex\latex\base\ifthen.sty"
Package: ifthen 2014/09/29 v1.1c Standard LaTeX ifthen package (DPC)
)
("C:\Program Files\MiKTeX 2.9\tex\latex\graphics\color.sty"
Package: color 2016/07/10 v1.1e Standard LaTeX Color (DPC)

("C:\Program Files\MiKTeX 2.9\tex\latex\graphics-cfg\color.cfg"
File: color.cfg 2016/01/02 v1.6 sample color configuration
)
Package color Info: Driver file: pdftex.def on input line 147.

("C:\Program Files\MiKTeX 2.9\tex\latex\graphics-def\pdftex.def"
File: pdftex.def 2018/01/08 v1.0l Graphics/color driver for pdftex
))
("C:\Program Files\MiKTeX 2.9\tex\latex\graphics\graphicx.sty"
Package: graphicx 2017/06/01 v1.1a Enhanced LaTeX Graphics (DPC,SPQR)

("C:\Program Files\MiKTeX 2.9\tex\latex\graphics\graphics.sty"
Package: graphics 2017/06/25 v1.2c Standard LaTeX Graphics (DPC,SPQR)
 ("C:\Program Files\MiKTeX 2.9\tex\latex\graphics\trig.sty"
Package: trig 2016/01/03 v1.10 sin cos tan (DPC)
) ("C:\Program Files\MiKTeX 2.9\tex\latex\graphics-cfg\graphics.cfg"
File: graphics.cfg 2016/06/04 v1.11 sample graphics configuration
)
Package graphics Info: Driver file: pdftex.def on input line 99.
)
\Gin@req@height=\dimen104
\Gin@req@width=\dimen105
)
("C:\Program Files\MiKTeX 2.9\tex\generic\oberdiek\ifpdf.sty"
Package: ifpdf 2017/03/15 v3.2 Provides the ifpdf switch
)
("C:\Program Files\MiKTeX 2.9\tex\generic\ifxetex\ifxetex.sty"
Package: ifxetex 2010/09/12 v0.6 Provides ifxetex conditional
)
("C:\Program Files\MiKTeX 2.9\tex\generic\oberdiek\catchfile.sty"
Package: catchfile 2016/05/16 v1.7 Catch the contents of a file (HO)

("C:\Program Files\MiKTeX 2.9\tex\generic\oberdiek\infwarerr.sty"
Package: infwarerr 2016/05/16 v1.4 Providing info/warning/error messages (HO)
)
("C:\Program Files\MiKTeX 2.9\tex\generic\oberdiek\ltxcmds.sty"
Package: ltxcmds 2016/05/16 v1.23 LaTeX kernel commands for general use (HO)
)
("C:\Program Files\MiKTeX 2.9\tex\generic\oberdiek\etexcmds.sty"
Package: etexcmds 2016/05/16 v1.6 Avoid name clashes with e-TeX commands (HO)

("C:\Program Files\MiKTeX 2.9\tex\generic\oberdiek\ifluatex.sty"
Package: ifluatex 2016/05/16 v1.4 Provides the ifluatex switch (HO)
Package ifluatex Info: LuaTeX not detected.
)
Package etexcmds Info: Could not find \expanded.
(etexcmds)             That can mean that you are not using pdfTeX 1.50 or
(etexcmds)             that some package has redefined \expanded.
(etexcmds)             In the latter case, load this package earlier.
))
\openout4 = `VAsymptote.pre'.

)
No file VAsymptote.aux.
\openout1 = `VAsymptote.aux'.

LaTeX Font Info:    Checking defaults for OML/cmm/m/it on input line 4.
LaTeX Font Info:    ... okay on input line 4.
LaTeX Font Info:    Checking defaults for T1/cmr/m/n on input line 4.
LaTeX Font Info:    ... okay on input line 4.
LaTeX Font Info:    Checking defaults for OT1/cmr/m/n on input line 4.
LaTeX Font Info:    ... okay on input line 4.
LaTeX Font Info:    Checking defaults for OMS/cmsy/m/n on input line 4.
LaTeX Font Info:    ... okay on input line 4.
LaTeX Font Info:    Checking defaults for OMX/cmex/m/n on input line 4.
LaTeX Font Info:    ... okay on input line 4.
LaTeX Font Info:    Checking defaults for U/cmr/m/n on input line 4.
LaTeX Font Info:    ... okay on input line 4.
("C:\Program Files\MiKTeX 2.9\tex\context\base\supp-pdf.mkii"
[Loading MPS to PDF converter (version 2006.09.02).]
\scratchcounter=\count89
\scratchdimen=\dimen106
\scratchbox=\box27
\nofMPsegments=\count90
\nofMParguments=\count91
\everyMPshowfont=\toks15
\MPscratchCnt=\count92
\MPscratchDim=\dimen107
\MPnumerator=\count93
\makeMPintoPDFobject=\count94
\everyMPtoPDFconversion=\toks16
) ("C:\Program Files\MiKTeX 2.9\tex\latex\oberdiek\epstopdf-base.sty"
Package: epstopdf-base 2016/05/15 v2.6 Base part for package epstopdf

("C:\Program Files\MiKTeX 2.9\tex\latex\oberdiek\grfext.sty"
Package: grfext 2016/05/16 v1.2 Manage graphics extensions (HO)

("C:\Program Files\MiKTeX 2.9\tex\generic\oberdiek\kvdefinekeys.sty"
Package: kvdefinekeys 2016/05/16 v1.4 Define keys (HO)
))
("C:\Program Files\MiKTeX 2.9\tex\latex\oberdiek\kvoptions.sty"
Package: kvoptions 2016/05/16 v3.12 Key value format for package options (HO)

("C:\Program Files\MiKTeX 2.9\tex\generic\oberdiek\kvsetkeys.sty"
Package: kvsetkeys 2016/05/16 v1.17 Key value parser (HO)
))
("C:\Program Files\MiKTeX 2.9\tex\generic\oberdiek\pdftexcmds.sty"
Package: pdftexcmds 2018/01/30 v0.27 Utility functions of pdfTeX for LuaTeX (HO)
Package pdftexcmds Info: LuaTeX not detected.
Package pdftexcmds Info: \pdf@primitive is available.
Package pdftexcmds Info: \pdf@ifprimitive is available.
Package pdftexcmds Info: \pdfdraftmode found.
)
Package epstopdf-base Info: Redefining graphics rule for `.eps' on input line 438.
Package grfext Info: Graphics extension search list:
(grfext)             [.pdf,.png,.jpg,.mps,.jpeg,.jbig2,.jb2,.PDF,.PNG,.JPG,.JPEG,.JBIG2,.JB2,.eps]
(grfext)             \AppendGraphicsExtensions on input line 456.
)
\openout3 = `VAsymptote-1.asy'.



Package asymptote Warning: file `VAsymptote-1.pdf' not found on input line 8.

(VAsymptote.aux) ) 
Here is how much of TeX's memory you used:
 1620 strings out of 492973
 23271 string characters out of 3135936
 84532 words of memory out of 3000000
 5496 multiletter control sequences out of 15000+200000
 3640 words of font info for 14 fonts, out of 3000000 for 9000
 1141 hyphenation exceptions out of 8191
 34i,1n,25p,215b,70s stack positions out of 5000i,500n,10000p,200000b,50000s

No pages of output.
PDF statistics:
 0 PDF objects out of 1000 (max. 8388607)
 0 named destinations out of 1000 (max. 500000)
 1 words of extra memory for PDF output out of 10000 (max. 10000000)

Thanks and best regards

3
  • 1
    You have to manually run asy on the generated .asy to get the PDF versions, and then recompile your latex file. As far as I can see the package makes no attempt to automatically run asy. BTW: unless you really need the features in asymptote you can always draw directly in latex via tikz
    – daleif
    Aug 7, 2019 at 11:32
  • Thanks, i use tikz a lot, but it doesn't really support 3D.
    – user54285
    Aug 7, 2019 at 12:24
  • 1
    If your coordinates are in cm add size(1cm); at the beginning of the asy environment. Aug 7, 2019 at 12:47

2 Answers 2

2

I followed the explanation @Mensch gave me. However, there seems to be a problem with wildcards; asy must be run over jobname-*.asy and the wildcard causes trouble.

For a final solution, I created a batch file in Asymptote's directory

@ECHO OFF
cd %1
"C:\Program Files (x86)\Asymptote\asy.exe" %2-*.asy
echo.

Then I set the post processing to C:\Program Files (x86)\Asymptote\asy-custom.bat with arguments %dm %tm (meaning: path to file + filename without extension).

Finally I added a second post processor that calls pdflatex again.

1

Well, I do not know asymptote and you did not tell us which command is needed to run this software so I can only help you showing the right place where you have to add the needed command.

There are two possibilities, depending on the need of when asymptote has to be run:

  1. before compiling the tex file or
  2. after compiling the tex file.

Open TeXnicCenter, then press alt+F7 to open the profile menu. Now choose the profile to be copied to create a new one for running asymptote, add it and rename it to asymptote for example; see the buttons in German Kopieren and Hinzufügen at the bottom of the screenshot on the left) and click on preprocessor (German: Vorbearbeitung) in case you need point 1 or postprocessor (German: Nachbearbeitung) in case you need point 2.

profile

Depending on the command you need to run asymptote now please fill in the correct datas in the windows opened (In my screenshot you see the german version, in the documentation you can find the english version, but please see that the preprocessor is not described there! See Documentation, go to Postprocessor Tab)

Please note this remarks in the documentation:

remarks in docu

After you added all needed information to run asymptote click on Ok to store the new profile.

Now you can use the new profile asymptote running asymptote in TeXnicCenter ...

2
  • 1
    @down-voter: leave a comment why you down voted! That is usual here!
    – Mensch
    Aug 7, 2019 at 22:12
  • Hello Mensch, the commands are: latex latexusage asy latexusage-*.asy latex latexusage (asymptote.sourceforge.net -> documentation -> latex usage). I tried: 1) Copy the profile Latex->Pdf and add in Nachbearbeitung asy.exe and in Argument Hauptdatei. 2) Run the new profile then run latex-pdf. The problem is still "VAsymptote.idx" not found.
    – user54285
    Aug 8, 2019 at 7:22

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .