Exiled Headers Within Justified Text

I am creating a pdf file with Latex via pdflatex and want to have headings with dangling text, while the rest of the document should use justified text.

This gives me an error (! LaTeX Error: Something wrong--perhaps a missing \item):

\usepackage{ragged2e}

..

\flushleft
\chapter{Something}
\justifying

And this will ruin the vertical spacing:

{\raggedright{\chapter{Something}}}

Any idea here? Thanks in advance!

+3
source share
4 answers

Use the sectsty package and use \chapterfont{\raggedright}to keep all section headers justified. See the sect 's guide on how to do more interesting things. If the sect is not powerful enough, you can use titlesec . In addition, you can override partitioning commands.

+4

\chapter, \section .. , .

, , , , .

CTAN (memoir, ), , .

+1

, ragged2e \RaggedRight LaTeX default\raggedright. , ; , .

Anyway, go to @sgm answer using titlesec. (It is as easy to use as a sect, and more powerful ... sectsty is only good for very simple overrides, such as changing the font.)

0
source

About three years ago, tired of the assortment of packages shooting at each other's legs, and each of which needed to be configured in its own way, I switched everything to memoir .

I never looked back.

0
source

Source: https://habr.com/ru/post/1703511/


All Articles