pgf-tikz / pgf

A Portable Graphic Format for TeX
https://pgf-tikz.github.io/
1.11k stars 106 forks source link

Default for text format delimiters incorrect #1260

Closed aendie closed 1 year ago

aendie commented 1 year ago

Version

3.1.10

Details

I detect what appears to be a documentation error in versions 3.1.3 (page 648), 3.1.9a (page 657), 3.1.10 (page 656).

The definition reads as follows: tikz_decorations

However I believe the default is: (no default, initially {|}{|}) ... as there has to be an after delimiter (and it is initially a vertical bar). Even in the example below both delimiters ('before' and 'after') are employed: tikz_decorations2

Funny that no one has noticed this since version 3.1.3 but my thanks to all who have contributed to an absolutely marvelous package that enables me to create beautiful charts and diagrams. (I am competing for fun with the US Naval Observatory Astronomical Applications Department and the HM Nautical Almanac Office in the UK ... with outside help, of course. :-)

muzimuzhi commented 1 year ago

From source code, /pgf/decoration/text format delimiters is initially {|}{}. https://github.com/pgf-tikz/pgf/blob/9cc2617304cf3c6e7a1f5b21fc049f404f23d3e7/tex/generic/pgf/libraries/decorations/pgflibrarydecorations.text.code.tex#L19 https://github.com/pgf-tikz/pgf/blob/9cc2617304cf3c6e7a1f5b21fc049f404f23d3e7/tex/generic/pgf/libraries/decorations/pgflibrarydecorations.text.code.tex#L170

Actually it's documented that

If <after> is empty, then <before> will be used for both delimiters.

see doc for /pgf/decoration/text format delimiters (tikz.dev link) and related source lines 161--163 below. https://github.com/pgf-tikz/pgf/blob/9cc2617304cf3c6e7a1f5b21fc049f404f23d3e7/tex/generic/pgf/libraries/decorations/pgflibrarydecorations.text.code.tex#L158-L170