LaTeX forum ⇒ Page Layoutsubfigures alignment horizontally Topic is solved

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

subfigures alignment horizontally

Postby nadaa » Thu Nov 02, 2017 8:58 pm

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.

  1. \documentclass[a4paper,12pt]{report}
  2. \begin{document}
  3. \begin{figure}[h]
  4. \begin{subfigure}[b]{0.5\linewidth}
  5. \centering
  6. \includegraphics[width=\textwidth]{pic1}
  7. \end{subfigure}\hfill
  8.  
  9. \begin{subfigure}[b]{0.5\linewidth}
  10. \centering
  11. \includegraphics[width=\textwidth]{pic2}
  12. \end{subfigure}
  13. \caption{}
  14. \label{}
  15. \end{figure}
  16. \end{document}


I have been trying for a long time to fix subfigures positions!. Any suggestion to solve this?

Regards

Tags:

User avatar
Johannes_B
Site Moderator
Posts: 3584
Joined: Thu Nov 01, 2012 4:08 pm

Postby Johannes_B » Thu Nov 02, 2017 9:12 pm

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

Postby nadaa » Thu Nov 02, 2017 10:26 pm

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


Return to “Page Layout”

Who is online

Users browsing this forum: Yahoo [Bot] and 5 guests