A description of how images and graphs are rendered or included.
1 How Ximera renders Image and Graph Content
There are several ways to embed graphics into Ximera document.
2 TikZ
The preferred way to include graphics is with TikZ.
\begin{image}
\begin{tikzpicture}
\begin{axis}[
xmin=-6.4,
xmax=6.4,
ymin=-1.2,
ymax=1.2,
axis lines=center,
xlabel=$x$,
ylabel=$y$,
every axis y label/.style={at=(current axis.above origin),anchor=south},
every axis x label/.style={at=(current axis.right of origin),anchor=west},
]
\addplot [ultra thick, blue, smooth] {sin(deg(x))};
\end{axis}
\end{tikzpicture}
\end{image}
3 Including images
Another method is to use \includegraphics. Here we see an included a JPEG and a PNG:
\begin{image}In the code above, the command image is just a Ximera provided wrapper that can be redefined for printing. It does automatically resize content though and can be useful for showing images side-by-side:
\includegraphics[width=.3\textwidth]{missionPatch.jpg}\qquad
%% chimera.png is licensed under the Creative Commons Attribution-Share
%% Alike 3.0 Unported license.
%% Attribution: I, Sailko
%% https://commons.wikimedia.org/wiki/File:Chimera_d%27arezzo,_fi,_04.JPG
\includegraphics[width=.3\textwidth]{chimera.png}
\end{image}
Here we have a pdf
Another way to include graphics is to use Tikz. In some sense this is preferred, as then the source produces the images.
\begin{image}
\begin{tikzpicture}
\begin{axis}[
xmin=-6.4,
xmax=6.4,
ymin=-1.2,
ymax=1.2,
axis lines=center,
xlabel=$x$,
ylabel=$y$,
every axis y label/.style={at=(current axis.above origin),anchor=south},
every axis x label/.style={at=(current axis.right of origin),anchor=west},
]
\addplot [ultra thick, blue, smooth] {sin(deg(x))};
\end{axis}
\end{tikzpicture}
\end{image}
3.1 The graph command
The easiest way to include an interactive graph is to use the \graph command. Unfortunately, the \graph command doesn’t draw a graph in the PDF, rather, it states (in words) that a graph is produced.
Change viewing window
\[Restricting domain
\graph[xmin=-5,xmax=5,ymin=-5,ymax=5]{y=x^2}
\]
\[Default panel displayed
\graph{x^2 \left\{ 1 \leq x \leq 10 \right\} }
\]
\[Restricting window
\graph[panel]{x^2}
\]
\[Axis labels
\graph[xmin=0, xmax=10, ymin=0, ymax=10]{x^2}
\]
\[Hide axes
\graph[xAxisLabel="time", yAxisLabel="distance"]{y=x}
\]
\[Hide tick marks
\graph[hideXAxis=true, hideYAxis=true]{x^2}
\]
\[Polar graphing
\graph[hideXAxisNumbers=true, hideYAxisNumbers=true]{x=y^2}
\]
\[Polar gridlines
\graph{r=\theta}
\]
\[Graphing a piecewise function
\graph[polar]{y=x^2}
\]
\[
\graph{ \sin(x)\left\{x<0\right\}, 2x\left\{ x>=0 \right\} }
\]
3.2 Desmos
If you require further features from Desmos, you can sign up for an account and include your worksheets like this:
\begin{center}
\desmos{zwywds7med}{800}{600}
\end{center}