TransWikia.com

How to remove indent and also justify the text and avoid text going out of margin

TeX - LaTeX Asked on January 24, 2021

I want to add text in justified and without indent. Can someone help how to go further from this code. Also the text crosses the margin. How to stop it

documentclass[paper=A6]{scrartcl}
usepackage[automark,headsepline=false,footsepline=false]{scrlayer-scrpage}
usepackage[showframe]{geometry}
begin{document}
newgeometry{left=8mm,right=8mm,top=8mm, bottom=8mm}

[17-20/44][1/6][1-2/2][23-26/50][4-7/12] 5x[16/16][1/1]

sometextsometextsometextsometextsometext sometextsometext

end{document}

Below is the output

enter image description here

One Answer

Ok, the indent you can remove by either placing noindent in front of the line you want to have without it to remove a parindent locally

or

you place a setlengthparindent{0pt} in your preamble to disable parindents globally.

Loading the microtype-package can also help in reducing overfull hboxes

Your code would then look like this:

documentclass[paper=A6]{scrartcl}
usepackage[automark,headsepline=false,footsepline=false]{scrlayer-scrpage}
usepackage[showframe]{geometry}
usepackage[english]{babel}
usepackage{microtype}
begin{document}
newgeometry{left=8mm,right=8mm,top=8mm, bottom=8mm}

noindent[17-20/44][1/6][1-2/2][23-26/50][4-7/12] 5x[16/16][1/1]

sometextsometextsometextsometextsometext sometextsometext

end{document}

noindent

Edit

The example given is not exactly fair, since in a regular text you wouldn't have to deal with words of such length (except if you're Welsh or German). You can always insert allowbreak inside words if you want them to be broken without hyphenation:

documentclass[paper=A7]{scrartcl}
usepackage[automark,headsepline=false,footsepline=false]{scrlayer-scrpage}
usepackage[showframe]{geometry}
usepackage[english]{babel}
usepackage{microtype}
usepackage{blindtext}
begin{document}
newgeometry{left=8mm,right=8mm,top=8mm, bottom=8mm}

noindent[17-20/44][1/6]allowbreak [1-2/2][23-26/50]allowbreak [4-allowbreak7allowbreak /12] 5x[16/16][1/1]

blindtext

end{document}

allowbreak

Correct answer by phil-elkabat on January 24, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP