Hello,

(A question for a coffee break for Hans or Taco while updating macros
for tables, although it may already be implemented somewhere.)

I have a table with one column for room names with an optional slash
(see below). The case is equivalent to aligning floating-point &
natural numbers (without comma) in the same column.

I aligned the entries with alignmentcharacter=/, which works perfect
except in the cases where there's no slash present (the real example
did an even worse, extremely strange alignment, where those numbers
were sticking out of the cells, but I'll investigate that a bit & post
an example another time).

% plain text aligned in the same way as I would like it to have in the result
\setupTABLE[c][1][aligncharacter=yes,alignmentcharacter=/,width=3cm,align=middle]
\bTABLE
\bTR\bTD  01/1  \eTD\eTR
\bTR\bTD  02/13 \eTD\eTR
\bTR\bTD  03    \eTD\eTR
\bTR\bTD 314/2  \eTD\eTR
\bTR\bTD 315    \eTD\eTR
\eTABLE

Is there an elegant way which would align those numbers as if they had
an additional slash on the right? I was thinking about placing a
transparent slash behind those number, but there may be a a cleaner &
more elegant solution for it. If not, it could be done approximately
in the spirit of

alignifnoalignmentcharacterpresent=
   absoluteflushleft / % according to the cell
   absoluteflushright / % according to the cell
   middle /
   relativeflushleft / % according to the aligned content
   % since remaining numbers may be aligned to the right or to the middle,
   % this would align just as left as the leftmost number with
alignment character
   relativeflushright /
   leftofthealignmentcharacter / % I only need this one
   rightofthealignmentcharacter
   .

Alternatively I could define something completely invisible like
\alignmehere and then use:

\setupTABLE[c][1]
   [aligncharacter=yes,
    alignmentcharacter={\alignmehere},
    width=3cm,align=middle]
\bTABLE
\bTR\bTD  01\alignmehere/1  \eTD\eTR
\bTR\bTD  02\alignmehere/13 \eTD\eTR
\bTR\bTD  03\alignmehere    \eTD\eTR
\bTR\bTD 314\alignmehere/2  \eTD\eTR
\bTR\bTD 315\alignmehere    \eTD\eTR
\eTABLE

but I don't know what the definition of "\alignmehere" could be so
that it would work OK. (Useful for complex alignments; for aligning
nubers the first solution would be cleaner and better.)

Thanks for any suggestions,
    Mojca
_______________________________________________
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context

Reply via email to