Graphics and images are imported from files in img/ in your
project directory. The types of these files coincide with the
file types used for the LaTeX command includegraphics. In
addition the file type svg may be included.The widespread TikZ package from LaTeX is not included with QaDiL, but
if you have LaTeX installed on your computer there is also an
easy hack for generating standalone graphics files from TikZ for inclusion in
QaDiL. This is described below. First we document the
basic command for including graphics and images in QaDiL.
4.1 includegraphics
The includegraphics control sequence works almost
like the one in regular LaTeX except that dimensions (percents and pixels)
in the optional parameter are geared towards html.
\includegraphics{vonNeumann.gif}
\includegraphics[width="50\%"]{tweetmath.png}
4.2 Using LaTeX/TikZ for standalone graphics
A tikzpicture environment is included in QaDiL on an experimental basis. One can, however,
with LaTeX/TikZ installed easily generate standalone graphics files
for inclusion in QaDiL.We will describe this using an example. Below is a
standalone LaTeX snippet with TikZ code for generating a right
triangle.
Suppose that you have the conversion program pdf2svg installed and
that the above snippet is saved in the file Pythagoras.tex. Then
pdflatex -shell-escape Pythagoras
gives as output the vector graphics file Pythagoras.svg for
inclusion in QaDiL with
\includegraphics{Pythagoras.svg}
assuming that Pythagoras.svg resides in your img/ directory.
4.3 tikzpicture
The tikzpicture environment has been added to QaDiL on an experimental basis and
may be used (almost) as in ordinary LaTeX. It is based on https://tikzjax.com/.
Here one needs to include tikz as an htmlinclude file before use.
The above python snippet displays the plot with the option of
saving to a png-file. If you
uncomment the last line and comment out plt.show(),
the plot will be written to the file ptplot.png.
4.5 Embedding videos
In the include file stddefs you will see macros for inclusion of YouTube and Vimeo videos. Let us briefly go through these.
We will first define a macro to create an iframe in html