ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* alignment in cells without "alignmentcharacter"
@ 2005-11-13  0:48 Mojca Miklavec
  2005-11-13 14:16 ` Taco Hoekwater
  0 siblings, 1 reply; 9+ messages in thread
From: Mojca Miklavec @ 2005-11-13  0:48 UTC (permalink / raw)


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

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2005-11-14 19:39 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-11-13  0:48 alignment in cells without "alignmentcharacter" Mojca Miklavec
2005-11-13 14:16 ` Taco Hoekwater
2005-11-13 19:02   ` Peter Münster
2005-11-14  7:24     ` Taco Hoekwater
2005-11-14 16:28       ` Peter Münster
2005-11-14 18:19         ` Taco Hoekwater
2005-11-14 18:45   ` Mojca Miklavec
2005-11-14 18:55     ` Mojca Miklavec
2005-11-14 19:39     ` Peter Münster

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).