23

I am writing a thesis and at the bottom of the title page, I need to include two participating institutes. So far, I have come up with this (using \parbox, but I cannot figure out how to right align the second block because \begin{flushright} starts a new paragraph and thus adds another line:

\parbox[t][3cm][t]{7cm}{\normalsize Figurative Unit (Optional)\\
Department of Blabla\\
University of Blabla} 
\parbox[t][3cm][t]{7cm}{\normalsize Chair of Mickey Mouse Science\\
Institute of Disneyland Studies\\
FSF Blabla} 

This results in:

enter image description here

As I said, I would like the right text block to be right-aligned to the margin of the page, which is set to 40mm ( \newgeometry{left=40mm,right=40mm,top=30mm} ). In the above example I used absolute distance measures but I assume it could be done more elegantly.

6
  • 1
    Welcome to TeX.sx! Using \hfill instead of the space (in your code the end-of-line) between the first and second \parbox should do.
    – egreg
    Commented Apr 8, 2013 at 8:10
  • No, that doesn't do. Or maybe I didn't understand what you meant, exactly. Maybe you could provide this as an answer?
    – grssnbchr
    Commented Apr 8, 2013 at 8:15
  • It's better if you add a minimal working example (MWE) that illustrates your problem.
    – egreg
    Commented Apr 8, 2013 at 8:16
  • No. There's nothing more to explain, really. And I think this is a problem that has been solved thousands of times already (although Google hasn't much to offer.
    – grssnbchr
    Commented Apr 8, 2013 at 8:18
  • 2
    Try \normalsize\raggedleft in the second parbox. If that doesn't do what you want, add a MWE.
    – lockstep
    Commented Apr 8, 2013 at 8:18

3 Answers 3

16

You could use two minipages, like this.

\documentclass{minimal}
\begin{document}
\begin{minipage}[t]{0.48\textwidth}
Figurative Unit (Optional)\\
Department of Blabla\\
University of Blabla
\end{minipage}
\hfill
\begin{minipage}[t]{0.48\textwidth}
\begin{flushright}
Chair of Mickey Mouse Science\\
Institute of Disneyland Studies\\
FSF Blabla
\end{flushright}
\end{minipage}
\end{document}
4
  • Welcome to TeX.sx! Commented Apr 8, 2013 at 8:55
  • Even better and more elegant ;-)
    – grssnbchr
    Commented Apr 8, 2013 at 9:01
  • 3
    +1. Note that one still may use \raggedleft instead of the flushright environment inside the minipage.
    – lockstep
    Commented Apr 8, 2013 at 9:05
  • Thanks @PeterJansson! I've benefited from all the information on this site as a long-time lurker, so I thought I'd see if I could contribute anything.
    – erik
    Commented Apr 9, 2013 at 7:49
9

Try \normalsize\raggedleft in the second parbox.

0

As a LaTeX "non-expert", it took me way longer than necessary to understand the answer and comment of @lockstep and to find, understand, transfer/apply the comment of @egreg to my problem (in a table), so I decided to create usable copy and paste MWE code for others. Please also give them credit. This works in the OP's case:

\documentclass{article}
\usepackage[utf8]{inputenc}

\begin{document}
\parbox[t][3cm][t]{7cm}{\normalsize Figurative Unit (Optional)\\
Department of Blabla\\
University of Blabla} 
\parbox[t][3cm][t]{7cm}{\normalsize\raggedleft Chair of Mickey Mouse Science\\
Institute of Disneyland Studies\\
FSF Blabla} 
\end{document}

However, if you work in tables, you might get an ugly left-alignment of the last row/line – in this case, use \hfill in the last line (you might not need the \normalsize):

\documentclass{article}
\usepackage[utf8]{inputenc}

\begin{document}
\parbox[t][3cm][t]{7cm}{\normalsize Figurative Unit (Optional)\\
Department of Blabla\\
University of Blabla} 
\parbox[t][3cm][t]{7cm}{\normalsize\raggedleft Chair of Mickey Mouse Science\\
Institute of Disneyland Studies\\
\hline FSF Blabla} % <--- note the \hline here
\end{document}

In my table, this is what it looked without \hfill in the last line:
LaTeX parbox right-aligned last line left-aligned

and this is with \hfill in the beginning of the last line:
LaTeX parbox right-aligned last line right-aligned

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .