insert figure in latex code example

Example 1: insert table latex

\begin{center}
\begin{tabular}{ |c|c|c| } 
 \hline
 cell1 & cell2 & cell3 \\ 
 cell4 & cell5 & cell6 \\ 
 cell7 & cell8 & cell9 \\ 
 \hline
\end{tabular}
\end{center}

Example 2: insert figure latex

%...
\begin{figure}[h!]
  \centering
  \begin{subfigure}[b]{0.2\linewidth}
    \includegraphics[width=\linewidth]{coffee.jpg}
     \caption{Coffee.}
  \end{subfigure}
  \begin{subfigure}[b]{0.2\linewidth}
    \includegraphics[width=\linewidth]{coffee.jpg}
    \caption{More coffee.}
  \end{subfigure}
  \begin{subfigure}[b]{0.2\linewidth}
    \includegraphics[width=\linewidth]{coffee.jpg}
    \caption{Tasty coffee.}
  \end{subfigure}
  \begin{subfigure}[b]{0.5\linewidth}
    \includegraphics[width=\linewidth]{coffee.jpg}
    \caption{Too much coffee.}
  \end{subfigure}
  \caption{The same cup of coffee. Multiple times.}
  \label{fig:coffee3}
\end{figure}
%...

Example 3: insert table latex

%...

\begin{sidewaystable}[h!] % <--
  \begin{center}
  \caption{Landscape table.}
  \label{tab:table1}
  \begin{tabular}{l|S|r}
  	\toprule
  	\textbf{Value 1} & \textbf{Value 2} & \textbf{Value 3}\\
  	$\alpha$ & $\beta$ & $\gamma$ \\
    \midrule
    1 & 1110.1 & a\\
    2 & 10.1 & b\\
    3 & 23.113231 & c\\
    \bottomrule
  \end{tabular}
  \end{center}
\end{sidewaystable}

%...

Example 4: insert figure latex

%Path relative to the main .tex file 
\graphicspath{ {./images/} }

Tags:

Misc Example