Re: [NTG-context] text in mathematics

2018-07-08 Thread Alan Braslau
In many "less-rigorous" uses of equations, there is an abundant need
to include words (text) in mathematics, and using \mathtext{} or \mbox{}
or whatever is unwieldy.

Readable subscripts, self-explanatory variable names, etc. might be
text and not symbols. These situations can be very common. This is why I
asked (1) what is the right method, and (2) what do others think about
the shorthand \t{}, similar to the shorthand \m{}?

Alan


On Sun, 8 Jul 2018 23:00:00 +0200
Otared Kavian  wrote:

> Hi Alan, Wolfgang and Hans Åberg,
> 
> As far as I am concerned, when I have to add a text to a math formula
> I use \mbox, as in the example
> 
> \startformula
> A := \left\{f : {\Bbb R}^2 \longrightarrow {\Bbb R} \; ; \; f
> \mbox{ is measurable and }  \int_{{\Bbb R}^2}|f(x)|dx < \infty
> \right\}. \stopformula
> 
> The advantage being that if the above formula appears in an
> environment such as a Theorem (where the text is typeset in italic,
> or slanted) the text in the above \mbox will be also in italic or
> slanted.
> 
> I don't think it would be a good idea to add new commands to treat
> text in a math formula: the existing possiblities are more than
> satisfactory, and moreover situations where one has to add text to a
> formula are not that common. So using a command like \mbox, or \text,
> or \mathtext, or whatever, is not that time consuming.
> 
> Best regards: OK
> 
> 
> > On 8 Jul 2018, at 21:21, Wolfgang Schuster
> >  wrote:
> > 
> > Hi Alan,
> > 
> > 1. The correct way to use \mathrm is {\mathrm ...} because it is a
> > switch like \rm for text mode.
> > 
> > 2. \mathrm is the wrong method to write text in formulas because
> > the command changes only the math alphabet. This means no
> > ligatures, kerning or other characters like umlauts.
> > 
> > 3. The correct way to write text in math mode is \mathtext (which
> > has the synonym \text) or \mathword. To change the style of the
> > text you can use \mathtext{\it …} or \mathtextit{…}.
> > 
> > Wolfgang  
> >> Alan Braslau  7. Juli 2018 um
> >> 16:04 Hello ConTeXt users,
> >> 
> >> Does it drive you crazy to see TeX users write $t = time$?
> >> (I see this all of the time by LaTeX users in Beamer
> >> presentations.)
> >> 
> >> One can do better writing $t = {\rm time}$ (maybe)
> >> or in ConTeXt $t = \mathrm{time}$.
> >> Sometimes, too, I might write $t = \text{time}$.
> >> 
> >> We also have the commands \mathematics{} that can be used in place
> >> of the TeX shorthand $...$, and this also has the shortcut \m{...}.
> >> 
> >> I thought that it might be useful to have an equivalent escape, to
> >> be used as $t = \t{time}$. What do other users think?
> >> 
> >> OK, \m{t = \t{time}} might be a bit funky... 
> >> 
> >> 
> >> Alan
> >> 
> >> 
> >> P.S. I proposed doing this via
> >> \let\t\mathrm
> >> but Hans tells me that this is not good, as \mathrm{} does not give
> >> proper font processing, so implementation of \t{} would be
> >> something different...
> >> ___
> >> 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] text in mathematics

2018-07-08 Thread Otared Kavian
Hi Alan, Wolfgang and Hans Åberg,

As far as I am concerned, when I have to add a text to a math formula I use 
\mbox, as in the example

\startformula
A := \left\{f : {\Bbb R}^2 \longrightarrow {\Bbb R} \; ; \; f \mbox{ is 
measurable and }  \int_{{\Bbb R}^2}|f(x)|dx < \infty \right\}.
\stopformula

The advantage being that if the above formula appears in an environment such as 
a Theorem (where the text is typeset in italic, or slanted) the text in the 
above \mbox will be also in italic or slanted.

I don't think it would be a good idea to add new commands to treat text in a 
math formula: the existing possiblities are more than satisfactory, and 
moreover situations where one has to add text to a formula are not that common. 
So using a command like \mbox, or \text, or \mathtext, or whatever, is not that 
time consuming.

Best regards: OK


> On 8 Jul 2018, at 21:21, Wolfgang Schuster  
> wrote:
> 
> Hi Alan,
> 
> 1. The correct way to use \mathrm is {\mathrm ...} because it is a switch 
> like \rm for text mode.
> 
> 2. \mathrm is the wrong method to write text in formulas because the command 
> changes only the math alphabet. This means no ligatures, kerning or other 
> characters like umlauts.
> 
> 3. The correct way to write text in math mode is \mathtext (which has the 
> synonym \text) or \mathword. To change the style of the text you can use 
> \mathtext{\it …} or \mathtextit{…}.
> 
> Wolfgang
>> Alan Braslau  7. Juli 2018 um 16:04
>> Hello ConTeXt users,
>> 
>> Does it drive you crazy to see TeX users write $t = time$?
>> (I see this all of the time by LaTeX users in Beamer presentations.)
>> 
>> One can do better writing $t = {\rm time}$ (maybe)
>> or in ConTeXt $t = \mathrm{time}$.
>> Sometimes, too, I might write $t = \text{time}$.
>> 
>> We also have the commands \mathematics{} that can be used in place of
>> the TeX shorthand $...$, and this also has the shortcut \m{...}.
>> 
>> I thought that it might be useful to have an equivalent escape, to be
>> used as $t = \t{time}$. What do other users think?
>> 
>> OK, \m{t = \t{time}} might be a bit funky... 
>> 
>> 
>> Alan
>> 
>> 
>> P.S. I proposed doing this via
>> \let\t\mathrm
>> but Hans tells me that this is not good, as \mathrm{} does not give
>> proper font processing, so implementation of \t{} would be something
>> different...
>> ___
>> 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] text in mathematics

2018-07-08 Thread Wolfgang Schuster

Hi Alan,

1. The correct way to use \mathrm is {\mathrm ...} because it is a 
switch like \rm for text mode.


2. \mathrm is the wrong method to write text in formulas because the 
command changes only the math alphabet. This means no ligatures, kerning 
or other characters like umlauts.


3. The correct way to write text in math mode is \mathtext (which has 
the synonym \text) or \mathword. To change the style of the text you can 
use \mathtext{\it …} or \mathtextit{…}.


Wolfgang

Alan Braslau 
7. Juli 2018 um 16:04
Hello ConTeXt users,

Does it drive you crazy to see TeX users write $t = time$?
(I see this all of the time by LaTeX users in Beamer presentations.)

One can do better writing $t = {\rm time}$ (maybe)
or in ConTeXt $t = \mathrm{time}$.
Sometimes, too, I might write $t = \text{time}$.

We also have the commands \mathematics{} that can be used in place of
the TeX shorthand $...$, and this also has the shortcut \m{...}.

I thought that it might be useful to have an equivalent escape, to be
used as $t = \t{time}$. What do other users think?

OK, \m{t = \t{time}} might be a bit funky...


Alan


P.S. I proposed doing this via
\let\t\mathrm
but Hans tells me that this is not good, as \mathrm{} does not give
proper font processing, so implementation of \t{} would be something
different...
___
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] Scale image in MetaPost, maintaining aspect ratio

2018-07-08 Thread Alan Braslau
On Sun, 8 Jul 2018 11:21:55 +0200
Hans Hagen  wrote:

> the "externalfigure" variant is an old one that had to deal with 
> dimensions in a way that avoids overflows
> 
> in a future context (read luatex 1.09+) we go one-pass-mp so we can
> have a different approach (i never wanted to add a ton of code for
> images) so there externalfigure will scale proportionally too

ConTeXt running on the luatex experimental branch under development
indeed works with one-pass-MP calculations as opposed to the two-pass
mechanism that is standard today. For documents with extensive and
complicated MP graphics, this yields a huge gain. Hans is at present
working out all side-effects (such as recursive MP/TeX/lua calls) and is
cleaning up some old ways of doing things that date from mkii. This
might seem somewhat minor but is really exciting for those who use a
lot of graphics and MetaPost effects.

Alan
___
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] Scale image in MetaPost, maintaining aspect ratio

2018-07-08 Thread Hans Hagen

On 7/8/2018 11:02 AM, Marco Patzer wrote:

On Sun, 8 Jul 2018 10:39:52 +0200
Hans Hagen  wrote:


On 7/8/2018 1:45 AM, Marco Patzer wrote:

On Sat, 7 Jul 2018 14:27:38 -0600
Alan Braslau  wrote:
   

For "historic" reasons,
  draw externalfigure "cow" scaled 5cm ;
normalizes the figure to a square. This will not be changed as it
is a very old feature of MetaFun.

The solution is
  draw rawtextext("\externalfigure[cow]") xsized 5cm ;
where one can use xsized, ysized or xysized (taking a pair).


That works indeed. Thanks.

draw figure "" ...


That's what I was looking for. Thanks.
the "externalfigure" variant is an old one that had to deal with 
dimensions in a way that avoids overflows


in a future context (read luatex 1.09+) we go one-pass-mp so we can have 
a different approach (i never wanted to add a ton of code for images) so 
there externalfigure will scale proportionally too


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
___

Re: [NTG-context] Scale image in MetaPost, maintaining aspect ratio

2018-07-08 Thread Marco Patzer
On Sun, 8 Jul 2018 10:39:52 +0200
Hans Hagen  wrote:

> On 7/8/2018 1:45 AM, Marco Patzer wrote:
> > On Sat, 7 Jul 2018 14:27:38 -0600
> > Alan Braslau  wrote:
> >   
> >> For "historic" reasons,
> >>  draw externalfigure "cow" scaled 5cm ;
> >> normalizes the figure to a square. This will not be changed as it
> >> is a very old feature of MetaFun.
> >>
> >> The solution is
> >>  draw rawtextext("\externalfigure[cow]") xsized 5cm ;
> >> where one can use xsized, ysized or xysized (taking a pair).  
> > 
> > That works indeed. Thanks.  
> draw figure "" ...

That's what I was looking for. Thanks.

Marco
___
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] Scale image in MetaPost, maintaining aspect ratio

2018-07-08 Thread Hans Hagen

On 7/8/2018 1:45 AM, Marco Patzer wrote:

On Sat, 7 Jul 2018 14:27:38 -0600
Alan Braslau  wrote:


For "historic" reasons,
 draw externalfigure "cow" scaled 5cm ;
normalizes the figure to a square. This will not be changed as it is a
very old feature of MetaFun.

The solution is
 draw rawtextext("\externalfigure[cow]") xsized 5cm ;
where one can use xsized, ysized or xysized (taking a pair).


That works indeed. Thanks.

draw figure "" ...



-
  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
___