Graphics, Figures & TablesMultiple line text between images

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

Multiple line text between images

Post by marcin »

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.

Code: Select all

\documentclass[a4paper,11pt]{article}
\usepackage{polski}
\usepackage[utf8]{inputenc}
\usepackage{graphicx}
\usepackage{anysize}
\marginsize{3.5cm}{2.5cm}{2.5cm}{2.5cm}
\begin{document}
\begin{figure}
    \centering
    \begin{minipage}{.1\textwidth}
        \includegraphics[width=40pt]{PK_logo.jpg}
        \end{minipage}\
POLITECHNIKA KRAKOWSKA im. T. Kosciuszki\\Wydzial Mechaniczny\\Instytut Pojazdow Samochodowych i Silnikow\\Spalinowych
    \begin{minipage}{0.1\textwidth}
        \includegraphics[width=40pt]{WM_logo.jpg}
        \end{minipage}
\end{figure}
\end{document}
Attachments
head.jpg
head.jpg (61.22 KiB) Viewed 3932 times

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org
TikZ book
marcin
Posts: 3
Joined: Wed Nov 01, 2017 1:51 am

Multiple line text between images

Post by marcin »

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.

Code: Select all

\documentclass[a4paper,11pt]{article}
\usepackage{polski}
\usepackage[utf8]{inputenc}
\usepackage{graphicx}
\usepackage{anysize}
\marginsize{3.5cm}{2.5cm}{2.5cm}{2.5cm}
\begin{document}
\begin{figure}
    \centering
    \begin{minipage}{.1\textwidth}
        \includegraphics[width=50pt]{PK_logo.jpg}
        \end{minipage}\
	\begin{minipage}{.78\textwidth}
	    \centering \large \textbf{POLITECHNIKA KRAKOWSKA im. T. Kosciuszki}\\ Wydzial Mechaniczny\\ \textbf{Instytut Pojazdow Samochodowych i Silnikow Spalinowych}
        \end{minipage}\
    \begin{minipage}{0.1\textwidth}
        \includegraphics[width=50pt]{WM_logo.jpg}
        \end{minipage}
\end{figure}
\end{document}
User avatar
Stefan Kottwitz
Site Admin
Posts: 10315
Joined: Mon Mar 10, 2008 9:44 pm

Multiple line text between images

Post by Stefan Kottwitz »

Hi Marcin,

thank you for posting your solution!

Perhaps also try this:

Code: Select all

\documentclass[a4paper,11pt]{article}
\usepackage{polski}
\usepackage[utf8]{inputenc}
\usepackage{graphicx}
\usepackage{anysize}
\marginsize{3.5cm}{2.5cm}{2.5cm}{2.5cm}
\usepackage{tabularx}
\begin{document}
\begin{tabularx}{\textwidth}{@{}m{40pt}>{\centering}Xm{40pt}@{}}
  \includegraphics[width=40pt]{PK_logo.jpg}\vspace{0pt}
             &
             \vspace{-2\baselineskip}
    POLITECHNIKA KRAKOWSKA im. T. Kosciuszki\newline
           Wydzial Mechaniczny\newline
      Instytut Pojazdow Samochodowych i Silnikow\newline
              Spalinowych
             &
  \includegraphics[width=40pt]{WM_logo.jpg}\vspace{0pt}
\end{tabularx}
\end{document}
Stefan
LaTeX.org admin
User avatar
Johannes_B
Site Moderator
Posts: 4182
Joined: Thu Nov 01, 2012 4:08 pm

Multiple line text between images

Post by Johannes_B »

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.

Code: Select all

\documentclass[a4paper,11pt,polish]{article}
\usepackage{babel}
\usepackage[utf8]{inputenc}
\usepackage{graphicx}
\usepackage{geometry}
\geometry{left=3.5cm, right=2.5cm, top=2.5cm,bottom=2.5cm,
showframe}
\begin{document}
{\centering
\includegraphics[width=40pt]{example-image-a}
\hfill
\begin{minipage}[c]{.6\textwidth}
\centering
\textsc{Politechnika Krakowska} im. T. Kosciuszki\par
Wydzial Mechaniczny\par
Instytut Pojazdow Samochodowych i Silnikow\par
Spalinowych
\end{minipage}
\hfill
\includegraphics[width=40pt]{example-image-b}}
\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.
Post Reply