8

I would like to justify and center text in the following manner:

example

Notice how each line is exactly the same length. How is this done?

I am using a documentclass article and no packages.

2 Answers 2

13
\begin{center} \begin{minipage}{.7\linewidth} jajasdjsdjsd sdj asj \end{minipage} \end{center} 

or you could use

\begin{quotation} jajasdjsdjsd sdj asj \end{quotation} 

(which allows page breaking)

or you could use

\begin{abstract} jajasdjsdjsd sdj asj \end{abstract} 

which is more or less the same, but writes abstract at the start.

2

Notice how each line is exactly the same length.

Surely you want only a narrower paragraph, but as you asked for it, this solution produce the same length also in the last line using to \parfillskip and \emergencystretch. The rest of the obfuscated TeX code is just to be outlandish and not use a simple LaTeX environment (Disclaimer: except for a abstract-like simple paragraph this could produce unexpected problems).

The use of microtype package is optional (if you are tolerant to very bad spacing).

MWE

\documentclass[11pt]{article} \usepackage{microtype} %dummy text \def\blablabla{% \textbf{Abstract}. nano is a small, free and friendly editor which aims to replace Pico, the default editor included in the non-free Pine package. Rather than just copying Pico's look and feel, nano also implements some missing (or disabled by default) features in Pico, such as ``search and replace'' and ``go to line and column number''.} \parskip1em \begin{document} \blablabla {\hsize.5\linewidth\hfill\vbox{\parfillskip0pt% \emergencystretch.5\linewidth\noindent\blablabla}\hfill} \blablabla \end{document} 

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.