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 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 not yet implemented in QaDiL. One may, 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.
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.4 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