Re: [NTG-context] Equivalent of alignat of amsmath with context
Hi Wolfgang and OK, > What is the result you get with LaTeX? > > > > Is this what you are looking for? > This is the expected result, thank you. Fabrice Le sam. 5 janv. 2019 à 16:45, Otared Kavian a écrit : > Hi Fabrice, > > I think you have to use > \startalign[n=3,align={left,right}] > and finish the alignment with > \stopalign > > Is this what you are looking for? > > \starttext > \startformula > \startalign[n=3,align={left,right}] >\NC \qquad > \NC\frac{\lvert\overline{AD}\rvert}{\lvert\overline{CD}\rvert} \NC > =\frac{\lvert\overline{DC}\rvert}{\lvert\overline{CE'}\rvert}\NR >\NC \iff \NC \frac{1}{x} \NC =\frac{x}{1-x} \NR >\NC \iff \NC 1-x \NC =x^2 \NR >\NC \iff \NC 0\NC =x^2+x-1 \NR > \stopalign > \stopformula > \stoptext > > Best regards: OK > > > On 5 Jan 2019, at 12:27, Fabrice Couvreur > wrote: > > > > Hi, > > I'm trying to get the same result for this file compiled with latex. > > Thanks. > > Fabrice > > > > \documentclass{article} > > \usepackage{amsmath} > > > > > > > > \begin{document} > > > > > > > > \begin{alignat*}{2} > > &\qquad& > > > > > > \frac{\lvert\overline{AD}\rvert}{\lvert\overline{CD}\rvert} > > > > > > &=\frac{\lvert\overline{DC}\rvert}{\lvert\overline{CE'}\rvert}\\ > > \iff&& \frac{1}{x}&=\frac{x}{1-x}\\ > > \iff&& 1-x&=x^2\\ > > \iff&& 0&= > > x^2+x-1 > > > > \end{alignat*} > > > > > > > > \end{document} > > > > \starttext > > \startformula > > \startmathalignment[n=3] > >\NC \qquad > \NC\frac{\lvert\overline{AD}\rvert}{\lvert\overline{CD}\rvert} \NC > =\frac{\lvert\overline{DC}\rvert}{\lvert\overline{CE'}\rvert}\NR > >\NC \iff \NC \frac{1}{x} \NC =\frac{x}{1-x} \NR > >\NC \iff \NC 1-x \NC =x² \NR > >\NC \iff \NC 0\NC =x²+x-1 \NR > > \stopmathalignment > > \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 > > > ___ > > > ___ > 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 > > ___ ___ 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 ___
Re: [NTG-context] Equivalent of alignat of amsmath with context
Hi Fabrice, I think you have to use \startalign[n=3,align={left,right}] and finish the alignment with \stopalign Is this what you are looking for? \starttext \startformula \startalign[n=3,align={left,right}] \NC \qquad \NC\frac{\lvert\overline{AD}\rvert}{\lvert\overline{CD}\rvert} \NC =\frac{\lvert\overline{DC}\rvert}{\lvert\overline{CE'}\rvert}\NR \NC \iff \NC \frac{1}{x} \NC =\frac{x}{1-x} \NR \NC \iff \NC 1-x \NC =x^2 \NR \NC \iff \NC 0\NC =x^2+x-1 \NR \stopalign \stopformula \stoptext Best regards: OK > On 5 Jan 2019, at 12:27, Fabrice Couvreur wrote: > > Hi, > I'm trying to get the same result for this file compiled with latex. > Thanks. > Fabrice > > \documentclass{article} > \usepackage{amsmath} > > > > \begin{document} > > > > \begin{alignat*}{2} > &\qquad& > > > \frac{\lvert\overline{AD}\rvert}{\lvert\overline{CD}\rvert} > > > &=\frac{\lvert\overline{DC}\rvert}{\lvert\overline{CE'}\rvert}\\ > \iff&& \frac{1}{x}&=\frac{x}{1-x}\\ > \iff&& 1-x&=x^2\\ > \iff&& 0&= > x^2+x-1 > > \end{alignat*} > > > > \end{document} > > \starttext > \startformula > \startmathalignment[n=3] >\NC \qquad \NC\frac{\lvert\overline{AD}\rvert}{\lvert\overline{CD}\rvert} > \NC =\frac{\lvert\overline{DC}\rvert}{\lvert\overline{CE'}\rvert}\NR >\NC \iff \NC \frac{1}{x} \NC =\frac{x}{1-x} \NR >\NC \iff \NC 1-x \NC =x² \NR >\NC \iff \NC 0\NC =x²+x-1 \NR > \stopmathalignment > \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 > ___ ___ 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 ___
[NTG-context] placing an MPGraphic/Lines over multiple table cells
I am trying to place some lines in "Z" shape over several cells of a table. This single "Z" has the intention of blocking manual alterations to the table in empty cells. The cells to blocked are always a coherent rectangle. I hope that makes sense. In the example below, the table with 4 rows, 3 columns has content in column one only, the other 2 columns should have the "Z". Placing the blocking "Z" into every cell is not an option due to formal requirements. What I attempted below a) seems very cumbersome b) doesn't work (the small "Z" doesn't fill the frame). While I can easily place a "Z" into a single cell (in the example), I can't figure out how to cover multiple cells. Furthermore, I would need to do a lot of calculations to figure out the multiple layer placements, column positions, etc. With multiple tables on a page, several pages, that seems error prone. Any suggestions, corrections, hints are most welcome! Kindly, Martin Working example with some comments: % Graphic that draws the "Z", that works fine in a single table cell as seen in the example \startuseMPgraphic{ZRule} rulethickness:= \frameddimension{rulethickness}*3; drawoptions( withpen pencircle scaled rulethickness withcolor \MPcolor{\framedparameter{framecolor}}); pair topleftcorner, toprightcorner; topleftcorner := (rulethickness, \overlayheight-rulethickness-1.5mm); toprightcorner:= (\overlaywidth-rulethickness, \overlayheight-rulethickness-1.5mm); pair lowerleftcorner, lowerrightcorner; lowerleftcorner := (rulethickness, rulethickness+1.5mm); lowerrightcorner:= (\overlaywidth-rulethickness, rulethickness+1.5mm); draw topleftcorner -- toprightcorner; draw lowerleftcorner -- lowerrightcorner; draw toprightcorner -- lowerleftcorner; \stopuseMPgraphic \defineoverlay[ZRule][\useMPgraphic{ZRule}] \starttext \setupTABLE[c][each][width=30mm] \setupTABLE[r][each][width=6mm] % in an attempt to place the table at known positions, I put it into a layer. Though it is not really "background". \definelayer[datatable][x=0mm, y=0mm,width=\textwidth, height=25mm] \setlayer[datatable][hoffset=0mm, voffset=0mm]{ \bTABLE \bTR \bTD content1 \eTD \bTD \eTD \bTD \eTD \eTR \bTR \bTD content \eTD \bTD \eTD \bTD \eTD \eTR \bTR \bTD content \eTD \bTD \eTD \bTD \eTD \eTR \bTR \bTD content \eTD \bTD[background=ZRule] \eTD \bTD \eTD \eTR \eTABLE } % Now trying to create another layer covering the table area where the "Z" should go. \definelayer[ZStrike][x=32mm, y=0mm,width=60mm, height=24mm] % The "Z" fails to reach full size of the frame \setlayer[ZStrike][hoffset=0mm, voffset=0mm]{\framed[frame=on,width=60mm,height=24mm]{\useMPgraphic{ZRule}}} % arrange the "background" layers \setupbackgrounds[text][background={datatable,foreground,ZStrike}] \blank[force, 28mm] further content \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 ___
Re: [NTG-context] Equivalent of alignat of amsmath with context
Fabrice Couvreur schrieb am 05.01.19 um 12:27: Hi, I'm trying to get the same result for this file compiled with latex. What is the result you get with LaTeX? Wolfgang ___ 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 ___
[NTG-context] Equivalent of alignat of amsmath with context
Hi, I'm trying to get the same result for this file compiled with latex. Thanks. Fabrice \documentclass{article}\usepackage{amsmath} \begin{document} \begin{alignat*}{2}&\qquad& \frac{\lvert\overline{AD}\rvert}{\lvert\overline{CD}\rvert} &=\frac{\lvert\overline{DC}\rvert}{\lvert\overline{CE'}\rvert}\\\iff&& \frac{1}{x}&=\frac{x}{1-x}\\\iff&& 1-x&=x^2\\\iff&& 0&=x^2+x-1\end{alignat*} \end{document} \starttext \startformula \startmathalignment[n=3] \NC \qquad \NC\frac{\lvert\overline{AD}\rvert}{\lvert\overline{CD}\rvert} \NC =\frac{\lvert\overline{DC}\rvert}{\lvert\overline{CE'}\rvert}\NR \NC \iff \NC \frac{1}{x} \NC =\frac{x}{1-x} \NR \NC \iff \NC 1-x \NC =x² \NR \NC \iff \NC 0\NC =x²+x-1 \NR \stopmathalignment \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 ___