Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I'm using ConTeXt Mk IV, and I'd like the text in a two-page document to line up like so:

+--------+--------+
+        +        +
+ xxx    +    xx  +
+ xxxx   +   xxx  +
+ xx     +        +
+        +   xxx  +
+ xxx    +  xxxx  +
+ xx     +  xxxx  +
+        +        +
+--------+--------+

I tried

\setuppagenumbering[alternative=twosided]
\setupalign[flushouter]
\starttext
    page 1 (should align flush right)
    \page[yes]
    page 2 (should align flush left)
\stoptext

but that doesn't work. None of [flush]inner/outer/left/right does. This despite the fact that in setuphead[subject],

align=flushouter

does do the expected & desired thing.

Is there a magic word I've missed?

Cheers,

Sietse

share|improve this question
3  
also, can you provide a minimal working example? –  Mica Dec 1 '10 at 20:18
    
the command \setupalign works for the align environment, eg, \startalign ... \stopalign –  Mica Dec 1 '10 at 21:25
    
Since there have been no replies here, perhaps you should consider asking on the context mailing list. –  Aditya Dec 3 '10 at 18:05

2 Answers 2

According to the Context wiki, \setupalign recognises the following keywords:

width flushleft flushright middle inner outer wide broad height bottom line reset hanging nothanging hyphenated nothyphenated

So what you are trying to do does not seem to be supported. It might be easy to change this however, by extending the behaviour of \setupalign: following Aditya's advice to contact the Context mailing list would be a way to find out.

share|improve this answer
up vote 4 down vote accepted

This is a minimal example that works. Note that \setuppagenumbering[alternative=doublesided] is required -- it is the canonical way to tell ConTeXt we want doublesided typesetting. (\setuplayout[location=doublesided] is about the positioning of the page if the paper is larger than the page.)

\setuppagenumbering[alternative=doublesided]

\starttext
odd page \page[yes]
\startalignment[outer]
even page \page[yes]
odd page  \page[yes]
\stopalignment

\stoptext

The patching instructions below are no longer needed; this has been fixed in recent MkIV builds. (This remark added 2012-06-12.)


  • As the code is currently (d.d. 2012-02-20), \startalignment[outer] must be called on an even-numbered (i.e. left-hand) page. If it is called on page 1, or page 3, it does not work. Putting \setupalign[outer] in the preamble does not work, either. This will probably be patched in the upcoming beta, or the impatient can patch tex/texmf-context/tex/context/base/spac-ali.mkiv as follows:

    \def\spac_align_flush_horizontal
      {\ifcase\c_spac_align_state_horizontal
         % 0
         \spac_align_set_horizontal_none
       \or
         % 1 center
         % ----<some lines left out>----
       \or
         % 5 outer
         \ifdoublesided
           \signalouterrealign
         \fi
    %%%%%% Faulty line:
         %\rightorleftpageaction\c_spac_align_state_horizontal_left\spac_align_set_horizontal_right
    %%%%%% Replace with:
         \rightorleftpageaction\spac_align_set_horizontal_left\spac_align_set_horizontal_right
       \or
         % 6 oneliner
         \ifcase\c_spac_align_state_broad
           \spac_align_set_horizontal_right
         \else
           \spac_align_set_horizontal_very_right
         \fi
         \parfillskip\zeropoint
       \or
         % 7 centered last line
         \spac_align_set_horizontal_centered_last_line
       \fi}
    

After patching this core file, run context --make en (in any directory) to remake the formats. Now \setupalign[outer] and \startalign[outer] both work.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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