On my title page, I have something like this:
\rule{\linewidth}{0.25mm}\\[0.25cm]
\huge
\textbf{This is my title, it is somewhat long and split over two lines!}\\[0.25cm]
\normalsize
\rule{\linewidth}{0.25mm}
and this is the corresponding output:
--------------------------------------
This is my title, it is somewhat
long and split over two lines!
--------------------------------------
Notice two things:
- The top first and the (wrapped) second line are similar, but different lengths. I would like to justify them (compress the top line slightly, and expand the bottom slightly).
- The
\rule
is extended to the\linewidth
, whereas I would like it to be the width of the text in between the rules.
The result I'd like is something like:
--------------------------------
This is my title, it is somewhat
long and split over two lines!
--------------------------------
Any help with how to accomplish this? Thank you 🙂
Best Answer
Pilfering from @egreg's answer... You could modify the inter-word spacing or just add a couple of
\hfill
s inbetween:On its own,
\hfill
will do nothing inside atabular
if there isn't enough room to stretch. However, since the first line is longer than the second, there is room to stretch.\makebox[<len>][<justification>]{<stuff>}
can also be used with<justification>
given by[s]
(fors
tretch) if you know the<len>
that<stuff>
should be spread over: