Graphics
Image ↓
How to add images Image positioning How to add captions and a label to an image How to rotate and scale back an image
Charts ↓
Introduction & SmartDiagram TikZ: Simple Drawings TikZ: Advanced Commands PGFPlots
Tables ↓
Environment Cell spanning Positioning Coloring
Vector drawing ↓
Latexdraw Putting things together
Putting things together

Including an image in a SmartDiagram
You can include an image inside most of the SmartDiagrams:


CODE
\begin{center}
\usetikzlibrary{shapes.geometric} % required in the preamble
\smartdiagramset{module shape=diamond,
font=\scriptsize,
module minimum width=1cm,
module minimum height=1cm,
text width=1cm,
circular distance=2cm,
circular final arrow disabled=true,
}
\smartdiagram[circular diagram:clockwise]
{
{image1},
{image2}
{image3},
{image4},
}
\end{center}


\includegraphics might seem the best option to include an image in your LaTeX document. But the resulting image you obtain is moved on the right and it is rather small. On an attempt to scale it, I discovered that the image is not bounded. That means the program applies a default node to the picture. So what you get is a mess. The procedure for creating a bound for the picture is pretty complicated, so we'll skip it.


CODE
\smartdiagram[constellation diagram]
{\textbackslash
{includegraphics\{\}},
\includegraphics[width=3cm]{leslie.png}
}


To solve the bounding problem, use \usepackage{PGFPlots} and \usepackage{overpic}. This allows you to center the image. If you're looking to export a dvi file, be aware that the dvi producing LaTeX doesn't recognize the png, jpeg, and pdf extensions. You have to convert your image in an eps file and then include it in the .tex file. Good luck with managing transparent backgrounds.


CODE
\begin{overpic}
[width=\textwidth]{Leslie_Lamport.png}
\end{overpic}


Including a SmartDiagram in a table
Include the code of your favourite SmartDiagram after \begin{tabular}{}


CODE
\begin{center}
\smartdiagramset{
module minimum width= 5cm,
module minimum height= 1cm,
text width= 3.5cm,
module y sep= 2.4,
text color= black,
font= \normalsize,
border color= red,
back arrow disabled= true}
\smartdiagram[flow diagram]
{Obtained graduation at the Bronx High School of Science (1960),
Worked for Massachusetts Computer Associates (1970-1977),
Worked for SRI International (1977 - 1985),
Worked for Digital Equipment Corporation (1985 - 2001),
Worked for Microsoft Research (2001 - 2014)}
\end{center}


If you wish to include your SmartDiagram inside a multirow, add it inside the parenthesis \multirow{number of rows}{*}{your SmartDiagram}. Because of the nature of the structure, you can't use the tabular definitions c, l, r, but you rather have to use the following types:


CODE
\begin{tabular}{|p{0.45\linewidth}|p{0.5\linewidth}|} \hline
\multirow{3}{0.6cm}{
\begin{center}
\smartdiagramset{
module minimum width= 5cm,
module minimum height= 1cm,
text width= 3.5cm,
module y sep= 2.4,
text color= black,
font= \normalsize,
border color= red,
back arrow disabled= true}
\smartdiagram[flow diagram]
{Obtained graduation at the Bronx High School of Science (1960),
Worked for Massachusetts Computer Associates (1970-1977),
Worked for SRI International (1977 - 1985),
Worked for Digital Equipment Corporation (1985 - 2001),
Worked for Microsoft Research (2001 - 2014)}
\end{center}
}
& This is an example\\ \cline{2-2}
& This is an example\\ \cline{2-2}
& This is a long example \\ [11.9cm] \hline
\end{tabular}


Adding draws to your table
This is probably the easiest passage. Copy&Paste the code you get from latexdraw inside your LaTeX document and run it on the shell like we saw in the previous chapter. if you're working with other types of graphics, make sure you have everything set up correctly before moving on.


CODE
scalebox{1} % Change this value to rescale the drawing.
{
\begin{pspicture}(0,-1.24)(6.71,1.24)
\pscustom[linewidth=0.04]
\textbf{code from here}
}
\end{pspicture}
}
\\ \hline
\end{tabular}
\end{table}


Last steps
Now it's very easy to put everything together.


CODE
\documentclass}

%%Vector Drawing%%
\usepackage[usenames,dvipsnames]{pstricks}
\usepackage{epsfig}
%%
%%Overpic%%
\usepackage[percent]{overpic}
\begin{table}
\begin{tabular}{|c|} \hline
{
}
\end{pspicture}
}
\\ \hline
\end{tabular}
\end{table}
\end{document}
%%
%%Borders%%
\usepackage{array,booktabs,arydshln,xcolor}
%%
%%Smart Diagram%%
\usepackage{smartdiagram}
\usepackage{tikz}
%%
%%Include Image%%
\usepackage{pgfplots,siunitx}
\pgfplotsset{compat=1.16}
\usepackage[percent]{overpic}
%%
%%Table%%
\usepackage{multirow}
%%
\begin{document}
%%BEGIN TABLE%%
\begin{table}
\centering
\begin{tabular}{c}
\textbf{\Large {LESLIE LAMPORT}}\\ %!-- Title
\textbf{\normalsize {creator of \LaTeX}}\\ [-5 cm]
\end{tabular}
\end{table}
\begin{table} !-- Table
%%BORDERS%%
\newcommand\VRule[1][\arrayrulewidth]{\vrule width #1}
\centering
%%TABULAR%%
\begin{tabular}{
!{\VRule[2pt]}m{0.5\textwidth}
!{\VRule}p{0.5\textwidth}
!{\VRule[2pt]}}
%%Here goes the title%%
\specialrule{2pt}{0pt}{0pt}
%%First row%
\textbf{BIOGRAPHY} &
\textbf{ARTICLES}\\ \hline
%%Second row%%
\centering
\multirow{11}{5.8cm}{%!-- BIOGRAPHY
%!-- INSERT SMART DIAGRAM HERE
}
&%!-- ARTICLES
%!-- INSERT PGFPlots
\\
%%Third row%%
&\\
&\\ \cline{2-2}
%%Fourth row%%
&
\textbf{PHOTO}\\ \cline{2-2}
%%Fifth row%%
&%!--IMAGE -->
%%!--INSERT PICTURE HERE
\\ [0.1cm] \cline {2-2}
%%Sixth Row%%
&
\textbf{SIGNATURE}\\ \cline{2-2}
&%!--INSERT LATEXDRAW.FILE HERE
\\
%%Last Row%
\specialrule{2pt}{0pt}{0pt}
\end{tabular}
\end{table}
\end{document}


Congratulation, you passed the course of Graphics! Now go and try compiling the quiz.