Re: [NTG-context] Multiline text in mathmode

2022-06-29 Thread Hans Hagen via ntg-context

On 6/30/2022 7:13 AM, Aditya Mahajan via ntg-context wrote:

On Thu, 30 Jun 2022, Johann Birnick via ntg-context wrote:


I guess you will update to LMTX..? Unfortunately I use MkIV, because of other
math bugs in LMTX. Do you know any (can be ugly) way of doing this without the
new stuff?


You could just use a framed.

\define[1]\multilinetext{\vcenter{\framed[align=middle,frame=off]{#1}}}

\startTEXpage[offset=2mm]
   \startformula
 \left\{ \multilinetext{Quaternion algebra over $\rationals$ \\ up to
 isomorphisms} \right\}
   \stopformula
\stopTEXpage

indeed, the lmtx definiton sis similar:

\permanent\tolerant\protected\def\mparagraph[#1]#*#:#2%
  {\vcenter class \mathconstructcode \bgroup
 \framed
   [\c!offset=\v!overlay,
\c!frame=\v!overlay,
\c!align=\v!middle,
#1]{#2}%
   \egroup}

Hans

-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
   tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
-
___
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] Auto width and height on table cells

2022-06-29 Thread Angel M Alganza via ntg-context

Hello,

I want some tables to occupy 100% of \textwidth and \textheight and for
all columns to be the same width except one or two that I want to
specify and for all rows to be the same height except for one or two,
that I want to specify as well.. 


For the moment, I'm doing it "manually", calculating column width as

  (\textwidth - width of fixed columns) / # rest of columns

and row height as

  (\textheight - height of fixed rows) / # rest of rows

I'm getting the result that I want, but it's a bit tedious.

Is it possible to have ConTeXt do all those calculations for me?
I haven't been able to figure it out from the manuals and the wiki.

Thank you in advance.

Regards,
Ángel
___
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] Multiline text in mathmode

2022-06-29 Thread Aditya Mahajan via ntg-context
On Thu, 30 Jun 2022, Johann Birnick via ntg-context wrote:

> I guess you will update to LMTX..? Unfortunately I use MkIV, because of other
> math bugs in LMTX. Do you know any (can be ugly) way of doing this without the
> new stuff?

You could just use a framed. 

\define[1]\multilinetext{\vcenter{\framed[align=middle,frame=off]{#1}}}

\startTEXpage[offset=2mm]
  \startformula
\left\{ \multilinetext{Quaternion algebra over $\rationals$ \\ up to
isomorphisms} \right\}
  \stopformula
\stopTEXpage

Aditya
___
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] SVG text alignment issue

2022-06-29 Thread Thangalin via ntg-context
Here's the formal rule:

https://www.w3.org/TR/SVG11/coords.html#TransformAttribute

rotate( [ ]), which specifies a rotation by
 degrees about a given point. If optional parameters  and
 are not supplied, the rotation is about the origin of the current user
coordinate system. The operation corresponds to the matrix [cos(a) sin(a)
-sin(a) cos(a) 0 0]. If optional parameters  and  are supplied, the
rotation is about the point (cx, cy). The operation represents the
equivalent of the following specification: translate(, )
rotate() translate(-, -).

It looks like cx/cy, if not present, mean to rotate the text about its
origin, which I would take to be width/2 and height/2. They define the
rotation matrix as [cos(a) sin(a) -sin(a) cos(a) 0 0], where a is the angle:

https://www.w3.org/TR/SVG11/coords.html#RotationDefined

It appears as though LMTX is rotating around the baseline, rather than the
central point of the text's bounding box. (I thought that (cap height +
descender height) / 2 was the middle, but I suppose that wouldn't account
for diacritics.)

Thanks for looking into this!

On Wed, Jun 29, 2022 at 2:24 PM Hans Hagen via ntg-context <
ntg-context@ntg.nl> wrote:

> On 6/29/2022 8:48 PM, Thangalin wrote:
>
> > To me, it looks like the text, after a rotational transform, is being
> > written to the baseline rather than (cap height + descender height) / 2,
> > which seems to be a MetaPost conversion issue? There's another, possibly
> > related issue, which I'll provide in a separate thread.
> Where is that rediculous (rather font version sensitive) rule defined?
> In all test i did so far baseline works ok.
>
> Btw, it is sort of baffling what applications spit out when it comes to
> svg (and exp text). The cod being meant for machines "eyes" only is not
> really an excuse.
>
> Hans
>
>
> -
>Hans Hagen | PRAGMA ADE
>Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
> tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
> -
>
> ___
> 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] Multiline text in mathmode

2022-06-29 Thread Johann Birnick via ntg-context
I guess you will update to LMTX..? Unfortunately I use MkIV, because of other
math bugs in LMTX. Do you know any (can be ugly) way of doing this without the
new stuff?

Johann

On Wed, 2022-06-29 at 20:12 +0200, Hans Hagen via ntg-context wrote:
> On 6/29/2022 11:42 AM, Johann Birnick via ntg-context wrote:
> > Hey there,
> > 
> > does anybody know how to obtain a similar result as in the attached
> > screenshot?
> > I'm only asking about the multiline text in the big braces, the rest I know.
> If you can wait a few days ... see attached. Mikael and I are currently 
> testing some of the latest updates to the math machinery and there will 
> be an intermediate update in a few days before we enter a next stage.
> 
> Hans
> 
> -
>    Hans Hagen | PRAGMA ADE
>    Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
>     tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
> -
> __
> _
> 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] SVG text alignment issue

2022-06-29 Thread Hans Hagen via ntg-context

On 6/29/2022 8:48 PM, Thangalin wrote:

To me, it looks like the text, after a rotational transform, is being 
written to the baseline rather than (cap height + descender height) / 2, 
which seems to be a MetaPost conversion issue? There's another, possibly 
related issue, which I'll provide in a separate thread.
Where is that rediculous (rather font version sensitive) rule defined? 
In all test i did so far baseline works ok.


Btw, it is sort of baffling what applications spit out when it comes to 
svg (and exp text). The cod being meant for machines "eyes" only is not 
really an excuse.


Hans


-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
   tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
-
___
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] SVG text clipping issue

2022-06-29 Thread Thangalin via ntg-context
Text that's tight against its viewbox gets clipped:

https://i.ibb.co/BGQVzzx/text-clipped.png

Here's the code:

% SOF
\startbuffer[svg]
http://www.w3.org/2000/svg;
   xmlns:svg="http://www.w3.org/2000/svg;>
  
  16p13.3

\stopbuffer

\starttext
   \placefigure[]{}{\includesvgbuffer[svg][conversion=mp]}
\stoptext
% EOF
___
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] SVG text alignment issue

2022-06-29 Thread Thangalin via ntg-context
Thanks for checking this. Unfortunately, introducing \hbox didn't work; the
text is still off-center with respect to the vertical line:

https://i.ibb.co/hYGfdgZ/text-align.png

For comparison, the SVG file loaded into Inkscape appears similar to:

https://i.ibb.co/KF3PBkw/inkscape-alignment.png

Note how the text is vertically centered above the vertical line.

To me, it looks like the text, after a rotational transform, is being
written to the baseline rather than (cap height + descender height) / 2,
which seems to be a MetaPost conversion issue? There's another, possibly
related issue, which I'll provide in a separate thread.

Here's the code:

% SOF
\pushoverloadmode \unprotect

\permanent\tolerant\protected\def\includesvgfile[#1]#*[#2]%
   {\hbox\bgroup % no \dontleavehmode
\getdummyparameters[\c!offset=\zeropoint,#2]%
\clf_includesvgfile{#1}\dimexpr\dummyparameter\c!offset\relax
\egroup}

\permanent\tolerant\protected\def\includesvgbuffer[#1]#*[#2]%
   {\hbox\bgroup % no \dontleavehmode
\getdummyparameters[\c!offset=\zeropoint,#2]%
\clf_includesvgbuffer{#1}\dimexpr\dummyparameter\c!offset\relax
\egroup}

\protect \popoverloadmode

\startbuffer[svg]
http://www.w3.org/2000/svg;
   xmlns:svg="http://www.w3.org/2000/svg;>
  
  16p13.3

\stopbuffer

\starttext
   \placefigure[]{}{\includesvgbuffer[svg][conversion=mp]}
\stoptext
% EOF
___
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] Multiline text in mathmode

2022-06-29 Thread Hans Hagen via ntg-context

On 6/29/2022 11:42 AM, Johann Birnick via ntg-context wrote:

Hey there,

does anybody know how to obtain a similar result as in the attached screenshot?
I'm only asking about the multiline text in the big braces, the rest I know.
If you can wait a few days ... see attached. Mikael and I are currently 
testing some of the latest updates to the math machinery and there will 
be an intermediate update in a few days before we enter a next stage.


Hans

-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
   tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
-

paragraph-001.pdf
Description: Adobe PDF document
___
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] indent in \setuptyping

2022-06-29 Thread Pablo Rodriguez via ntg-context
Dear list,

I have the following sample:

  \showframe
  \setuppapersize[A8]
  \setuptyping
  [align={right,broad},
strip=yes,
   lines=yes,
   blank=halfline]
  \starttext
  \startXML
  
content content content content
  

  
content content
content content
  
  \stopXML
  \stoptext

Which is the option to have the first contents broken and indented
automatically by ConTeXt?

I have tried all possible options from
https://www.pragma-ade.com/general/qrcs/setup-en.pdf#page=266. I had no
luck.

I remember that this worked (but I couldn’t find the message from Hans
where he added the option [years ago...]).

Many thanks for your help,

Pablo
___
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] Multiline text in mathmode

2022-06-29 Thread Johann Birnick via ntg-context
Hey there,

does anybody know how to obtain a similar result as in the attached screenshot?
I'm only asking about the multiline text in the big braces, the rest I know.

Thank you,
Johann
___
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] the system not working on Linux 32 with Context-lmtx

2022-06-29 Thread Alain Delmotte via ntg-context

Le 27/06/2022 à 22:32, Pablo Rodriguez via ntg-context a écrit :

On 6/27/22 20:00, Henning Hraban Ramm via ntg-context wrote:

Am 27.06.22 um 19:10 schrieb Alain Delmotte via ntg-context:

[…]
When I run from the console:
context sanstitre-2.tex
mtxrun  | unknown script 'context.lua' or 'mtx-context.lua'
[…]
What should I do?

[…]
Try to rebuild the database: mtxrun --generate

Hi Alain,

as Hraban points out, "mtxrun --generate" is your friend.

I can simply reproduce you error with:

   mtxrun --scripts cache --erase

So I get:

   $ context
   mtxrun | unknown script 'mtx-context.lua' or 'mtx-mtx-context.lua'

Everything works fine again after I run:

   mtxrun --generate.

Before the first run after installation, this command is mandatory to
build the database.

I hope it helps,

Pablo


Hi Pablo and Haram,

When I was running mtxrun --generate, there was an 
interference with TeX Live, so I uninstalled it, then it 
worked. I do not know if that time I did run mtxrun. But 
under TeXworks when I selected context as program it kept 
electing luametatex, and it didn't work; so I manually wrote 
"context" and it worked!!


Thanks for your help,

Alain

___
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] SVG text alignment issue

2022-06-29 Thread Hans Hagen via ntg-context

On 6/29/2022 4:35 AM, Aditya Mahajan via ntg-context wrote:

On Mon, 27 Jun 2022, Thangalin via ntg-context wrote:


In the following example, the line and text should be aligned to the
middle  when LMTX converts the SVG figure using MP. (Note that you may have
to install Roboto, but the font isn't the issue.)

% SOF
\startbuffer[svg]
http://www.w3.org/2000/svg;
xmlns:svg="http://www.w3.org/2000/svg;>
   
   16p13.3

\stopbuffer

\starttext
\placefigure[]{}{\includesvgbuffer[svg][conversion=mp]}
\stoptext
% EOF


This has nothing to do with SVG. Looking at the definition of 
\includesvgbuffer, here is a simpler example illustrating the issue:

 \starttext
 \startplacefigure[location=here, title={Test}]
   \dontleavehmode\begingroup
   \startMPcode
 draw fullcircle scaled 2cm;
   \stopMPcode\endgroup
 \stopplacefigure
 \stoptext

One way to "fix" the alignment is to wrap everything in an hbox:


\placefigure[]{}{\hbox{\includesvgbuffer[svg][conversion=mp]}}

Maybe there is a simple way to modify the definition of includesvgbuffer so 
that an \hbox is not needed.

Thanks for checking it. Can you test with

\pushoverloadmode \unprotect

\permanent\tolerant\protected\def\includesvgfile[#1]#*[#2]%
  {\hbox\bgroup % no \dontleavehmode
   \getdummyparameters[\c!offset=\zeropoint,#2]%
   \clf_includesvgfile{#1}\dimexpr\dummyparameter\c!offset\relax
   \egroup}

\permanent\tolerant\protected\def\includesvgbuffer[#1]#*[#2]%
  {\hbox\bgroup % no \dontleavehmode
   \getdummyparameters[\c!offset=\zeropoint,#2]%
   \clf_includesvgbuffer{#1}\dimexpr\dummyparameter\c!offset\relax
   \egroup}

\protect \popoverloadmode

Hans



-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
   tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
-
___
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
___