The spacing on the left side is bigger than the spacing on the right side. How can I center this for any text?
Text Formatting ⇒ Horizontal centering a flushleft text
-
MasterWizz
- Posts: 6
- Joined: Wed Jan 27, 2021 1:11 am
Horizontal centering a flushleft text
The spacing on the left side is bigger than the spacing on the right side. How can I center this for any text?
Learn LaTeX easily with newest books:
The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis
The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more
LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis
- Ijon Tichy
- Posts: 640
- Joined: Mon Dec 24, 2018 10:12 am
Horizontal centering a flushleft text
fushleft is an environment. You should not misuse it as command. The corresponding command would be \raggedright.This only seems so and is a combination of an optical effect an the fact, that no text line of the shown example reachs to the right edge of the text area. This is an usual effect of unjustified text without hyphenation. You could minimize this effect, by allowing hyphenation using package ragged2e:MasterWizz wrote: The spacing on the left side is bigger than the spacing on the right side.
Code: Select all
\documentclass{report}
\usepackage[margin=14.3pt,paperwidth=194pt,paperheight=194pt,showframe]{geometry}
\usepackage{ragged2e}
\usepackage{lipsum}
\begin{document}
\RaggedRight
\lipsum[3]
\end{document}geometry's option showframe to illustrate the text area and show, that this is indeed centered.BTW:
report does not provide font size 9pt. So option 9pt is unused in your example. If you really need 9pt you have to use an extra package like extsizes or scrextend or use another class, that provides font sizes other than 10pt, 11pt or 12pt, e.g., a KOMA-Script class.-
MasterWizz
- Posts: 6
- Joined: Wed Jan 27, 2021 1:11 am
Horizontal centering a flushleft text
I also understand that this is not a typical LaTeX request and I also think its extremely questionable. But I need it for a special project. Is there any chance to get this strange result?
- Ijon Tichy
- Posts: 640
- Joined: Mon Dec 24, 2018 10:12 am
Horizontal centering a flushleft text
-
MasterWizz
- Posts: 6
- Joined: Wed Jan 27, 2021 1:11 am
Horizontal centering a flushleft text
Thank you!!
Edit:
Code: Select all
\begin{varwidth}{\textwidth}
\narrowragged
\lipsum[3]
\end{varwidth}