If I use the code from this thread It will look like in the image. The user packages I have are \usepackage{subcaption} \usepackage{subfig} \usepackage{subfigure}

But for some reason, it does not work, at all? Where in the code do I enter the image name?enter image description here

  • 2
    You can't use all three packages subfigure, subfig and subcaption inside of a single document. Since the first one is considered deprecated, decide which of the latter two you want to use and stick to a single package.
    – leandriis
    Apr 26, 2021 at 14:23
  • Does it matter which one I use of the two last ones? Apr 26, 2021 at 14:31
  • @JohnGreger: Each package has its own implementation (macros and the like). However, in some cases, since they deal with the same subject matter, there may be some macros that overlap between packages and therefore could be overwritten.
    – Werner
    Apr 26, 2021 at 16:48

1 Answer 1


This example uses the package subcaption for two upper figures side by side.

To test it with your images, put them in the same directory as the .tex document. Later you can move them to another directory by adding the path.



\usepackage{subcaption} %  added <<<<<<<<<<<<<<<<


    \begin{figure}[ht!]  % with two subfigures included
            % first image
            \includegraphics[width=\textwidth, keepaspectratio]{example-image-a}  %  <<< image name 1
            \caption{Lorem ipsum}
            % second image
            \includegraphics[width=\textwidth, keepaspectratio]{example-image-b} %  <<< image name 2
            \caption{Lorem ipsum, Lorem ipsum, Lorem ipsum, Lorem ipsum, Lorem ipsum}
    \caption{Caption place holder}

    \begin{figure}[ht!] % a single figure
            \includegraphics[width=0.5\textwidth, keepaspectratio]{example-grid-100x100pt} % 
            \caption{Single figure named example-grid-100x100pt}

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .