ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Otared Kavian <otared@gmail.com>
To: mailing list for ConTeXt users <ntg-context@ntg.nl>
Subject: Re: Problem with a macro
Date: Sun, 11 Feb 2018 17:23:11 +0100	[thread overview]
Message-ID: <AE592FC2-1AA2-48CB-844B-4C7CC617B6F9@gmail.com> (raw)
In-Reply-To: <AE615C81-2B30-4179-809E-DA8D67FA23FA@me.com>

Hi Dalyoung,

You are right regarding the unnatural way of using \autointegral. An easy way to use the \autointegral command in a more natural way is to define one’s own macro, as in the following:

\setupmathdelimiter[integral][rightoffset=-3mu,exact=yes,factor=2]

\unexpanded\def\myint#1#2#3#4{\autointegral{#2}{#1}{#3(#4)}\,\diff #4}

\starttext
$\myint{1}{4}{f}{x}$

\startformula
\myint{0}{2\pi}{\cos(t)^2\sin}{t} = 0
\stopformula
And here is the classical \type{\int} command:
\startformula
\int_{0}^{1} g(x)\,\diff x = 1.
\stopformula
\stoptext

Best regards: OK

> On 11 Feb 2018, at 15:20, Jeong Dal <haksan@me.com> wrote:
> 
> Dear Otared,
> 
> As you said, it is working well.
> 
> However, the numbers 1, 4 located at the top and the bottom of the integral sign which is not usual in math. 
> I have seen a discussion about such an output, but I may not see the result which I want.
> 
> As you see in the following example, only the 1st and the 2nd  gave the output which is usual in math.
> Is still there no way to make nice output  using “\startformula”?
> 
> Thank you.
> 
> Best regards,
> 
> Dalyoung
> 
> %%%%%%%%%%
> \unexpanded\def\integ#1#2#3{\math{\autointegral{#1}{#2}{#3}\diff x}}
> 
> \starttext
> \math{\int_1^4 f(x) \diff x}
> 
> \math{\displaystyle \int_1^4 f(x) \diff x}
> 
> \startformula
> \int_1^4 f(x) \diff x
> \stopformula
> 
> \integ{4}{1}{f(x)}
> \stoptext
> 
> 
>> If you remove the line
>> 	\setupmathextensible[integral][rightoffset=-3mu,exact=yes,factor=2]  
>> then your example typesets well with the last beta version 2018.02.09 00:04.
>> 
>> Best regards: OK
>> 
>>> On 11 Feb 2018, at 09:35, Fabrice Couvreur <fabrice1.couvreur@gmail.com> wrote:
>>> 
>>> Hi Hans,
>>> The macro that you proposed me worked very well but since my update of context standalone, it does not work any more.
>>> Thank you.
>>> Fabrice
>>> 
>>> \setupmathextensible[integral][rightoffset=-3mu,exact=yes,factor=2]  
>>> 
>>> \unexpanded\def\integ#1#2#3{\math{\autointegral{#1}{#2}{#3}\diff x}}
>>> 
>>> \starttext
>>> \integ{4}{1}{f(x)}
>>> \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
___________________________________________________________________________________

  reply	other threads:[~2018-02-11 16:23 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <mailman.1.1518346801.23694.ntg-context@ntg.nl>
2018-02-11 14:20 ` Jeong Dal
2018-02-11 16:23   ` Otared Kavian [this message]
     [not found] <mailman.2564.1518369529.2111.ntg-context@ntg.nl>
2018-02-11 23:31 ` Jeong Dal
2018-02-11 23:39   ` Wolfgang Schuster
2018-02-22 21:15     ` Fabrice Couvreur
2018-02-23 14:03       ` Wolfgang Schuster
2018-02-25 11:43         ` Fabrice Couvreur
2018-02-11  8:35 Fabrice Couvreur
2018-02-11  9:01 ` Otared Kavian
2018-02-11 11:43   ` Fabrice Couvreur
2018-02-11 14:31 ` Wolfgang Schuster

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=AE592FC2-1AA2-48CB-844B-4C7CC617B6F9@gmail.com \
    --to=otared@gmail.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).