Skip to content

jamievlin/language-asymptote

Repository files navigation

Synopsis

Asymptote is a powerful C-based Vector Graphics Language that can be integrated into LaTeX documents. This package adds syntax highlighting functionality to Atom, a text editor. Other features such as automatic compile are planned, but not yet implemented.

Here are an example of the syntax highlighter in action:

Screenshot 1

The official website of Asymptote is at http://asymptote.sourceforge.net/.

Motivation

The idea for Asymptote syntax highlighter was conceived during one of my study sessions. I was working for an assignment for Honours Calculus 2, and I needed a way to draw images digitally on LaTeX files since my drawing skills weren't good. So, I discovered Asymptote, which is a powerful vector graphics language (which I found easier to use than TikZ), however there weren't any language packages for Atom at the moment, and I found that managing asy documents is difficult due to lack of keyword emphasizing. So I've developed this package to help mitigate this difficulty.

Installation

First of all, Atom is necessary for Installation. To install, clone this repository and copy the contents to %userprofile%/.atom/packages/language-asymptote. Restart Atom and all .asy files should be highlighted.

In case of a new asymptote version, new grammar files can be generated by running ./generate_asy_grammar.sh on macOS/Linux or generate_asy_grammar.ps1 on Windows machines. The new asymptote.cson will be generated in the correct directory. In case of a bug or error with the new file, a backup version is provided with asymptote.cson.old. Simply rename the file to asymptote.cson to revert back to the manually generated version.

Contributors

Apart from me, John Bowman helped with Asymptote keywords and grammar generation.

Special Thanks

John Bowman, Andy Hammerlindl and Tom Prince, and other students for development of the original Asymptote language. The full credits can be seen at http://asymptote.sourceforge.net/.

License

Copyright (c) 2017 Supakorn Rassameemasmuang See LICENSE.md for more details.

This project uses derivative code built from Asymptote, which can be retrieved under https://github.com/vectorgraphics/asymptote.