Text Formattingthesis title

Information and discussion about LaTeX's general text formatting features (e.g. bold, italic, enumerations, ...)
Post Reply
Jurandi
Posts: 1
Joined: Tue Jun 14, 2022 1:37 am

thesis title

Post by Jurandi »

I need to put two logos on the same line, one on the left side, one on the right side. I'm trying the following code, but the two logos appear on the left side, one below the other... I don't know where I'm going wrong... I need help.

Code: Select all

\def\logos{
    {\parbox[c]{0cm}{\includegraphics[width=2.2cm]{logo-unicamp.pdf}}}
       {\parbox[c]{\textwidth}
       {
        \noindent
         \centering{
           \large \MakeUppercase{\@UNICAMP}\\
                   \@FT}
       }
       }
       {\parbox[c]{0cm}{\includegraphics[width=3.0cm]{logotipos/LOGO-EQ.jpg}}}
}

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org
LaTeX Beginner's Guide LaTeX Cookbook LaTeX TikZ graphics TikZによるLaTeXグラフィックス
byn
Posts: 56
Joined: Fri Jun 10, 2022 12:27 pm

thesis title

Post by byn »

You can try to use a \vspace*{-1em} to manually push the logo up wards. Note that the {-1em} depends on your satisfaction, it can be any number that matches your same height for all logos.
rais
Posts: 419
Joined: Sun Nov 16, 2014 8:51 pm

thesis title

Post by rais »

that would push the second image in front of the first, AFAICS.

@Jurandi: you put more than \textwidth into it. As a rule of thump, a newline after a brace is considered as "space", so you're adding to \textwidth...
What's more, the first \parbox might get indented, anyway.
Your concept of forcing the images into zero-width boxes and trying to fit a \parbox with \textwidth in-between is dubious, at best. Should either \@UNICAMP or \@FT be wider than the space available, which is less than the box you're putting them in, they'd overlap with the images. Well, actually the text or whatever's contained in those commands would overlap (part of) the first image, and the second image---if placed correctly---would overlap those commands. I'd rather reserve the space needed for the images already in the call for their parboxes and take those widths off the middle parbox:

Code: Select all

\documentclass{article}
\usepackage{graphicx}
\makeatletter
\newcommand*\@UNICAMP{University For The Gifted}% or whatever
\newcommand*\@FT{Some more info}
\def\logos{%
\par\noindent
\parbox[c]{2.2cm}{\includegraphics[width=\linewidth]{example-image-a}}%
\parbox[c]{\dimexpr\textwidth-5.2cm\relax}{%
%\noindent before \centering isn't needed
\centering{
\large \MakeUppercase{\@UNICAMP}\\
\@FT}
}%
\parbox[c]{0cm}{\includegraphics[width=3.0cm]{example-image-b}}
}
\makeatother
\begin{document}
\noindent\hrulefill %just for demo
\logos
\end{document}
PS) Of course, I was thinking of "school for the gifted" while making up the text for \@UNICAMP :mrgreen:

[edit]
Of course, you could replace

Code: Select all

\parbox[c]{0cm}{\includegraphics[width=3.0cm]{example-image-b}}
with

Code: Select all

\parbox[c]{3cm}{\includegraphics[width=\linewidth]{example-image-b}}
for consistency.
[/edit]
KR
Rainer
Post Reply