2

I want to create two-column paragraphs. The alignment of left and right columns should be flush right and flush left, respectively.

The following example displays the main texts in the correct alignment, but the section titles always appear flush left:

\defineparagraphs[paras][n=2, distance=0.08\textwidth]
\setupparagraphs[paras][1][width=0.46\textwidth, align=flushright]
\setupparagraphs[paras][2][width=0.46\textwidth, align=flushleft]

\setuphead[section][style=bold, number=no]

\starttext
\startparas

\startsection[title=Knuth]
\input knuth
\stopsection

\nextparas

\startsection[title=Tufte]
\input tufte
\stopsection

\stopparas
\stoptext

and the result: enter image description here

I want to set bold "Knuth" also flush right. I know I can achieve the desired result by creating a custom section using \definehead like so:

\definehead[sectionr][section]
\setuphead[sectionr][align=flushright]

and use \startsectionr ... \stopsectionr within the right column. However, I want to avoid using the custom header if possible. Is there a way to achieve the same result without using a custom header?

4

The paragraph mechanism is a simple table. If you are willing to use Natural Tables instead, then you can change the rendering of each column separately. For example:

\defineparagraphs[paras][n=2, distance=0.08\textwidth]
\setupparagraphs[paras][1][width=0.46\textwidth, align=flushright]
\setupparagraphs[paras][2][width=0.46\textwidth, align=flushleft]

\setuphead[section][style=bold, number=no]

\startsetups left
  \setuphead[section][align=flushright]
\stopsetups

\startsetups paragraphs
  \setupTABLE[frame=off]
  \setupTABLE[column][1,2][width=0.46\textwidth]
  \setupTABLE[column][1][roffset=0.04\textwidth, align=flushright, setups=left]
  \setupTABLE[column][2][loffset=0.04\textwidth, align=flushleft]
\stopsetups

\starttext
\startTABLE[setups=paragraphs]
  \NC 
      \startsection[title=Knuth]
        \input knuth
      \stopsection

  \NC

      \startsection[title=Tufte]
        \input tufte
      \stopsection

  \NC \NR
\stopTABLE
\stoptext

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.