cetz icon indicating copy to clipboard operation
cetz copied to clipboard

Mark Improvements List

Open fenjalien opened this issue 2 years ago • 3 comments

Here are my suggestions of features/improvements to make for parity with tikz (from #314). Some of them we already have (not sure exactly which), some are implemented natively by typst.

Styling:

  • [x] length
    • [ ] line width factor
    • [ ] outer factor
  • [x] width
    • [ ] line width factor
    • [ ] outer factor
  • [ ] width'
  • [x] inset
    • [ ] line width

Configuration options

  • [ ] line width factor and outer factor options for length/width/inset/angle options (https://tikz.dev/tikz-arrows#pgf./pgf/arrow:keys/length)

  • [ ] note that length of an arrow is calculated assuming it has a miter line cap even if the cap is different (see https://tikz.dev/tikz-arrows#pgf./pgf/arrow:keys/length "The Exact Length")

  • [x] angle (https://tikz.dev/tikz-arrows#pgf./pgf/arrow:keys/angle)

  • [ ] length factor and line width factor options for width/inset (https://tikz.dev/tikz-arrows#pgf./pgf/arrow:keys/width')

  • [x] scale length/width (https://tikz.dev/tikz-arrows#pgf./pgf/arrow:keys/scale:length)

  • [ ] arc (https://tikz.dev/tikz-arrows#pgf./pgf/arrow:keys/arc)

  • [x] slant (https://tikz.dev/tikz-arrows#pgf./pgf/arrow:keys/slant)

  • [x] Reversing tips https://tikz.dev/tikz-arrows#pgf./pgf/arrow:keys/reversed

  • [x] Halving tips (https://tikz.dev/tikz-arrows#pgf./pgf/arrow:keys/harpoon) (including which side to half)

  • [x] bending and flexing (https://tikz.dev/tikz-arrows#sec-16.3.8) (haven't properly checked this but i think we have everything)

  • [x] #347

  • Note that coloring and line styling is skipped as they are handled by fill and stroke options

tip specifications

  • [ ] line width factor and outer factor for separations (https://tikz.dev/tikz-arrows#pgf./pgf/arrow:keys/sep)
  • [ ] Specifying line end (https://tikz.dev/tikz-arrows#sec-16.4.3)

Arrow tips (https://tikz.dev/tikz-arrows#sec-16.5)

  • [ ] Barbed
    • [ ] Arc Barb
    • [x] Bar
    • [x] Bracket
    • [x] Hooks
    • [ ] Parenthesis
    • [x] Straight Barb
    • [ ] Tee Barb
  • [ ] Mathematical
    • [ ] Classical Tikz Rightarrow
    • [ ] Computer Modern Rightarrow
    • [ ] Implies
  • [ ] Geometric (includes "open" variants)
    • [x] Circle
    • [x] Diamond
    • [x] Ellipse
    • [ ] Kite
    • [ ] Latex
    • [x] Rectangle
    • [ ] Square
    • [x] Stealth
    • [x] Triangle
    • [x] Turned Square
  • [ ] Cap
    • [ ] Butt Cap
    • [ ] Fast Round
    • [ ] Fast Triangle
    • [ ] Round Cap
    • [ ] Triangle Cap
  • [ ] Special
    • [x] Rays

implemenation

  • [x] Add general function that can add marks to path drawables

fenjalien avatar Nov 12 '23 17:11 fenjalien

I would also like to allow passing functions (of a specified format) instead of arrow-names that then get used for drawing.

johannes-wolf avatar Nov 12 '23 17:11 johannes-wolf

I suggest moving parts of this post 0.2.0. We already got lots of improvements on marks and I would rather try to get out a release soon, so we get a little testing and feedback for 0.2.0.

I also think TikZ does a little too much here…, e.g. allowing to specify an angle when you already can specify width/length for marks is just a shortcut for the width/length calculation + all the different mark styles.

johannes-wolf avatar Nov 12 '23 18:11 johannes-wolf

I guess we can mark some more of these features as implemented. Rays got implemented, but one can not specify the number of lines. Instead, three preconfigured styles "+", "*" and "x" are available for 4 and 5 corner rays.

johannes-wolf avatar Jan 14 '24 19:01 johannes-wolf