Operating Modes
The command java -jar ASPECT.jar --help shows all ASPECT options.
usage: ASPECT [options]
-a,--animate enable animate mode
-after <arg> set after file used in free mode (default after.tex)
-b,--beamer enable beamer mode
-before <arg> set before file used in free mode (default before.tex)
-c,--convert <arg> converts PDF to PNG or JPEG file
-cc,--copyclipboard converts PDF to image and copies it to the clipboard (default PNG)
-f,--free enable free mode
-h,--help shows ASPECT command line options
-k,--keep maintains logs and auxiliary files produced by pdflatex or lualatex
-nobuild disables automatic building (via pdflatex or lualatex) of the files created
-o,--output <arg> set name for output file
-r,--resize <arg> set resize parameter for beamer mode, % of \textwidth, from 0 to 1 (default 1)
-s,--speed <arg> set speed parameter for animate mode (default 1)
-v,--verbose verbose output (shows on the screen all ASPECT atomic formulas received as input)
ASPECT interpreter supports 4 operating modes called standard (default), beamer, free, animate.
In all operating modes the ASPECT interpreter receives its input directly from stdin so it is not strictly dependent on a specific ASP solver leaving the choice to the user. During testing, we verified compatibility with clingo and dlv ASP solvers.
clingo <clingo arguments> | java -jar ASPECT.jar [options]
dlv <dlv arguments> | java -jar ASPECT.jar [options]
Standard Mode
The standard mode of the ASPECT interpreter is the operating mode used by default.
The output of the ASP solver is redirected to a thread that is responsible, for each answer set, for generating the corresponding LaTeX file.
Note
In all operating modes the building of output file(s) from LaTeX file format to PDF file format is enabled by default but can be disabled
by passing the -nobuild option when invoking the interpreter.
Other modes of operation
Beamer Mode
Beamer mode groups all the graphical representations of answer sets into a beamer presentation and thus a single PDF file. If the ASP model admits multiple answer sets, each of these will be placed in a different beamer frame.
Beamer mode can be enabled by passing the parameter -b (or --beamer) when invoking the ASPECT interpreter.
Hint
In the case of optimization problems, with this mode, it is possible to show in a simple way the successive solutions of increasing quality found by the solver up to the optimal one.
When beamer mode is used ASPECT interpreter accepts a resize arguments (-r <dim> or --resize <dim>).
The resulting graphic will have a width equal to dim` times the textwidth value while ensuring a proportional scaling of the height.
Free Mode
Free mode allows the user to customize the output LaTeX file(s) by entering custom commands through the incorporation of two files called before.tex and after.tex.
Free mode can be enabled by passing the parameter -f (or --free) when invoking the ASPECT interpreter.
The contents of the two files just mentioned replace the header and footer respectively of the generated LaTeX document, allowing the user to customize it as desired.
Hint
Free mode can be used in combination with any other operating mode of the ASPECT interpreter.
Although the default names for customization files are before.tex and after.tex,
the user can replace them by using the -before <filename>.tex command line argument to define the new name,
or path, of before.tex file and the -after <filename>.tex argument for after.tex file.
Below a sample structure of the output LaTeX file generated using the free mode of the ASPECT interpreter:
% Contents of before.tex
\begin{tikzpicture}
% TikZ instructions generated by the ASPECT interpreter
\end{tikzpicture}
% Contents of after.tex
Animate Mode
Animate operating mode employs the namesake animate LaTeX package to generate JavaScript driven PDFs containing vector graphics in motion.
Animate mode can be enabled by passing the parameter -a (or --animate) when invoking the ASPECT interpreter.
Animate mode relies upon the frame argument of ASPECT atoms to create the animation (see ASPECT language).
When animate mode is used ASPECT interpreter accepts an integer argument -s <arg> (or --speed <arg>) to set the animation speed.
Caution
PDF documents generated with animate mode are not supported in all PDF viewers.
Attention
Animate mode cannot be used togheter with beamer mode but can be used together with free operating mode to customize generated documents.
Other Options
Listed below are some useful ASPECT options that can be invoked from the command line.
PDF to Image Conversion
Thanks to the ImageMagick software, ASPECT can automatically convert PDFs into PNG or JPEG images.
Conversion can be enabled by passing the option -c <arg> (or --convert <arg>) with argument PNG or JPEG depending on the desired format.
This way, once the PDF output is generated via pdflatex or lualatex, it will be converted into an image.
Image to Clipboard
The option -cc (or --copyclipboard) allows converting PDFs into images but automatically copies the generated image
(or the last image, in case more than one is generated) into the clipboard so that it is available for pasting into any document.
By default, this option generates images in PNG format; when used together with the -c <arg> (or --convert <arg>) option, it is possible to generate JPEG images.
Tip
This is an example of how to generate images in JPEG format when using the --copyclipboard option.
java -jar ASPECT.jar --copyclipboard --convert JPEG