Hello,
I made an experiment to add alternatives to sidebars (see attachment).
I discovered the sidebar is drawn by anch_sidebars_draw in metapost/context/base/mpiv/mp-apos.mpiv.
I've redefined it locally to add alternatives.
To make fancy, zig zag
bars I defined a macro, draw_pattern_bar, that draws a bar
repeating a pattern which is a path connecting (0,0) and
(1,0).
The macro has 3 parameters
(actually it has more params, but the remainder are anch_sidebars_draw params):
- a pattern, which is a
path from (0,0) to (1,0) that should have a vertical size = 1;
it's a sort of waveform
- a pattern length, by
which the pattern is xsized
- a pattern width, by which the pattern is ysized
Then the pattern is rotated along the bar direction (so -90 degrees) and drawn many times until it covers the bar length.
A proposal and a question:
- patternlength and
patternwidth could become \setupsidebar params; alternative
(=2,3,4...) could be used to specify the pattern (a sort of
waveform); currently alternative=0 is a solid bar and
alternative=1 is a dashed one
- in case of long patterns (a patternlength spanning more lines of text) the last replica of the pattern should be clipped not to exceed the last line of the sidebarred text (see the last example): how can that be done?
Massi