@EarnestAl’s suggestion is a good starting point but, from my point of view, it has the serious inconvenience that it disrupts the main text flow because it uses frames. Text inside frames no longer bears any ordering relationship with the main flow argumentation. This has serious consequences if you want to number your warnings. Consequently, you must avoid frames, at least for the caveat text.
I have reworked a bit EarnestAl’s sample as Warning79721-ajl.odt (26.4 KB).
I use a “standard” paragraph for the literate warning. It is styled Labelled Text (derived from Text Body):
- border enabled with some padding (0.3cm here) to make sure there will be no overlap by “decoration”
- spacing above paragraph increased a bit (0.2cm) to make room for the protrusion of the “label”
A “label” is superimposed over the border. This label will be WARNING, IMPORTANT, CAVEAT or whatever. Since this label must be positioned in an “unusual” location (i.e. outside the standard text flow), it will be contained in a frame. I therefore define a frame style Label:
- anchored To paragraph, autosized (+)
- position Left to Paragraph text area (but you may adapt to shift the label), Top to Margin so that the frame is already vertically centered on the paragraph border
- wrap mode is Through and Allow overlap ticked so that the frame doesn’t interfere with warning text
Since overlap is allowed, the frame interferes with nothing. So it is important to increase paragraph spacing above so that the label does not overlap the preceding paragraph.
- spacing (in
Wrap
tab) will have no effect, except left spacing allows to shift the label
This may prove more convenient than tuning position parameter in the Type
tab.
- no borders
I also defined a paragraph style Frame Label (derived from Frame Contents) for the “label”:
- specific font face, size and weight
- no border but left and right padding set to 0.3cm to “erase” the paragraph border and space a bit the “label”
Although there is no border, padding is still taken into account. This is a handy trick to create space around a paragraph in circumstances where indents or vertical spacing don’t make sense. But here, indents could have been used.
To summarize, I have created:
- one paragraph style for the warning text Labelled Text
- one paragraph for the label Frame Label
- one frame style for the label Label
Since this is a complex group, follow EarnestAl’s advice and create an autotext for the global structure
Notes:
- (+) I met difficulties with Autosize in the frame. You may have to adjust manually the minimum size in the style to avoid line wrap.
- Frame styles have weird update behaviour. When you change them, the selected frame doesn’t update immediately. Assign another style to the frame and reassign the modified style. Update occurs.
- If you want to number your warnings (numbered list), don’t number the “label”: it is in a frame. There is no guarantee that frames will be numbered in text order. Instead, number the text itself.
EDIT 2022-07-24
I found the idea so appealing that I worked it out to make it usable. I incorporated it into one of my templates. Here is an example of the result as it prints:
The same with visual hints and formatting marks to show the “economy” in frames.
Since the construct is complex and errors may easily lurk in if the group is manually added, I created AutoText entries to insert skeleton Caution, Note and Tip groups. When an autotext is activated, all is left is to type the content of the bordered paragraph. Eventually, you double-click on CAUTION to overwrite it with CAVEAT. Everything is already styled as needed.