Re: [NTG-context] Formulanumbers in margin

2021-03-21 Thread Adam Reviczky
Thanks Hraban,

That should be fine, I've tried to increase the margins as well, but not
sure that's the issue as I can perfectly place text with \inmargin
directly, just not with the numbercommand.

MWE:

\starttext
\setuplayout[margin=2cm, leftmargin=2cm, rightmargin=2cm]

\showframe
\showlayout

\setupcaption[figure][location={rightmargin}]
\startplacefigure[title=Cow] \externalfigure[cow] \stopplacefigure

\define[1]\MyFormulaNumber{\inleftmargin{#1}}
\setupformula[numbercommand=\MyFormulaNumber]

\inleftmargin{Left Margin Text}
\inrightmargin{Right Margin Text}

\startplaceformula[reference=eq1] \startformula c^2 = a^2 + b^2
\stopformula \stopplaceformula
\stoptext

Adam

On Sun, Mar 21, 2021 at 8:31 PM Henning Hraban Ramm  wrote:

>
> > Am 21.03.2021 um 20:56 schrieb Adam Reviczky :
> >
> > Thanks Hraban,
> >
> > I've tried the numbercommand as well, but that also just makes the
> formula number disappear, unless I am doing something wrong.
> >
> > The framing as per the math manual (manuals/math/math-framing.tex)
> however does work, so not sure:
> > \setupformula[numbercommand={\inframed[framecolor=green]}]
>
> Are your margins actually non-zero? (\setuplayout)
> Maybe check with \showlayout
>
> Hraban
>
> ___
> 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] Formulanumbers in margin

2021-03-21 Thread Henning Hraban Ramm

> Am 21.03.2021 um 20:56 schrieb Adam Reviczky :
> 
> Thanks Hraban,
> 
> I've tried the numbercommand as well, but that also just makes the formula 
> number disappear, unless I am doing something wrong.
> 
> The framing as per the math manual (manuals/math/math-framing.tex) however 
> does work, so not sure:
> \setupformula[numbercommand={\inframed[framecolor=green]}]

Are your margins actually non-zero? (\setuplayout)
Maybe check with \showlayout

Hraban
___
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] Formulanumbers in margin

2021-03-21 Thread Adam Reviczky
Thanks Hraban,

I've tried the numbercommand as well, but that also just makes the formula
number disappear, unless I am doing something wrong.

The framing as per the math manual (manuals/math/math-framing.tex
)
however does work, so not sure:
\setupformula[numbercommand={\inframed[framecolor=green]}]

Adam

On Sun, Mar 21, 2021 at 7:47 PM Henning Hraban Ramm  wrote:

>
>
> > Am 21.03.2021 um 19:40 schrieb Adam Reviczky :
> >
> > % this makes the formulanumber disappear
> > % \setupformulas[location={rightmargin}]
>
> No, \setupformula’s location understands only left and right.
>
> Try something like:
>
> \define[1]\MyFormulaNumber{\inmargin{#1}}
>
> \setupformula[
> numbercommand=\MyFormulaNumber
> ]
>
>
> Hraban
>
> ___
> 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] Formulanumbers in margin

2021-03-21 Thread Henning Hraban Ramm


> Am 21.03.2021 um 19:40 schrieb Adam Reviczky :
> 
> % this makes the formulanumber disappear
> % \setupformulas[location={rightmargin}]

No, \setupformula’s location understands only left and right.

Try something like:

\define[1]\MyFormulaNumber{\inmargin{#1}}

\setupformula[
numbercommand=\MyFormulaNumber
]


Hraban
___
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] Formulanumbers in margin

2021-03-21 Thread Adam Reviczky
Hi,

One more question on formulas. How can I get the formula number to be put
into the left/right margin instead of left/right inside the text?

I have tried the following:

\starttext
\showframe
% figure caption into the margin
\setupcaption[figure][location={rightmargin}]
\startplacefigure[title=Cow] \externalfigure[cow] \stopplacefigure

% this makes the formulanumber disappear
% \setupformulas[location={rightmargin}]
\startplaceformula[reference=eq1,location={rightmargin}] \startformula c^2
= a^2 + b^2 \stopformula \stopplaceformula
\stoptext

But the setupformulas will make the number disappear entirely, and the
placeformula location doesn't seem to take the margin option.

Thanks,
Adam
___
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] Typing within doifmode leads to error

2021-03-21 Thread Christoph Reller
On Sat, Mar 20, 2021 at 6:07 PM Hans Hagen  wrote:

> On 3/20/2021 4:00 PM, Christoph Reller wrote:
> > On Sat, Mar 20, 2021 at 12:12 PM Hans Hagen  > > wrote:
> >
> > On 3/20/2021 8:24 AM, Aditya Mahajan wrote:
> >  > On Sat, 20 Mar 2021, Christoph Reller wrote:
> >  >> Of course we can do this in lua:
> >  >>
> >  >> if tex.modes["A"] and not tex.modes{"B"] then
> >  >> ...
> >  >> end
> >  >
> >  > ... which means that you can use that at the context end as well
> > (old feature).
> >  > Save the following as test.mkix (or add "% macros=mkix" as the
> > first line):
> >  >
> >  > ```
> >  > \starttext
> >  > 
> >  > \starttyping
> >  > A and not B
> >  > \stoptyping
> >  > 
> >  > \starttyping
> >  > not (A and not B)
> >  > \stoptyping
> >  > 
> >  > \stoptext
> > a neat application!
> >
> >
> > Thank you for this hint, Aditya. This would be a very nice solution
> > indeed. But it does not seem to work:
> >
> > % macros=mkix
> > \definemode[A][yes]
> > \starttext
> > \startluacode
> >if tex.modes['A'] then
> >  context("A")
> >end
> > \stopluacode
> > 
> > A
> > 
> > \stoptext
> >
> > With ConTeXt LMTX 2021.03.17 the output of the above is a single "A". I
> > would expect two. What am I doing wrong?
>
> When the file gets preprocessed the mode is not known
>
> context --mode=A foo.tex
>
> it does of course also work when you set the mode in a parent file and
> then include foo.tex


For me this is good enough, because I define modes always in top-level
files or in modules. Thank you!

Christoph
___
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] Formula numbering including all prefix segments

2021-03-21 Thread Adam Reviczky
Hi Hans,

That does it indeed, thank you!

Together with prefixconversion I mainly wanted to use this for formulas in
the appendix with the added prefix.

I'll add it to the wiki, as it is a very helpful information.

Adam

On Sun, Mar 21, 2021 at 12:55 PM Hans Hagen  wrote:

> On 3/20/2021 11:45 PM, Adam Reviczky wrote:
> > Hi,
> >
> > Is there a way to have formula numbers showing all prefix segments?
> > When I use prefixsegments, I get the desired numbering in the placelist
> > but not in the formula number itself.
> >
> > For example:
> > \starttext
> > \setupcaption[figure][way=bytext,prefixsegments=1:*]
> > \setupformulas[way=bytext,prefixsegments=1:*]
> > \startsection[title=Section]
> > \startsubsection[title=SubSection]
> > \startplacefigure[list=cow] \externalfigure[cow] \stopplacefigure
> > \startplaceformula[reference=eq1] \startformula c^2 = a^2 + b^2
> > \stopformula \stopplaceformula
> > \stopsubsection
> > \stopsection
> > \placelistoffigures[criterium=all]
> > \placelist[formula][criterium=all]
> > \stoptext
> >
> > The figure has number 1.1.1 and is in the list as 1.1.1, the formula has
> > number 1.1 but is listed as 1.1.1.
> > I would like to have the formula numbered 1.1.1 as well (as referenced
> > in the placelist), so with section and subsection numbering.
> you need to add: prefixset=all (default is limited to 3, see strc-def)
>
> \starttext
>  \setupcounter[formula][way=bytext]
>  \setupcaption[figure][way=bytext,prefixsegments=1:*]
>  \setupformulas[way=bytext,prefixsegments=1:*,prefixset=all]
>
>  \startchapter[title=Chapter]
>  \dorecurse{4}{
>  \startsection[title=Section]
>  \startsubsection[title=SubSection]
>  \startplacefigure[list=cow] \externalfigure[cow]
> \stopplacefigure
>  \startplaceformula[reference=eq1] \startformula c^2
> = a^2 + b^2 \stopformula \stopplaceformula
>  \stopsubsection
>  \startsubsection[title=SubSection]
>  \startplacefigure[list=cow] \externalfigure[cow]
> \stopplacefigure
>  \startplaceformula[reference=eq1] \startformula c^2
> = a^2 + b^2 \stopformula \stopplaceformula
>  \stopsubsection
>  \stopsection
>  }
>  \stopchapter
>
>  \placelistoffigures[criterium=all]
>  \placelist[formula][criterium=all]
> \stoptext
> -
>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] Formula numbering including all prefix segments

2021-03-21 Thread Hans Hagen

On 3/20/2021 11:45 PM, Adam Reviczky wrote:

Hi,

Is there a way to have formula numbers showing all prefix segments?
When I use prefixsegments, I get the desired numbering in the placelist 
but not in the formula number itself.


For example:
\starttext
\setupcaption[figure][way=bytext,prefixsegments=1:*]
\setupformulas[way=bytext,prefixsegments=1:*]
\startsection[title=Section]
\startsubsection[title=SubSection]
\startplacefigure[list=cow] \externalfigure[cow] \stopplacefigure
\startplaceformula[reference=eq1] \startformula c^2 = a^2 + b^2 
\stopformula \stopplaceformula

\stopsubsection
\stopsection
\placelistoffigures[criterium=all]
\placelist[formula][criterium=all]
\stoptext

The figure has number 1.1.1 and is in the list as 1.1.1, the formula has 
number 1.1 but is listed as 1.1.1.
I would like to have the formula numbered 1.1.1 as well (as referenced 
in the placelist), so with section and subsection numbering.

you need to add: prefixset=all (default is limited to 3, see strc-def)

\starttext
\setupcounter[formula][way=bytext]
\setupcaption[figure][way=bytext,prefixsegments=1:*]
\setupformulas[way=bytext,prefixsegments=1:*,prefixset=all]

\startchapter[title=Chapter]
\dorecurse{4}{
\startsection[title=Section]
\startsubsection[title=SubSection]
\startplacefigure[list=cow] \externalfigure[cow] 
\stopplacefigure
\startplaceformula[reference=eq1] \startformula c^2 
= a^2 + b^2 \stopformula \stopplaceformula

\stopsubsection
\startsubsection[title=SubSection]
\startplacefigure[list=cow] \externalfigure[cow] 
\stopplacefigure
\startplaceformula[reference=eq1] \startformula c^2 
= a^2 + b^2 \stopformula \stopplaceformula

\stopsubsection
\stopsection
}
\stopchapter

\placelistoffigures[criterium=all]
\placelist[formula][criterium=all]
\stoptext
-
  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
___