diff options
Diffstat (limited to 'tex/context/base/typo-tal.mkiv')
-rw-r--r-- | tex/context/base/typo-tal.mkiv | 61 |
1 files changed, 39 insertions, 22 deletions
diff --git a/tex/context/base/typo-tal.mkiv b/tex/context/base/typo-tal.mkiv index 7de10a6ec..570f1a1f5 100644 --- a/tex/context/base/typo-tal.mkiv +++ b/tex/context/base/typo-tal.mkiv @@ -40,25 +40,26 @@ %D %D \typebuffer \blank \getbuffer \blank -%D \startbuffer -%D \bTABLE -%D \bTR \bTD[aligncharacter=yes] € 1,1 \eTD \eTR -%D \bTR \bTD[aligncharacter=yes] € 11,11 \eTD \eTR -%D \bTR \bTD[aligncharacter=yes] € 12\punctuationspace111,11 \eTD \eTR -%D \bTR \bTD[aligncharacter=yes] € 12 111,11 \eTD \eTR -%D \bTR \bTD[aligncharacter=yes] € 1.234.451,22222 \eTD \eTR -%D \bTR \bTD[aligncharacter=yes] € 234.451,2 \eTD \eTR -%D \bTR \bTD[aligncharacter=yes] € 234.451 \eTD \eTR -%D \bTR \bTD[aligncharacter=yes] € 451 \eTD \eTR -%D \bTR \bTD \bf some text \eTD \eTR -%D \eTABLE -%D \stopbuffer -%D -%D \typebuffer \blank \getbuffer \blank - -\unexpanded\def\signalcharacteralign#1#2{\attribute\characteralignattribute=\numexpr#1*\plushundred+#2\relax} -\unexpanded\def\setcharacteralign #1#2{\ctxcommand{setcharacteralign(\number#1,"#2")}} -\unexpanded\def\resetcharacteralign {\ctxcommand{resetcharacteralign()}} +% D \startbuffer +% D \bTABLE +% D \bTR \bTD[aligncharacter=yes] € 1,1 \eTD \eTR +% D \bTR \bTD[aligncharacter=yes] € 11,11 \eTD \eTR +% D \bTR \bTD[aligncharacter=yes] € 12\punctuationspace111,11 \eTD \eTR +% D \bTR \bTD[aligncharacter=yes] € 12 111,11 \eTD \eTR +% D \bTR \bTD[aligncharacter=yes] € 1.234.451,22222 \eTD \eTR +% D \bTR \bTD[aligncharacter=yes] € 234.451,2 \eTD \eTR +% D \bTR \bTD[aligncharacter=yes] € 234.451 \eTD \eTR +% D \bTR \bTD[aligncharacter=yes] € 451 \eTD \eTR +% D \bTR \bTD \bf some text \eTD \eTR +% D \eTABLE +% D \stopbuffer +% D +% D \typebuffer \blank \getbuffer \blank + +\unexpanded\def\signalcharacteralign#1#2{\attribute\characteralignattribute\numexpr#1*\maxcardminusone+#2\relax} % 0xFFFF +\unexpanded\def\setcharacteralign #1#2{\clf_setcharacteralign#1{#2}} +\unexpanded\def\resetcharacteralign {\clf_resetcharacteralign} +\unexpanded\def\nocharacteralign {\attribute\characteralignattribute\attributeunsetvalue} %D Mostly downward compatible: %D @@ -73,6 +74,15 @@ %D %D \typebuffer \blank \getbuffer \blank +%D We have (currently) two modes: \type {text} and \type {number}. The handler tries +%D to determine the mode automatically. When using periods and commas as separators +%D the \type {number} mode is chosen. If you use for instance a \type {-} as +%D separator, \type {text} is chosen, but you can enforce \type {number} with \type +%D {number->-} (as with other mechanisms, the arrow indicates a methot to apply). +%D +%D One can use \type {\nocharacteralign} to disable this mechanism, for instance in +%D a table cell. + \def\alignmentcharacter{,} \unexpanded\def\typo_charalign_pass_one @@ -86,19 +96,26 @@ \def\typo_charalign_pass {\hbox\bgroup\signalcharacteralign\plusone\scratchcounter\let\next} -\unexpanded\def\startcharacteralign#1\stopcharacteralign +\unexpanded\def\startcharacteralign + {\dosingleempty\typo_charalign_start} + +\def\typo_charalign_start[#1]#2\stopcharacteralign {\bgroup + \edef\m_temp{#1}% + \ifx\m_temp\empty \else + \let\alignmentcharacter\m_temp + \fi \setcharacteralign\plusone\alignmentcharacter \begingroup \scratchcounter\zerocount \let\checkcharacteralign\typo_charalign_pass_one \settrialtypesetting - #1\relax + #2\relax \endgroup \begingroup \scratchcounter\zerocount \let\checkcharacteralign\typo_charalign_pass_two - #1\relax + #2\relax \endgroup \resetcharacteralign \egroup} |