Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I would center horizontally and vertically a block of text as if it was an abstract text block.How can I do?

I tried this:

\null\vfill
\begin{center}

\end{center}
\vfill\null

it It correct?

share|improve this question
    
The second \null should be \clearpage; I'd use \vspace*{\fill} instead of \null\vfill, but it's personal preference. –  egreg Sep 8 '12 at 19:32
    
But how can I justify text...? –  Mazzy Sep 8 '12 at 19:33
1  
Use a minipage inside center. –  egreg Sep 8 '12 at 19:33
    
How does minipage work? –  Mazzy Sep 8 '12 at 19:38

1 Answer 1

up vote 10 down vote accepted

A "correct" way could be

\clearpage
\vspace*{\fill}
\begin{center}
\begin{minipage}{.6\textwidth}
Text that will be justified
...
\end{minipage}
\end{center}
\vfill % equivalent to \vspace{\fill}
\clearpage

The top vertical space should be \vspace*, so it doesn't disappear at the break. The justified text will be on a line width that's 6/10 of the normal line width, change the fraction to suit you.

You can in a similar way decide also for different spaces at the top and at the bottom; for instance

\clearpage
\vspace*{\stretch{2}}
\begin{center}
\begin{minipage}{.6\textwidth}
Text that will be justified
...
\end{minipage}
\end{center}
\vspace{\stretch{3}}
\clearpage

will leave spaces in the proportion 2/3; something of this kind can turn useful for a dedication page, as the dedication is usually not in the center of the page.

If you need that the text inside the minipage has indented paragraphs as the normal text, then center and minipage are not good. This can be accomplished by a more complicated construction:

\documentclass{article}
\usepackage{lipsum}

\begin{document}

\clearpage
\vspace*{\fill}
\begin{list}{}{%
  \leftmargin=.2\textwidth
  \rightmargin=.2\textwidth
  \listparindent=\parindent
  \itemindent=\parindent
  \itemsep=0pt
  \parsep=0pt}
\item\relax
\lipsum[1-2]
\end{list}
\vfill % equivalent to \vspace{\fill}
\clearpage

\end{document}

The package lipsum just produces some text.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.