# How / Can I use Asymptote, ams math and TikZ in a ConTeXt based document?

My understanding is that Context has a pretty diverse core base load. But I was curious if asymptote code blocks can be used in a context document?

I am used to calling packages at the beginning of a LaTex document but am unsure and have not found a good example of using either asymptote or ams math.

I am thinking the functionality of ams is included in the Context core but I cannot imagine that asymptote functionality is part of the context core.

It is my understanding that there is a TikZ module for Context. When I did the setup I included all modules. How do I verify (what command) what modules have been loaded as part of the Context setup?

• »How do I verify (what command) what modules have been loaded as part of the Context setup?« I don't understand this part of the question. Could you please elaborate? – Henri Menke May 8 '17 at 1:45

# Asymptote

How to use Asymptote was demonstrated by Aditya on the mailing list.

``````\usemodule[filter]

\defineexternalfilter
[ASY]
[
filter={asy -tex "context" -outformat pdf
-outname \externalfilteroutputfile},
output=\externalfilterbasefile.pdf,
cache=yes,
]

\starttext
Testing if we can include an asymptote image
\startplacefigure[location={here}, title={An Asymptote figure}]
\startASY
unitsize(1cm);
draw((0,0) .. (1,1) .. (2,sqrt(2)));
\stopASY
\stopplacefigure
\stoptext
``````

# TikZ

The TikZ manual describes the usage for all three common formats, LaTeX, Plain TeX, and ConTeXt. Be aware that TikZ uses a different colour model than ConTeXt which can lead to strange interactions, see for example this post on the mailing list.

# AMSmath

There is no `amsmath` for ConTeXt. However, the ConTeXt core implements most of the major functionality for which you would use `amsmath` in LaTeX.

There is a great article by Aditya in the MAPS journal on how to emulate certain popular AMSmath constructs in ConTeXt.

Display Math in ConTEXt

• @TimC: see the documentation of the filter module. Behind the scenes, the filter module writes the file to disk, runs the `filtercommand` on the file and then reads the output. – Aditya May 8 '17 at 16:26