Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Style /pgf/decoration/text effects/word ⟨m⟩ letter ⟨n⟩ documented but never called #1294

Open
mgkurtz opened this issue Nov 26, 2023 · 0 comments

Comments

@mgkurtz
Copy link

mgkurtz commented Nov 26, 2023

Brief outline of the bug

The style word ⟨m⟩ letter ⟨n⟩ (e.g. word 1 letter 1) is never actually used (and thus has no effect) although it is documented on page 659 of the 3.1.10 manual. Additionally the style documented as letter ⟨n⟩ is actually called every ⟨n⟩ letter. For my own use case, I could use the character ⟨n⟩ style. So, I have no strong opinion on whether to change the code to reflect the docs or vice versa.

The piece of code calling all the styles is

\edef\tikz@lib@dec@te@tmp{character \tikz@lib@dec@te@charactercount/.try,%
character {\meaning\tikz@lib@dec@te@character}/.try}%
\expandafter\tikz@lib@dec@te@addoptions\expandafter{\tikz@lib@dec@te@tmp}%
\ifx\tikz@lib@dec@te@character\tikz@lib@dec@te@wordsep%
\tikz@lib@dec@te@addoptions{/pgf/decoration/text effects/every word separator/.try}%
\else%
\ifnum\tikz@lib@dec@te@wordcount>0\relax%
\edef\tikz@lib@dec@te@tmp{every word/.try, word \tikz@lib@dec@te@wordcount/.try}%
\expandafter\tikz@lib@dec@te@addoptions\expandafter{\tikz@lib@dec@te@tmp}%
\ifnum\tikz@lib@dec@te@lettercount>0\relax%
\edef\tikz@lib@dec@te@tmp{every letter/.try,every \tikz@lib@dec@te@lettercount\space letter/.try}%
\expandafter\tikz@lib@dec@te@addoptions\expandafter{\tikz@lib@dec@te@tmp}%
\ifnum\tikz@lib@dec@te@lettercount=1\relax%
\edef\tikz@lib@dec@te@tmp{every first letter/.try}%
\expandafter\tikz@lib@dec@te@addoptions\expandafter{\tikz@lib@dec@te@tmp}%
\fi%
\iftikz@lib@dec@te@finalletter%
\tikz@lib@dec@te@addoptions{every final letter/.try}%
\fi%
\fi%
\fi%
\fi%

It seems simple enough to change it, if wanted.

Minimal working example (MWE)

\documentclass{minimal}
\usepackage{tikz}
\usetikzlibrary {decorations.text}
\begin{document}
\begin{tikzpicture}[decoration={text effects along path,
	text={11 2023},
	text effects/.cd,
		path from text,
		word 2 letter 4/.style={documented but not called},
		letter 1/.style={documented but not called, instead we have},
		every 1 letter/.style={color=blue},
		characters={text along path}}]
\path [decorate] (0,0);
\end{tikzpicture}
\end{document}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant