Replies: 15 comments
-
This is working as intended. If you have a box, then the space before it does not collapse. Special-casing empty boxes feels rather ad-hoc to me. Might I ask why you create an empty box in the first place? |
Beta Was this translation helpful? Give feedback.
-
In reality I create a box with an annotation that must not effect the real text flow. How else can I do this? If a line is broken the space always collapses. It should not matter if there is an empty box? |
Beta Was this translation helpful? Give feedback.
-
What kind of annotation? What's inside the box? |
Beta Was this translation helpful? Give feedback.
-
Just some superscripted text. But it doesn't matter, an empty box is enough to break the justification.
|
Beta Was this translation helpful? Give feedback.
-
It matters because I'm trying to understand your use case and why there is an empty box in the first place. I'm not convinced that special casing empty boxes would be consistent. What if the box is empty, but stroked? Does the space still collapse? |
Beta Was this translation helpful? Give feedback.
-
What is stroked? Btw: Why does the space collapse when I add a ")"?: |
Beta Was this translation helpful? Give feedback.
-
I mean something like this
The box is moved to the next line because there is no line break opportunity between it and the parenthesis. |
Beta Was this translation helpful? Give feedback.
-
No it's not visible, and even with --- correction: the space disappears when the box is wider than 0pt and it is broken to the next line. |
Beta Was this translation helpful? Give feedback.
-
Have you actually tested this? It is visible if you provide a height. But anyway, there seems to be no point in further discussion as your position seems settled. |
Beta Was this translation helpful? Give feedback.
-
Yes. Have you? |
Beta Was this translation helpful? Give feedback.
-
A zero-width box and all space before it is kept at the end of line, despite being invisible. This breaks justification. Is that what is intended? |
Beta Was this translation helpful? Give feedback.
-
Yes. Turns out that the rendering differs between PNG export (= web app) and PDF export... but this is already tracked in #2155.
The fact that it is invisible is, in my opinion, secondary. Spaces around boxes just don't collapse and carving out a special case for invisible or zero-width boxes will open up a can of worms. For instance, the next question is whether |
Beta Was this translation helpful? Give feedback.
-
The only special case would be the 0pt box to be handled as white space. Can I inhibit the line break after a Is there a better way to insert an annotation? Or anything else (side note etc.)? All of these will have the same problem when using |
Beta Was this translation helpful? Give feedback.
-
You can inhibit the linebreak with a non-breaking space ( As for better ways to insert an annotation: Depends on what exactly you're trying to achieve. You could trying removing the space before the box automatically with |
Beta Was this translation helpful? Give feedback.
-
I don't want to remove the space, I just want it to have no effect at all ... |
Beta Was this translation helpful? Give feedback.
-
Description
Either the space before the
box
appears at end of line or space (or newline) afterbox
appears at the next line. As it is, I have to remove all space before and after thebox
. But it doesn't create any output, so it shouldn't break the justification.Reproduction URL
No response
Operating system
Linux
Typst version
Beta Was this translation helpful? Give feedback.
All reactions