latex figures code example

Example 1: include image latex

\documentclass{article}

\usepackage{graphicx}

\begin{document}

\begin{figure}
  \includegraphics[width=\linewidth]{boat.jpg}
  \caption{A boat.}
  \label{fig:boat1}
\end{figure}

Figure \ref{fig:boat1} shows a boat.

\end{document}

Example 2: latex image caption

\begin{figure}
    \includegraphics[width=\textwidth]{Picture}
    \caption{Picture caption}
\end{figure}

Example 3: include picture in latex

\usepackage{graphicx}
\graphicspath{ {./images/} }
\includegraphics{image}

Example 4: insert figure latex

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

Tags:

Misc Example