ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Jan Willem Flamma <jwfregister@icloud.com>
To: mailing list for ConTeXt users <ntg-context@ntg.nl>
Subject: Re: align text and formula
Date: Thu, 09 Feb 2017 14:05:55 +0100	[thread overview]
Message-ID: <1A65E0E4-2843-4DD8-86B4-D9F079FADFD3@icloud.com> (raw)
In-Reply-To: <5D08B528-27E3-4732-B710-6872DBBE62B3@icloud.com>

Dear list members,

The below solution stopped working in the latest bet (2017.01.27 14:39 MKIV beta)
It is still workig fine using the wiki ConTeXt online.

Has anything changed using this align feature?

Kind regards,
Jan Willem Flamma


> 
> 
>> On 25 aug. 2016, at 13:52, Henri Menke <henrimenke@gmail.com> wrote:
>> 
>> Hi Jan,
>> 
>> if I understood you correctly, this should produce what you are after.
>> 
>> \starttext
>> 
>> \startformula
>> E = mc^2
>> \stopformula
>> 
>> \startformula
>> \startalign[m=3,align={middle},distance=0pt plus 1 fil]
>>   \NC \rlap{\text{Text1}}   \NC\NC E=mc^2 \NR
>>   \NC \rlap{\text{This is an explanation}}   \NC\NC E=mc^2 \NR
>>   \NC \rlap{\text{This is a very very very long explanation}}   \NC\NC E=mc^2 \NR
>> \stopalign
>> \stopformula
>> 
>> \stoptext
>> 
>> The inner workings of this solution are quite messy.  You *have* to have the \NC\NC between text and formula and the formula must not contain any further alignment points; text has to be enclosed in \rlap.  As you can see it centers the formula unconditionally and just flows into the text if it doesn't fit.  Just don't do it like this.
>> 
>> Cheers, Henri
>> 
>> On 08/24/2016 05:38 PM, Jan Willem Flamma wrote:
>>> Hi Otared,
>>> 
>>> I apologize for not explaining it better.
>>> 
>>> Maybe the below example will illustrate better what I’m trying to achieve. 
>>> - The first formula is perfectly aligned.
>>> - The bottom three formulas do not line up with the top formula
>>> 
>>> I’m trying to align all formulas regardless of the amount of text added to the left of the formula. 
>>> Of course I could add \qquad or \quad to try and manually align but basically I’m interested to know if a fool proof method exist that aligns all without using \\qquad or \quad
>>> 
>>> \starttext
>>> 
>>> % Mid-aligned formula
>>> \startformula
>>> E = mc^2
>>> \stopformula
>>> 
>>> \setupformulas[align=flushleft]
>>> \startformula
>>>       \startalign[n=3,align={left,middle}]
>>>     	\NC \text{Text1}						\NC \qquad	\NC E = mc^2	\NR
>>>     	\NC \text{This is an explanation}		\NC	\qquad	\NC  E = mc^2	\NR
>>>     	\NC \text{This is a longer explanation}	\NC	\qquad	\NC E = mc^2    \NR
>>>       \stopalign
>>> \stopformula
>>> 
>>> \stoptext
>>> 

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

      parent reply	other threads:[~2017-02-09 13:05 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-24  8:02 Jan Willem Flamma
2016-08-24  8:10 ` Otared Kavian
2016-08-24  8:19   ` Jan Willem Flamma
2016-08-24  8:21   ` Jan Willem Flamma
2016-08-24 14:53     ` Otared Kavian
2016-08-24 15:38     ` Jan Willem Flamma
2016-08-25 11:52       ` Henri Menke
2016-08-25 13:12         ` Jan Willem Flamma
2016-08-25 13:31           ` Henri Menke
2016-08-25 14:07             ` Wolfgang Schuster
2016-08-27 12:51               ` Hans Hagen
2017-02-09 13:05           ` Jan Willem Flamma [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1A65E0E4-2843-4DD8-86B4-D9F079FADFD3@icloud.com \
    --to=jwfregister@icloud.com \
    --cc=ntg-context@ntg.nl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).