Pilfering from @egreg's answer... You could modify the inter-word spacing or just add a couple of \hfill
s inbetween:
\documentclass{article}
\usepackage{booktabs}% http://ctan.org/pkg/booktabs
\begin{document}
\mbox{\huge\bfseries
\begin{tabular}{@{}c@{}}
\toprule[.25mm]
This is my title, it is somewhat\\
long\hfill and\hfill split\hfill over\hfill two\hfill lines!\\
\bottomrule[.25mm]
\end{tabular}%
}
\end{document}
On its own, \hfill
will do nothing inside a tabular
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]
(for s
tretch) if you know the <len>
that <stuff>
should be spread over:
\documentclass{article}
\usepackage{booktabs}% http://ctan.org/pkg/booktabs
\begin{document}
\newlength{\mylen}
\noindent{\huge\bfseries
\settowidth{\mylen}{This is my title, it is somewhat}%
\begin{tabular}{@{}c@{}}
\toprule[.25mm]
This is my title, it is somewhat\\
\makebox[\mylen][s]{long and split over two lines!}\\
\bottomrule[.25mm]
\end{tabular}%
}
\end{document}
beamer
has its own ways and, in particular, it redefines many standard LaTeX environments/commands; in particular, it redefines the basic list-like environments itemize
, enumerate
and description
.
Here's, for example, the definition of \itemize
as given in beamerbaselocalstructure.sty
:
\renewcommand{\itemize}[1][]{%
\beamer@ifempty{#1}{}{\def\beamer@defaultospec{#1}}%
\ifnum \@itemdepth >2\relax\@toodeep\else
\advance\@itemdepth\@ne
\beamer@computepref\@itemdepth% sets \beameritemnestingprefix
\usebeamerfont{itemize/enumerate \beameritemnestingprefix body}%
\usebeamercolor[fg]{itemize/enumerate \beameritemnestingprefix body}%
\usebeamertemplate{itemize/enumerate \beameritemnestingprefix body begin}%
\list
{\usebeamertemplate{itemize \beameritemnestingprefix item}}
{\def\makelabel##1{%
{%
\hss\llap{{%
\usebeamerfont*{itemize \beameritemnestingprefix item}%
\usebeamercolor[fg]{itemize \beameritemnestingprefix item}##1}}%
}%
}%
}
\fi%
\beamer@cramped%
\raggedright%
\beamer@firstlineitemizeunskip%
}
as you can see, \itemize
internally uses \raggedright
. The best approach to keep things overlay specification-aware is to redefine \itemize
to use \justifying
(from the ragged2e
package) instead; the following code shows this redefinition in an actual document:
\documentclass{beamer}
\usepackage{ragged2e}
\usepackage{lipsum}
\makeatletter
\renewcommand{\itemize}[1][]{%
\beamer@ifempty{#1}{}{\def\beamer@defaultospec{#1}}%
\ifnum \@itemdepth >2\relax\@toodeep\else
\advance\@itemdepth\@ne
\beamer@computepref\@itemdepth% sets \beameritemnestingprefix
\usebeamerfont{itemize/enumerate \beameritemnestingprefix body}%
\usebeamercolor[fg]{itemize/enumerate \beameritemnestingprefix body}%
\usebeamertemplate{itemize/enumerate \beameritemnestingprefix body begin}%
\list
{\usebeamertemplate{itemize \beameritemnestingprefix item}}
{\def\makelabel##1{%
{%
\hss\llap{{%
\usebeamerfont*{itemize \beameritemnestingprefix item}%
\usebeamercolor[fg]{itemize \beameritemnestingprefix item}##1}}%
}%
}%
}
\fi%
\beamer@cramped%
\justifying% NEW
%\raggedright% ORIGINAL
\beamer@firstlineitemizeunskip%
}
\makeatother
\begin{document}
\begin{frame}
\begin{itemize}
\item<1->\lipsum[2]
\item<2>\lipsum[2]
\end{itemize}
\end{frame}
\end{document}
The output:
As a final note, I would suggest you to consider if this redefinition is really needed at all; frames with too much text (like the one I just build for the example) are to be avoided in a presentation.
Best Answer
or you could use
(which allows page breaking)
or you could use
which is more or less the same, but writes abstract at the start.