LaTeX forum ⇒ Text FormattingKomascript full justification

Information and discussion about LaTeX's general text formatting features (e.g. bold, italic, enumerations, ...)
Pangur
Posts: 14
Joined: Thu Jul 19, 2018 4:47 pm

Komascript full justification

Postby Pangur » Thu Jul 19, 2018 5:54 pm

Does anyone know how to make paragraph text fully aligned in Komascript. I want text to be flush on both right and left. I am not interest in anything that ends up with ragged right, nor with ragged left.
Last edited by Pangur on Thu Jul 19, 2018 11:50 pm, edited 1 time in total.

User avatar
Stefan Kottwitz
Site Admin
Posts: 9313
Joined: Mon Mar 10, 2008 9:44 pm

Postby Stefan Kottwitz » Thu Jul 19, 2018 6:27 pm

Full justification, both left and right, is the default. Take a look (click on "Open in Overleaf" if you like).

  1. \documentclass{scrartcl}
  2. \usepackage{blindtext}
  3. \begin{document}
  4. \section{Test}
  5. \blindtext
  6. \end{document}


You may have a (perhaps implicit) \raggedright in the code that disables the justification.

Stefan
Site admin

User avatar
Johannes_B
Site Moderator
Posts: 3963
Joined: Thu Nov 01, 2012 4:08 pm

Postby Johannes_B » Thu Jul 19, 2018 7:27 pm

It could also be possible that you used \centering on the titlepage without proper grouping.
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.

Pangur
Posts: 14
Joined: Thu Jul 19, 2018 4:47 pm

Postby Pangur » Thu Jul 19, 2018 11:52 pm

Thanks, Stefan. That must be why when I looked in the Manual, it gave every option but that the default.

Thanks, again.

Pangur
Posts: 14
Joined: Thu Jul 19, 2018 4:47 pm

Postby Pangur » Thu Jul 19, 2018 11:56 pm

Thanks, Johannes_B.

I think I had a centering left over from my front cover/ title page.

User avatar
Stefan Kottwitz
Site Admin
Posts: 9313
Joined: Mon Mar 10, 2008 9:44 pm

Postby Stefan Kottwitz » Fri Jul 20, 2018 12:13 am

Yes, have a \centering always within curly braces { ... } or within an environment. An environment, such as figure or table, limits the effect of this command (any local command). Or one can use \begin{center} ... \end{center} for centered text such as on the title page,

Stefan
Site admin

Pangur
Posts: 14
Joined: Thu Jul 19, 2018 4:47 pm

Postby Pangur » Fri Jul 20, 2018 12:39 am

I had the package ragged2e but commented out. I removed it altogether. There were still bits of the text sticking into the right margin, and other parts not even reaching the margin. I decided to use \sloppy, which gave me exactly what I was looking for. I am hoping that there is no real drawback to this.

User avatar
Stefan Kottwitz
Site Admin
Posts: 9313
Joined: Mon Mar 10, 2008 9:44 pm

Postby Stefan Kottwitz » Fri Jul 20, 2018 11:18 am

\sloppy can fix it, though it may have a drawback that some inter word spaces may become to big with such enforced justification.

There are ways to improve justification:

  1. \usepackage[english]{babel}% or choose your language
  2. \usepackage[T1]{fontenc}% important for hyphenation of words with accents
  3. \usepackage{microtype}% optimized justification via improved microtypography on character level


And if you use default standard fonts Computer Modern (PDF font can become blurry with the default font with T1 encoding), I would switch to Latin Modern (similar but improved):

  1. \usepackage{lmodern}


If you try this instead of \sloppy, does it get better already?

Stefan
Site admin

Pangur
Posts: 14
Joined: Thu Jul 19, 2018 4:47 pm

Postby Pangur » Fri Jul 20, 2018 7:47 pm

Stefan Kottwitz wrote:
  1. \usepackage[english]{babel}% or choose your language
  2. \usepackage[T1]{fontenc}% important for hyphenation of words with accents
  3. \usepackage{microtype}% optimized justification via improved microtypography on character level

  1. \usepackage{lmodern}


If you try this instead of \sloppy, does it get better already?
Stefan


I was using babel and fontenc already, but I added microtype and lmodern instead of \sloppy, and the justification became really good. I did not like the faint lmodern as it is not so good easy reading for public speaking. The font that I was using was sorceanspro. However, i am going through a few to find one that makes good contrasts between bold and normal, etc.
Thanks for the tip. I shall try to use \sloppy sparingly, and concentrate on finding a font that works for my purposes instead. That way, I might not need \sloppy at all. Thanks for your advice.

Pangur
Posts: 14
Joined: Thu Jul 19, 2018 4:47 pm

Postby Pangur » Fri Jul 20, 2018 9:30 pm

Tried several different fonts now, without \sloppy but with microtype. Works like it should! Thanks, Stefan :)


Return to “Text Formatting”

Who is online

Users browsing this forum: No registered users and 4 guests