How to allow line breaks after forward slashes in ConTeXt?
1,306
The command \setbreakpoints
is made for that. Setting \setbreakpoints [compound]
enables a break point after /
, +
, (
, )
and -
. For more information see ConTeXt wiki Composed words.
Example:
\setuplayout [width=4cm]
\starttext
Lorem/ipsum/dolor/sit/amet,/consectetur/adipisicing/elit,/sed/%
do/eiusmod/tempor/incididunt/ut/labore/et/dolore/magna/aliqua.
\setbreakpoints [compound]
\blank
Lorem/ipsum/dolor/sit/amet,/consectetur/adipisicing/elit,/sed/%
do/eiusmod/tempor/incididunt/ut/labore/et/dolore/magna/aliqua.
\stoptext
Author by
Village
Updated on August 01, 2022Comments
-
Village over 1 year
I have a document containing many forward slashes (
/
). I noticed that ConTeXt does not allow breaks after/
. For instance, if a text containsbear/rabbit/tiger
, it will not place a break and the text will flow off the edge into the margins.- How can I create a special environment, inside of which, the rules for line breaking allows a line break after a
/
, if deemed necessary, with slightly higher or equal preference to what is given to a space?
- How can I create a special environment, inside of which, the rules for line breaking allows a line break after a
-
Village over 11 yearsIf I want some block of text to behave in this way, but the rest of the document not to, how do I ensure only that part has this kind of line breaks?
-
Aditya over 11 yearsSet
\setbreakpoints[compound]
in a group (between{...}
or\bgroup ... \egroup
or\begingroup ... \endgroup
. If this is part of an environment, you should be able to use thesetups
key.