Repository navigation
Typesetting ragged-right? #1719
|
I'm typesetting a long book (a memoir), and I'd like the lines of the main text to be set ragged-right. I still want paragraph indents and hyphenation, as well as occasional centered lines (such as headings or figures) or right-justified lines (like author attributions/signatures). I've tried various combinations of using the Probably complicating the issue is that this is a complex document, with a custom (but not complicated) Is there an accepted way to do this? |
Replies: 4 comments 3 replies
|
The default "raggedright" environment (= "ragged" environment called with option "ragged=right") kills the paragraph indent Line 316 in 5344cb5 But what prevents you from implementing your own environment that would keep it, and tune other things at convenience, if need be? Simple proof of concept: Obviously, a full hfillglue is so strong it will push the text maximally, so you will seldom get hyphenated words (other than when they are hardly avoidable). One could consider other approaches, but it enters into the deep field of fine tuning several other settings .... so I won't dabble into that uncertain direction yet ;-) -- but just note the SILE manual explains all the relevant parameters (look, for instance, for |
|
If you have a book subclass the instantiator for that is probably the best place to set this up. Rather than wrapping your entire document in a class:_init()
book._init(self)
SILE.settings:set("document.rskip", SILE.nodefactory.hfillglue(), true)
endI would also take that chance to set other values. You might want to set the spaceskip to not be stretchy at all: Then again you might actually want a little bit of stretch. I've done some projects using hybrid justification that looks ragged right but actually has a little bit of stretch to the spaces to and hyphenation so the edge is much less ragged than if no line stretching was allowed. To do that you would change the rskip to something with a moderate chunk of stretchiness, say a |
|
Perfect! This is exactly what I was looking for. I just didn't understand what it was called, and where exactly to set it. |
|
Cheers! Thank you. |


If you have a book subclass the instantiator for that is probably the best place to set this up. Rather than wrapping your entire document in a
\raggedrightenvironment I would just copy the relevant settings from that command and put them in your document init and make them the defaults for the whole document:I would also take that chance to set other values. You might want to set the spaceskip to not be stretchy at all:
Then again you might actually want a little bit of stretch. I've done some projects us…