ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* [NTG-context] Luametatex: nesting alignments in display math formulas
@ 2024-11-10  1:36 ntg-contextmailingli.expedited080--- via ntg-context
  2024-11-10  8:20 ` [NTG-context] " Mikael Sundqvist
  0 siblings, 1 reply; 3+ messages in thread
From: ntg-contextmailingli.expedited080--- via ntg-context @ 2024-11-10  1:36 UTC (permalink / raw)
  To: mailing list for ConTeXt users; +Cc: ntg-contextmailingli.expedited080

I'm test driving luametatex. My needs usually extend to expressing formulas in TLA+ using nested display math formulas. Although I have suitable templates for doing this in Mark IV, I can't reproduce these satisfactorily in luametatex. For example, here's a formula from Leslie Lamport's 2006 "Lower Bounds for Asynchronous Consensus":

~~~~~~~~~~~ transitive_reduction.tex ~~~~~~~~~~~~~

\define\lbr {\lbrace \mkern 0.9mu}
\define\rbr {{}\mkern 0.9mu \rbrace}
\define\∀ {∀\mkern1mu}
\define\∃ {∃\mkern2mu}

\startdocument

\startplaceformula
\startformula [split=yes, align=flushleft, margin=standard, interlinespace=1ex]
\bgroup \setupinterlinespace [line=1ex]
\startalign [n=1, align={left,left}]

    \NC \text{\it TransitiveClosure}(R) ≜ 
    \NR

    \NC \quad
    \bgroup \setupinterlinespace [line=1ex]
    \startalign [n=2, align={left,left,left}, location=top]
    
        \NC \text{\sc let} \quad
        \NC \bgroup \setupinterlinespace [line=1ex]
        \startalign [n=1, align={left,left}, location=top]
        
            \NC \text{\it Dom} ≜ \lbr r[1]: r ∈ R \rbr
            \NR
        
            \NC \text{\it Rng} ≜ \lbr r[2]: r ∈ R \rbr
            \NR

            \NC \text{\it TC}[i ∈ ℕ] ≜ 
            \NR

            \NC \quad 
            \bgroup \setupinterlinespace [line=1ex]
            \startalign [n=1, align={left,left}, location=top]
            
                \NC \text{\sc if}\ i = 0\ 
                \bgroup \setupinterlinespace [line=1ex]
                \startalign [n=2, align={left,left,left}, location=top]
                
                    \NC \text{\sc then}\ 
                    \NC R
                    \NR
                
                    \NC \text{\sc else}\ 
                    \NC 
                    \bgroup \setupinterlinespace [line=1ex]
                    \startalign [n=1, align={left,left}, location=top]
                    
                        \NC \lbr
                            〈d, e 〉∈ \text{\it Dom} × \text{\it Rng}:
                        \NR
                    
                        \NC \quad \∃ c ∈ \text{\it Dom} ∩ \text{\it Rng}: 
                        \bgroup \setupinterlinespace [line=1ex]
                        \startalign [n=1, align={left,left}, location=top]
                        
                            \NC ∧ 〈d, c〉∈ \text{\it TC}[i-1]
                            \NR
                        
                            \NC ∧ 〈c, e〉∈ R \,\rbr
                            \NR
                        \stopalign \egroup
                        \NR
                    \stopalign \egroup
                    \NR
                \stopalign \egroup
                \NR
            \stopalign \egroup
            \NR
        \stopalign \egroup
        \NR
    
        \NC \text{\sc in}\ 
        \NC \text{\sc union}\ \lbr \text{\it TC}[i] : i ∈ ℕ \rbr
        \NR
    \stopalign \egroup
    \NR
\stopalign \egroup \stopformula \stopplaceformula

\stopdocument

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

The command

    $ context --luatex transitive_reduction.tex

produces the desired result, but 

    $ context transitive_reduction.tex

rejects the alignments and centers the lines instead. Can anyone suggest how I might adapt such nesting of alignments to luametatex?

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

maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki     : https://wiki.contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2024-11-10 15:35 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-11-10  1:36 [NTG-context] Luametatex: nesting alignments in display math formulas ntg-contextmailingli.expedited080--- via ntg-context
2024-11-10  8:20 ` [NTG-context] " Mikael Sundqvist
2024-11-10 15:24   ` ntg-contextmailingli.expedited080--- via ntg-context

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).