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}
 
  \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}
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:

Here we have a pdf

PIC

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.

There are a number of options for the \graph command:

Change viewing window

\[
 
\graph[xmin=-5,xmax=5,ymin=-5,ymax=5]{y=x^2}  
\]
Restricting domain
\[
 
\graph{x^2 \left\{ 1 \leq x \leq 10 \right\} }  
\]
Default panel displayed
\[
                                                                  

                                                                  
 
\graph[panel]{x^2}  
\]
Restricting window
\[
 
\graph[xmin=0, xmax=10, ymin=0, ymax=10]{x^2}  
\]
Axis labels
\[
 
\graph[xAxisLabel="time", yAxisLabel="distance"]{y=x}  
\]
Hide axes
\[
 
\graph[hideXAxis=true, hideYAxis=true]{x^2}  
\]
Hide tick marks
\[
 
\graph[hideXAxisNumbers=true, hideYAxisNumbers=true]{x=y^2}  
\]
Polar graphing
\[
                                                                  

                                                                  
 
\graph{r=\theta}  
\]
Polar gridlines
\[
 
\graph[polar]{y=x^2}  
\]
Graphing a piecewise function
\[
 
\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}

4 Any Necessary Content

5 Quirks of Rendering

6 Any Ximera-Specific Optional Arguments

7 Accessibility

8 Potential Problems and Pitfalls

9 Any Best Practices or Advice