latex image placement code example

Example 1: overleaf subfigures

% Side-by-side subfigures

\usepackage{subcaption}

\begin{figure}[h]
    \begin{subfigure}{0.5\textwidth}
        \includegraphics[width=0.9\linewidth]{image1}
        \caption{Caption1}
        \label{fig:sub1}
    \end{subfigure}
    \begin{subfigure}{0.5\textwidth}
        \includegraphics[width=0.9\linewidth]{image2}
        \caption{Caption2}
        \label{fig:sub2}
    \end{subfigure}
    \caption{Subfigures}
    \label{fig:Figure1}
\end{figure}

Example 2: Start Image from top of page Latex

I assume you issue a \clearpage (or something similar) just before using \begin{figure}...\end{figure}, right? If this is the case, add \mbox{} (or \null) after the figure environment before starting a new \chapter and your alignment should be fixed. Since there's nothing else on the page, LaTeX centres it, since that would be the best way to present the information.

Example 3: latex image force placement

\usepackage{float}

...

\begin{figure}[H]
\centering
\includegraphics{slike/visina8}
\caption{Write some caption here}\label{visina8}
\end{figure}

Tags:

Misc Example