Text FormattingJustification problem

Information and discussion about LaTeX's general text formatting features (e.g. bold, italic, enumerations, ...)
Post Reply
e163026
Posts: 3
Joined: Wed May 15, 2013 5:09 pm

Justification problem

Post by e163026 »

Hi,

I'm am a newbie so sorry for the possible mistakes in advance. I was just playing with LaTeX, I encountered the following problem.

Code: Select all

\documentstyle{book}
\begin{document}
In 1992, Barcelona gained international recognition by hosting the olympic games which brought a massive upturn in its tourism industry. This had the effect of changing the city in ways that are still felt today with neighbourhoods renovated (and in some cases levelled) and the intense focus of modern design permeating all aspects of life in Barcelona from public buildings to something as simple as a park bench or an event poster. 
\end{document}
When I typeset this code the word olympic is out of alignment, what can I do to fix this problem? Thanks a lot.
Attachments
how it looks
how it looks
typeset.png (98.9 KiB) Viewed 11125 times
Last edited by cgnieder on Wed May 15, 2013 8:51 pm, edited 3 times 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.

Johannes_B
Site Moderator
Posts: 4182
Joined: Thu Nov 01, 2012 4:08 pm

Justification problem

Post by Johannes_B »

Code: Select all

\documentclass{book}
\begin{document}
In 1992, Barcelona gained international recognition by hosting
the olympic games which brought a massive upturn in its tourism
 industry. This had the effect of changing the city in ways that
 are still felt today with neighbourhoods renovated (and in some
 cases levelled) and the intense focus of modern design permeating
 all aspects of life in Barcelona from public buildings to 
something as simple as a park bench or an event poster.
\end{document}
Please take a closer look to the first line of my code and spot the difference.
This is the syntax of LaTeX2e. Latex2.09 is out of business for almost twenty years.

LaTeX for complete novices
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.
mas
Posts: 226
Joined: Thu Dec 04, 2008 4:39 am

Justification problem

Post by mas »

e163026 wrote:Hi,

I'm am a newbie so sorry for the possible mistakes in advance. I was just playing with LaTex, I encountered the following problem.
Welocme to the wonderful world of LaTeX :-)

To start, you should always give a compilable example. Use the code tags to enclose your LaTeX text, not latex. This will help people to debug the problems easily.

Regarding the word "olympic" sticking out, it is because TeX is not able to find a good place to break the word and hence puts it as is. You should always check for such bad breaks in your document. To help in that, use

Code: Select all

\documentstyle[draft]{book}
The bad breaks will be shown as black blocks for you to correct.

Your specific problem can be corrected by the following:

Code: Select all

\documentstyle[draft]{book}
\begin{document}
In 1992, Barcelona gained international recognition by hosting the olym\-pic games 
which brought a massive upturn in its tourism industry. This had the effect of 
changing the city in ways that are still felt today with neighbourhoods renovated 
(and in some cases levelled) and the intense focus of modern design permeating 
all aspects of life in Barcelona from public buildings to something as simple as 
a park bench or an event poster. 
\end{document}

OS: Debian/GNU Linux; LaTeX System : TeXLive; Editor : Vim
e163026
Posts: 3
Joined: Wed May 15, 2013 5:09 pm

Re: Justification problem

Post by e163026 »

Thanks a lot for all your help :)
User avatar
cgnieder
Site Moderator
Posts: 2000
Joined: Sat Apr 16, 2011 7:27 pm

Justification problem

Post by cgnieder »

Hi mas and e163026,

I like to stress out what Johannes correctly but maybe not distinct enough pointed out: \documentstyle is LaTeX2.09 syntax and deprecated since June 1994! The right command since then is \documentclass.

Regards
site moderator & package author
e163026
Posts: 3
Joined: Wed May 15, 2013 5:09 pm

Justification problem

Post by e163026 »

cgnieder wrote:Hi mas and e163026,

I like to stress out what Johannes correctly but maybe not distinct enough pointed out: \documentstyle is LaTeX2.09 syntax and deprecated since June 1994! The right command since then is \documentclass.

Regards
Thanks for the explanation, I didn't realize that, I am reading an old book :)
mas
Posts: 226
Joined: Thu Dec 04, 2008 4:39 am

Justification problem

Post by mas »

cgnieder wrote: I like to stress out what Johannes correctly but maybe not distinct enough pointed out: \documentstyle is LaTeX2.09 syntax and deprecated since June 1994! The right command since then is \documentclass.
That was a oops moment on my part :oops: I misread (don't ask me how) documentstyle as documentclass and proceeded with the answer. Thanks for catching the mistake.

Regards.

OS: Debian/GNU Linux; LaTeX System : TeXLive; Editor : Vim
Post Reply