Text Formattingtext justify within description environment

Information and discussion about LaTeX's general text formatting features (e.g. bold, italic, enumerations, ...)
Post Reply
vaalsta
Posts: 9
Joined: Tue Jul 20, 2010 9:59 am

text justify within description environment

Post by vaalsta »

When using the description environment the paragraph text (after the item heading) is flushleft but raggedright. I want it to be fully justified (right and left). If I put the text in flushright environment the left side becomes jagged and including both flushright and flushleft does not work.

How do I do this?


example:

Code: Select all

\begin{description}
\item[heading1:]This is the text that I want justified.  If there is enough text to make it multi-line the right hand edge is always ragged but I need it to be flush on both the left and right side.
\item[headin2:]etc...
\end{description}

Thanks all.
Last edited by vaalsta on Thu Jul 22, 2010 10:28 am, edited 1 time in total.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

Stefan Kottwitz
Site Admin
Posts: 10335
Joined: Mon Mar 10, 2008 9:44 pm

text justify within description environment

Post by Stefan Kottwitz »

Hi vaalsta,

welcome to the board!
This example is full justified by default. Try:

Code: Select all

\documentclass{article}
\begin{document}
\begin{description}
\item[heading1:]This is the text that I want justified.  If there is enough text to make it multi-line the right hand edge is always ragged but I need it to be flush on both the left and right side.
\item[heading2:]etc...
\end{description}
\end{document}
If you would post a compilable minimal example we could see the problem - it's caused somewhere else in your code.

Stefan
LaTeX.org admin
vaalsta
Posts: 9
Joined: Tue Jul 20, 2010 9:59 am

Re: text justify within description environment

Post by vaalsta »

Hi Stefan,
Thanks for the welcome and the reply. In starting to create a MWE I realised the problem. I was using a document template someone else had set up and I failed to see the \raggedright command hidden in the preamble. Removing this fixed the problem and didn't introduce any for my document.

Solved, Thanks!
Post Reply