LaTeX forum ⇒ Graphics, Figures & TablesMultiple line text between images

Information and discussion about graphics, figures & tables in LaTeX documents.
marcin
Posts: 3
Joined: Wed Nov 01, 2017 1:51 am

Multiple line text between images

Postby marcin » Wed Nov 01, 2017 2:08 am

Hi guys,
I'm trying to make a header for my title page in my thesis. It contains two small images, between which there is a four-line text. It looks like in the attachment. Images are roughly to take about 0.15 of textwidth each.
I was trying to accomplish this by tables or minipages, or by combining them, but it doesn't give me the expected result. Can you please help? :)
This is my current code I'm working with.

  1. \documentclass[a4paper,11pt]{article}
  2. \usepackage{polski}
  3. \usepackage[utf8]{inputenc}
  4. \usepackage{graphicx}
  5. \usepackage{anysize}
  6. \marginsize{3.5cm}{2.5cm}{2.5cm}{2.5cm}
  7. \begin{document}
  8. \begin{figure}
  9. \centering
  10. \begin{minipage}{.1\textwidth}
  11. \includegraphics[width=40pt]{PK_logo.jpg}
  12. \end{minipage}\
  13. POLITECHNIKA KRAKOWSKA im. T. Kosciuszki\\Wydzial Mechaniczny\\Instytut Pojazdow Samochodowych i Silnikow\\Spalinowych
  14. \begin{minipage}{0.1\textwidth}
  15. \includegraphics[width=40pt]{WM_logo.jpg}
  16. \end{minipage}
  17. \end{figure}
  18. \end{document}
Attachments
head.jpg
head.jpg (61.22 KiB) Viewed 81 times

Tags:

marcin
Posts: 3
Joined: Wed Nov 01, 2017 1:51 am

Postby marcin » Wed Nov 01, 2017 3:16 am

Seems that I have found an answer on my own :D Sorry for the trouble, but for the future: use minipages for images and text as well.

  1. \documentclass[a4paper,11pt]{article}
  2. \usepackage{polski}
  3. \usepackage[utf8]{inputenc}
  4. \usepackage{graphicx}
  5. \usepackage{anysize}
  6. \marginsize{3.5cm}{2.5cm}{2.5cm}{2.5cm}
  7. \begin{document}
  8. \begin{figure}
  9. \centering
  10. \begin{minipage}{.1\textwidth}
  11. \includegraphics[width=50pt]{PK_logo.jpg}
  12. \end{minipage}\
  13. \begin{minipage}{.78\textwidth}
  14. \centering \large \textbf{POLITECHNIKA KRAKOWSKA im. T. Kosciuszki}\\ Wydzial Mechaniczny\\ \textbf{Instytut Pojazdow Samochodowych i Silnikow Spalinowych}
  15. \end{minipage}\
  16. \begin{minipage}{0.1\textwidth}
  17. \includegraphics[width=50pt]{WM_logo.jpg}
  18. \end{minipage}
  19. \end{figure}
  20. \end{document}

User avatar
Stefan Kottwitz
Site Admin
Posts: 8522
Joined: Mon Mar 10, 2008 9:44 pm
Location: Hamburg, Germany
Contact:

Postby Stefan Kottwitz » Wed Nov 01, 2017 3:24 am

Hi Marcin,

thank you for posting your solution!

Perhaps also try this:

  1. \documentclass[a4paper,11pt]{article}
  2. \usepackage{polski}
  3. \usepackage[utf8]{inputenc}
  4. \usepackage{graphicx}
  5. \usepackage{anysize}
  6. \marginsize{3.5cm}{2.5cm}{2.5cm}{2.5cm}
  7. \usepackage{tabularx}
  8. \begin{document}
  9. \begin{tabularx}{\textwidth}{@{}m{40pt}>{\centering}Xm{40pt}@{}}
  10. \includegraphics[width=40pt]{PK_logo.jpg}\vspace{0pt}
  11. &
  12. \vspace{-2\baselineskip}
  13. POLITECHNIKA KRAKOWSKA im. T. Kosciuszki\newline
  14. Wydzial Mechaniczny\newline
  15. Instytut Pojazdow Samochodowych i Silnikow\newline
  16. Spalinowych
  17. &
  18. \includegraphics[width=40pt]{WM_logo.jpg}\vspace{0pt}
  19. \end{tabularx}
  20. \end{document}


Stefan
Site admin

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

Postby Johannes_B » Wed Nov 01, 2017 6:06 am

Never use a figure environment on a titlepage.
https://en.m.wikibooks.org/wiki/LaTeX/Title_Creation

I would do it like this, please see also the other code changes, getting rid of old and substituted packages.
  1. \documentclass[a4paper,11pt,polish]{article}
  2. \usepackage{babel}
  3. \usepackage[utf8]{inputenc}
  4. \usepackage{graphicx}
  5. \usepackage{geometry}
  6. \geometry{left=3.5cm, right=2.5cm, top=2.5cm,bottom=2.5cm,
  7. showframe}
  8. \begin{document}
  9. {\centering
  10. \includegraphics[width=40pt]{example-image-a}
  11. \hfill
  12. \begin{minipage}[c]{.6\textwidth}
  13. \centering
  14. \textsc{Politechnika Krakowska} im. T. Kosciuszki\par
  15. Wydzial Mechaniczny\par
  16. Instytut Pojazdow Samochodowych i Silnikow\par
  17. Spalinowych
  18. \end{minipage}
  19. \hfill
  20. \includegraphics[width=40pt]{example-image-b}}
  21. \end{document}
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.


Return to “Graphics, Figures & Tables”

Who is online

Users browsing this forum: No registered users and 9 guests