Text FormattingJustify line

Information and discussion about LaTeX's general text formatting features (e.g. bold, italic, enumerations, ...)
Post Reply
sladicg
Posts: 7
Joined: Mon Dec 21, 2009 2:42 pm

Justify line

Post by sladicg »

Hi!

I have a problem how to fully justify (left and right) a line of text in a paragraph. Line looks like this:

Code: Select all

Some text before new line \newline some text after newline command
The problem is that text before \newline is not fully justified (left and right), it is only left justified. Text after \newline is fully justified. Any idea how to fully justify text before \newline?

Thanks in advance
Goran

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

svend_tveskaeg
Posts: 478
Joined: Sun Jul 12, 2009 5:31 am

Re: Justify line

Post by svend_tveskaeg »

A minimal working example is always required!

What document class and packages are you using and what is in your preamble?
``In the game of chess, you can never let your adversary see your pieces.''
-- Zapp Brannigan, Futurama (season 1, episode 4)
User avatar
frabjous
Posts: 2064
Joined: Fri Mar 06, 2009 12:20 am

Re: Justify line

Post by frabjous »

Changing \newline to \linebreak may be all you need here.

(But why not let LaTeX decide where to place the linebreaks? It's very good at that!)
sladicg
Posts: 7
Joined: Mon Dec 21, 2009 2:42 pm

Re: Justify line

Post by sladicg »

Thanks, \linebreak solve my problem!
Quickstu
Posts: 1
Joined: Sun Oct 10, 2010 2:44 pm

Re: Justify line

Post by Quickstu »

\linebreak fixed my issue, the reason I didn't want latex to perform the task automatically was because I was using the \url command and it placed the http:// on the first line and the rest on the next line, it looked very untidy but using the \linebreak before the \url fixed it up nicely.

Many thanks.
Post Reply