1

How can I get short lines flushed left and longer lines (which have to be broken in two or more) justified and flushed right in lines environment by using only environment setup options in ConTeXt?

Here is an example:

\mainlanguage[pl]
\setupalign[nothyphenated]
\starttext
\startlines[align=flushright]
  Arch. Fil. MLAM – Archiwum Filomatów w Muzeum Literatury im. Adama Mickiewicza w Warszawie
  Arch. Montalembert – Archives Montalembert, zamek La Roche en Brenil
\stoplines
\stoptext

which results in this output The first line "Arch. Fil. MLAM…" has to be broken in two, the resulting upper line should be justified but is flushed right and the lower line is flushed right as well, which is what I want. The second line "Arch. Montalembert…" is not long enough to be broken and in that case I would like to have it flushed left. How could that be obtained without setting alignment on each line?

What I would like it to look like can be obtained with

\mainlanguage[pl]
\setupalign[nothyphenated]
\starttext
\startlines[align=flushright]
  \inframed[width=\textwidth, align=no, frame=off]{Arch. \hfill Fil. \hfill  MLAM \hfill – \hfill Archiwum \hfill Filomatów \hfill w \hfill  Muzeum \hfill Literatury \hfill im. \hfill Adama}
  \rightaligned{Mickiewicza w Warszawie}
  \leftaligned{Arch. Montalembert – Archives Montalembert, zamek La Roche en Brenil}
\stoplines
\stoptext

and looks like this enter image description here

  • Hi, John. This is not LaTeX, this is ConTeXt question and the example is in the first code sample. – helcim Nov 2 '18 at 18:25
  • What you are trying to do looks pretty much line like traditional verse breaking (at least in French). I would rather try without flushright option. Btw, since you are explaining abbrevs, wouldn't a description environment fit more your needs ? – sztruks Nov 2 '18 at 19:21
  • As a work around, you can use gmverse in lualatex. Maybe some ConTeXt guru could port its internal to ConTeXt. Its author told me it was playing with catcodes, so looks like TeX internals code. – sztruks Nov 3 '18 at 9:08
  • 3
    In principle, align=end is supposed to achieve this result, but in my tests, it does not work. So, I suggest that you write the the context mailing list. – Aditya Nov 3 '18 at 9:49
  • 1
    @Aditya I guess align=end simply sets \parfillskip=0pt to make the last line stretch all the way to the right boundary. – Henri Menke Nov 9 '18 at 5:46

Your Answer

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

Browse other questions tagged or ask your own question.