Folks,
The pad operator works fine if you want to pad numbers and you could add leading or trailing zeros, even spaces however in more string based uses it fails.
Consider this in a list with the counter item and total count of items
\function items-size() [<items>length[]]
\function item-size() [<item>length[]]
\function item-pad() [<items-size>add[1]subtract<item-size>]
\function item-padded() [<item>pad:prefix<item-pad>]
<$let items={{{ [tag[TableOfContents]count[]] }}}>
;items=<<items>>, items-size=<<items-size>>, item-pad=<<item-pad>>
<$list filter="[tag[TableOfContents]]" counter=item>
<<item-padded>> <$link/> item-size=<<item-size>>, <br>
</$list>
</$let>
This prefixes each item with a zero padding.
Now change item-padded to;
\function item-padded() [<item>addsuffix[.]pad:suffix<item-pad>,[ ]]
- Idealy this would result in the following;
1. Home
...
9. Reference
10. Title
- That is add 2 spaces for units, zero for tens.
But it does not!