1

Here is my code, which makes some text left-aligned and others right-aligned, to the right of the left-aligned text:

    \starttabulate[|lw(.5\textwidth)|rw(.5\textwidth)|]
        \NR
        \NC Here is left-aligned text \NC Here is right-aligned text \NC\NR
        \NR
    \stoptabulate

When compiled, the right-aligned text is a cm or so too far to the right. I'm assuming that somehow the middle column has some extra space there, so that is why the text is too far.

How can I fix this so the right aligned text is right along the line of the edge of the page?

1 Answer 1

3

Sometimes it really helps reading the Wiki.

enter image description here

To remove the column spacing around cells, you can use the k operator. This is only documented in the ConTeXt Reference Manual as far as I can tell.

\showframe
\starttext

\starttabulate[|k0lw(.5\textwidth)|k0rw(.5\textwidth)|]
    \NC Here is left-aligned text \NC Here is right-aligned text \NC\NR
\stoptabulate

\stoptext

enter image description here

Alternatively, you can just subtract the column spacing from the width, although that becomes a bit unwieldy.

\showframe
\starttext

\starttabulate[%
    |%
    lw(\dimexpr.5\textwidth-.5\dimexpr\tabulationparameter{unit}\relax\relax)%
    |%
    rw(\dimexpr.5\textwidth-.5\dimexpr\tabulationparameter{unit}\relax\relax)%
    |%
]
    \NC Here is left-aligned text \NC Here is right-aligned text \NC\NR
\stoptabulate

\stoptext

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.