Theses, Books, Title pagesMaster/doctoral thesis figures next to each other

Classicthesis, Bachelor and Master thesis, PhD, Doctoral degree
Post Reply
Shafiq Popal
Posts: 9
Joined: Thu Mar 02, 2017 8:31 pm

Master/doctoral thesis figures next to each other

Post by Shafiq Popal »

Hello everyone,
I am not very good at latex but I am quite interested to know if it is possible to put the figures next to each other? Secondly, can I use float package in this template?
I would really appreciate your kind cooperation.
Respectfully,

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org
LaTeX Beginner's Guide LaTeX Cookbook LaTeX TikZ graphics TikZによるLaTeXグラフィックス
User avatar
Johannes_B
Site Moderator
Posts: 4182
Joined: Thu Nov 01, 2012 4:08 pm

Master/doctoral thesis figures next to each other

Post by Johannes_B »

Yes, of course you can put two images next to each other, why shouln't there any difference?

You can also use the float package. But why would you need it?
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.
Shafiq Popal
Posts: 9
Joined: Thu Mar 02, 2017 8:31 pm

Master/doctoral thesis figures next to each other

Post by Shafiq Popal »

Thanks a lot for your kind reply. May I know the input code for placing two figures side by side?
I need float package because I also face problem with the positioning of figures. I want them below a specific text but it doesn't work that way after compiling. I would appreciate if you let me know any solution for that.

Kindest Regards,
erir
Posts: 1
Joined: Sat May 06, 2017 6:12 pm

Master/doctoral thesis figures next to each other

Post by erir »

Take a look at the top answer here:

https://tex.stackexchange.com/questions ... each-other

There are different methods of achieving two pictures which are side by side. You can choose the easiest one for you.
User avatar
Stefan Kottwitz
Site Admin
Posts: 10290
Joined: Mon Mar 10, 2008 9:44 pm

Master/doctoral thesis figures next to each other

Post by Stefan Kottwitz »

To cite the solutions of Masroor, linked by erir above:

----

Without Using Any Package

Code: Select all

\documentclass{article}
\usepackage{graphicx}
\begin{document}
\begin{figure}[!tbp]
  \centering
  \begin{minipage}[b]{0.4\textwidth}
    \includegraphics[width=\textwidth]{flower1.jpg}
    \caption{Flower one.}
  \end{minipage}
  \hfill
  \begin{minipage}[b]{0.4\textwidth}
    \includegraphics[width=\textwidth]{flower2.jpg}
    \caption{Flower two.}
  \end{minipage}
\end{figure}
\end{document}
images-1.png
images-1.png (46.42 KiB) Viewed 87671 times
Using Packages

You can use either subfig or subcaption.

Using subfig:

Code: Select all

\documentclass{article}
\usepackage{graphicx}
\usepackage{subfig}
\begin{document}
\begin{figure}[!tbp]
  \centering
  \subfloat[Flower one.]{\includegraphics[width=0.4\textwidth]{flower1.jpg}\label{fig:f1}}
  \hfill
  \subfloat[Flower two.]{\includegraphics[width=0.4\textwidth]{flower2.jpg}\label{fig:f2}}
  \caption{My flowers.}
\end{figure}
\end{document}
images-2.png
images-2.png (88.51 KiB) Viewed 87671 times
Using subcaption:

Code: Select all

\documentclass{article}
\usepackage{graphicx}
\usepackage{caption}
\usepackage{subcaption}
\begin{document}
\begin{figure}[!tbp]
  \begin{subfigure}[b]{0.4\textwidth}
    \includegraphics[width=\textwidth]{flower1.jpg}
    \caption{Flower one.}
    \label{fig:f1}
  \end{subfigure}
  \hfill
  \begin{subfigure}[b]{0.4\textwidth}
    \includegraphics[width=\textwidth]{flower2.jpg}
    \caption{Flower two.}
    \label{fig:f2}
  \end{subfigure}
  \caption{My flowers.}
\end{figure}
\end{document}
images-3.png
images-3.png (89.25 KiB) Viewed 87671 times
Pros and Cons of the Approaches:
  • It is actually difficult to call one method superior over the other. Which one you want to use will depend on the result you are expecting. So, see the results presented above and choose yourself.
  • The first one which uses the minipage environment is actually very simple. But as you can see the figures are number individually. If want to present a group of related figures, it may not be the one you are looking for.
  • The results from subfig and subcaption are very similar. Though each has its own way of usage. However, there are reports on subfig not working properly with hyperref. This question provides an excellent discussion on the comparative analysis on subcaption vs. subfig.
Further Reading

In order to get a better understanding of the placement and width controlling issues, I strongly suggest the you go through the documentation of the above two packages (subfig and subcaption). These documentations contain some excellent hints and examples.

Also, for comprehending the solutions of related issues, these questions (A, B, C, D, E, F) are worth taking a look at.

----
LaTeX.org admin
Shafiq Popal
Posts: 9
Joined: Thu Mar 02, 2017 8:31 pm

Master/doctoral thesis figures next to each other

Post by Shafiq Popal »

Thank you all for your kind replies. the first method that doesn't use any package really works for me. Many thanks again
User avatar
Johannes_B
Site Moderator
Posts: 4182
Joined: Thu Nov 01, 2012 4:08 pm

Master/doctoral thesis figures next to each other

Post by Johannes_B »

Package subfig won't really work with the template, package subcaption will work just fine. The class already uses the caption package internally.

If you don't need a caption, and don't want the image to flow to another place, avoid the figure environment.
You could also use \captionof{figure}{This is the caption} to use a caption without a floating environment (like figure).
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.
Post Reply