Operating Modes +++++++++++++++ The command ``java -jar ASPECT.jar --help`` shows all ASPECT options. .. code-block:: none usage: ASPECT [options] -a,--animate enable animate mode -after set after file used in free mode (default after.tex) -b,--beamer enable beamer mode -before set before file used in free mode (default before.tex) -c,--convert 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 set name for output file -r,--resize set resize parameter for beamer mode, % of \textwidth, from 0 to 1 (default 1) -s,--speed 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. .. code-block:: none clingo | java -jar ASPECT.jar [options] dlv | 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 * :ref:`beamer-section` * :ref:`free-section` * :ref:`animate-section` .. _beamer-section: 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`` `` or ``--resize`` ``). The resulting graphic will have a width equal to `dim`` times the `textwidth` value while ensuring a proportional scaling of the height. .. _free-section: 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`` `.tex` command line argument to define the new name, or path, of `before.tex` file and the ``-after`` `.tex` argument for `after.tex` file. Below a sample structure of the output LaTeX file generated using the free mode of the ASPECT interpreter: .. code-block:: latex % Contents of before.tex \begin{tikzpicture} % TikZ instructions generated by the ASPECT interpreter \end{tikzpicture} % Contents of after.tex .. _animate-section: 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 :doc:`ASPECT language `). When animate mode is used ASPECT interpreter accepts an integer argument ``-s`` `` (or ``--speed`` ``) 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`` `` (or ``--convert`` ``) 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`` `` (or ``--convert`` ``) 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. .. code-block:: bash java -jar ASPECT.jar --copyclipboard --convert JPEG