Page Layoutsubfigures alignment horizontally

Information and discussion about page layout specific issues (e.g. header and footer lines, page formats, page numbers).
Post Reply
nadaa
Posts: 19
Joined: Sun Nov 20, 2016 8:12 pm

subfigures alignment horizontally

Post by nadaa »

Hi,
I want to align many subfigures horizontally in pairs. It worked with me using the below code only in once, and images appear vertically if I use the same code again in consecutive pages.

Code: Select all

\documentclass[a4paper,12pt]{report}
  \begin{document}
       \begin{figure}[h]
	\begin{subfigure}[b]{0.5\linewidth}
		\centering
		\includegraphics[width=\textwidth]{pic1}
	\end{subfigure}\hfill
	
	\begin{subfigure}[b]{0.5\linewidth}
		\centering
		\includegraphics[width=\textwidth]{pic2}
	\end{subfigure}
	\caption{}
	\label{}
\end{figure}
\end{document}
I have been trying for a long time to fix subfigures positions!. Any suggestion to solve this?

Regards

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

subfigures alignment horizontally

Post by Johannes_B »

A blank line will always lead to vertical content, as it is a paragraph break. Remove the blan ine or put a % at the very beginning.
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.
nadaa
Posts: 19
Joined: Sun Nov 20, 2016 8:12 pm

subfigures alignment horizontally

Post by nadaa »

Johannes_B wrote:A blank line will always lead to vertical content, as it is a paragraph break. Remove the blan ine or put a % at the very beginning.
Thanks a lot, Johannes. This really helped me! :D
Post Reply