Re: [NTG-context] Add items to list with arbitrary page number

2021-03-17 Thread Hans Hagen

On 3/17/2021 6:19 PM, denis.ma...@ub.unibe.ch wrote:

Hi,

I need to add an item to a list with an arbitrary page number. (The 
reason is that I have a multivolume book, and I want to add information 
about the other books to the TOC)


I know about this:

\writetolist[section]{}{It's a test}

But how can you add an arbitrary page numberĀ ?

It all depends on what you want to do 


\starttext

\installstructurelistprocessor{chapter:userdata}
  {\startlinecorrection[blank]
   \hfill \inframed{you really need to look at 
\structurelistuservariable{pagenumber}}%

   \stoplinecorrection}

\placelist[chapter]

\chapter{one}

\writebetweenlist[chapter][location=here]{\blank page 4\blank}

\writedatatolist[chapter][location=here][pagenumber=4]

\writetolist[chapter]{}{It's a test}

\chapter{two}

\stoptext

wikifyable

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] placenamedformula in placelist (MKII vs MKIV/LMTX)

2021-03-17 Thread Adam Reviczky
Hi,

Or would it be possible to just add a "list=" option to placeformula
similar to placefigure? (although that might conflict with the combination
of "title=")

All I am really after is to label or name numbered formulas in the
placelist.

---
\starttext

% 1   This is a picture of a cow  . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . .  1
\startplacefigure[title={My cow},list={This is a picture of a cow}]
\externalfigure[cow] \stopplacefigure

% Mass-energy equivalence . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . 1
\startplaceformula[reference=eq:one,title={Mass-energy equivalence}]
\startformula e=mc^2 \stopformula \stopplaceformula

% 1   . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . .  1
% list option could give: 1   Mass-energy equivalence . . . . . . . . . . .
. . . . . . . . . . . .  1
\startplaceformula[reference=eq:one,list={Mass-energy equivalence}]
\startformula e=mc^2 \stopformula \stopplaceformula

\placelistoffigures[criterium=all,alternative=c]
\placelist[formula][criterium=all,alternative=c]

\stoptext
--

Adam

On Tue, Mar 16, 2021 at 5:28 AM Adam Reviczky  wrote:

> Hi,
>
> I want to use placenamedformula to list a formula in the placelist with
> both the formula name and the formula number (alongside the pagenumber).
>
> The example in the wiki (https://wiki.contextgarden.net/Math/Display) and
> the test suite (cont-tst/doc/context/tests/mkiv/math/formulas-003.tex)
> shows what I would like to have.
>
> Using MKII I get the desired output (1 formulaname ... and 3b formulaname
> ...) but with MKIV and LMTX I only get the reference from the placeformula
> (as 1 and correctly not listed in the placelist) and none of the
> placenamedformula numbers. The placeformula number is then carried onto the
> second placenamedformula as 1 (resulting in formulaname ... and 1
> formulaname ...).
>
> I have attached the test suite file output with both MKII and MKIV.
>
> Is there a way to get the MKII output with MKIV/LMTX somehow?
>
> 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] add more blank space when using \starteffect[hidden]

2021-03-17 Thread Jeong Dal
Dear Hans,

It is very interesting example.
Thank you for a new method.

Best regards,

Dalyoung

> 
> \def\determinednoflines#1%
>  {\localcontrolled{\determinenoflines{#1}}\noflines}
> 
> \startbuffer
>\input tufte
> \stopbuffer
> 
> \fillinrules[n=\determinednoflines{\getbuffer},
>  width=fit]{first}
> \fillinrules[n=\determinednoflines{\getbuffer},
>  width=broad]{first}
> \fillinrules[n=\determinednoflines{\getbuffer},
>  width=3cm]{first}
> \fillinrules[n=\determinednoflines{\getbuffer},
>  width=3cm,distance=.5em,separator=:]{first}
> \fillinrules[n=\determinednoflines{\getbuffer}]{first}{last}
> 
> i'll make a better hider later
> 
> -
>  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] Add items to list with arbitrary page number

2021-03-17 Thread denis.maier
Hi,
I need to add an item to a list with an arbitrary page number. (The reason is 
that I have a multivolume book, and I want to add information about the other 
books to the TOC)

I know about this:
\writetolist[section]{}{It's a test}

But how can you add an arbitrary page number ?

Best,
Denis

___
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] Chemical reaction formulas

2021-03-17 Thread David van Diepen
Dear list,

According to the information on contextgarden (section chemistry)
chemical reactions should be entered as follows:

\usemodule[chemic]
\startformula
   \chemical{CaCO_3(s),+,HCl(g),->,CaCl(HCO_3)(s)}
\stopformula

That produces a formula with the comma's in it, so that's not good. If
I enter it as follows

\usemodule[chemic]
\startformula
   \chemical{CaCO_3(s) + HCl(g) \rightarrow CaCl(HCO_3)(s)}
\stopformula

Then somehow after the \rightarrow the math/chemical environment is
lost and the remainder gets typeset as text. The same is true if I use
any math command such as \beta or \cdot.

The closest I get to the desired result is with the following:

\usemodule[chemic]
\startformula
   \chemical{CaCO_3(s) + HCl(g) -->
CaCl(HCO_3)(s)}
\stopformula

But that is a bit of a compromise.

Regards, David van Diepen

___
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] add more blank space when using \starteffect[hidden]

2021-03-17 Thread Hans Hagen

On 3/16/2021 8:08 PM, Jeong Dal wrote:

Dear Hans,

I found a command \determinenoflines by googling.
I made a MWE as following. It is working well.

But I have to write the paragraph twice for couning.
Is there a better way?

Thank you again.
Best regards,

Dalyoung

%%%
\def\StartHide{\doifmode{hideSolution}{\starteffect[hidden]}}
\def\StopHide{\doifmode{hideSolution}{\stopeffect\blank[\the\noflines*line 
+ \the\noflines*halfline]}}


\enablemode[hideSolution]

\starttext

The first line.

\hrule
\StartHide
\samplefile{knuth}
\determinenoflines{\samplefile{knuth}}
\StopHide
\hrule

The second line.

\hrule

\StartHide
\samplefile{ward}
\determinenoflines{\samplefile{ward}}
\StopHide

\hrule

The last line.
\stoptext

Let me show you some magic ...

\def\determinednoflines#1%
  {\localcontrolled{\determinenoflines{#1}}\noflines}

\startbuffer
\input tufte
\stopbuffer

\fillinrules[n=\determinednoflines{\getbuffer},
  width=fit]{first}
\fillinrules[n=\determinednoflines{\getbuffer},
  width=broad]{first}
\fillinrules[n=\determinednoflines{\getbuffer},
  width=3cm]{first}
\fillinrules[n=\determinednoflines{\getbuffer},
  width=3cm,distance=.5em,separator=:]{first}
\fillinrules[n=\determinednoflines{\getbuffer}]{first}{last}

i'll make a better hider later

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