Re: [NTG-context] Labels and Enumerations

2018-01-14 Thread Rik Kabel
Further experimentation suggests that the problem is in the interaction 
between footnotes and margin placement. Endnotes work fine.


   \defineconstructionalternative
  [mylabel]
  [renderingsetup=constructionrenderings:mylabel,
   width=]

   \startsetups[constructionrenderings:mylabel]
  \dontleavehmode
  \inright{\flushconstructionheadbox}
   \stopsetups

   \defineenumeration
  [one]
  [alternative=mylabel,
   display=no,
   before=,
   after=]

   \definenote
  [endnote]
   \setupnotation
  [endnote]
   [way=bytext,
    location=none,
    conversion=numbers]

   \starttext

    \startchapter[title=bar]

    this works \startone[reference=aa]\input jojomayer \stopone
    \quotation{\startone[reference=bb]\input ward \stopone}

    this fails\footnote{\startone[reference=cc]\input jojomayer
   \stopone
    \quotation{\startone[reference=dd]\input ward \stopone}}

    while this works\endnote{\startone[reference=ee]\input
   jojomayer \stopone
    \quotation{\startone[reference=ff]\input ward \stopone}}

    whatever \in{one}[aa] whatever \in{one}[bb]

    whatever \in{one}[cc] whatever \in{one}[dd]

    whatever \in{one}[ee] whatever \in{one}[ff]

    \stopchapter

    \startchapter[title=notes]

    \placenotes[endnote]

    \stopchapter

   \stoptext

--
Rik


___
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] Problem with string.format (Lua)

2018-01-14 Thread Hans Hagen

On 1/14/2018 9:50 PM, Fabrice Couvreur wrote:

Hi Hans,
Your code runs perfectly, thanks. However, if I replace % with  
\letterpercent, my code does not run


\ctxlua{print(string.format("\letterpercent g",Binomial(100,60,0.25)))}


because print prints to the console


Thank you
Fabrice

2018-01-14 13:58 GMT+01:00 Hans Hagen >:


On 1/14/2018 1:13 PM, Joseph Canedo wrote:

Hi Fabrice,

string.format behaves more or less as C printf. You probably
need to specify %.4g in 1st argument.

Hope this helps

Best

Joseph

*De : *Fabrice Couvreur >
*Envoyé le :*dimanche 14 janvier 2018 13:05
*À : *mailing list for ConTeXt users >
*Objet :*[NTG-context] Problem with string.format (Lua)

Hello,
I start with Lua and I try to display my result with 4 decimal
places without success.
Thank you
Fabrice

\startluacode
function Binomial(n,k,p)
  if k > n then return nil end
  if k > n/2 then k = n - k end

  numer, denom = 1, 1
  for i = 1, k do
  numer = numer * ( n - i + 1 )
  denom = denom * i
  end
  return (numer/denom) * p^k * (1-p)^(n-k)
end

\stopluacode

\starttext
\ctxlua{print(string.format("%g",Binomial(100,60,0.25)))}
\stoptext


the % should be \letterpercent

btw, use locals for numer and denom

you can also do this:

\startluacode
     function document.Binomial(n,k,p)
         if k > n then
             return nil
         end
         if k > n/2 then
             k = n - k
         end
         local numer, denom = 1, 1
         for i=1,k do
             numer = numer * ( n - i + 1 )
             denom = denom * i
         end
         context("%0.5g",(numer/denom) * p^k * (1-p)^(n-k))
     end
\stopluacode

\starttext
     \ctxlua{document.Binomial(100,60,0.25)}
\stoptext

in general

context("format",)

is a bit more powerful than using format




-- 


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




--

-
  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] Problem with string.format (Lua)

2018-01-14 Thread Fabrice Couvreur
Hi Hans,
Your code runs perfectly, thanks. However, if I replace % with
\letterpercent, my code does not run

\ctxlua{print(string.format("\letterpercent g",Binomial(100,60,0.25)))}

Thank you
Fabrice

2018-01-14 13:58 GMT+01:00 Hans Hagen :

> On 1/14/2018 1:13 PM, Joseph Canedo wrote:
>
>> Hi Fabrice,
>>
>> string.format behaves more or less as C printf. You probably need to
>> specify %.4g in 1st argument.
>>
>> Hope this helps
>>
>> Best
>>
>> Joseph
>>
>> *De : *Fabrice Couvreur 
>> *Envoyé le :*dimanche 14 janvier 2018 13:05
>> *À : *mailing list for ConTeXt users 
>> *Objet :*[NTG-context] Problem with string.format (Lua)
>>
>> Hello,
>> I start with Lua and I try to display my result with 4 decimal places
>> without success.
>> Thank you
>> Fabrice
>>
>> \startluacode
>> function Binomial(n,k,p)
>>  if k > n then return nil end
>>  if k > n/2 then k = n - k end
>>
>>  numer, denom = 1, 1
>>  for i = 1, k do
>>  numer = numer * ( n - i + 1 )
>>  denom = denom * i
>>  end
>>  return (numer/denom) * p^k * (1-p)^(n-k)
>> end
>>
>> \stopluacode
>>
>> \starttext
>> \ctxlua{print(string.format("%g",Binomial(100,60,0.25)))}
>> \stoptext
>>
>
> the % should be \letterpercent
>
> btw, use locals for numer and denom
>
> you can also do this:
>
> \startluacode
> function document.Binomial(n,k,p)
> if k > n then
> return nil
> end
> if k > n/2 then
> k = n - k
> end
> local numer, denom = 1, 1
> for i=1,k do
> numer = numer * ( n - i + 1 )
> denom = denom * i
> end
> context("%0.5g",(numer/denom) * p^k * (1-p)^(n-k))
> end
> \stopluacode
>
> \starttext
> \ctxlua{document.Binomial(100,60,0.25)}
> \stoptext
>
> in general
>
> context("format",)
>
> is a bit more powerful than using format
>
>
>
>
> --
>
> -
>   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/list
> info/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
___

[NTG-context] structureuservariable in ToC

2018-01-14 Thread Henning Hraban Ramm
Now, my second issue with user variables:

"""
\define[1]\ChapterTocEntry{%
  
\doifnotempty{\structureuservariable{author}}{\structureuservariable{author}\crlf
 }%
  #1%
  
\doifnotempty{\structureuservariable{subtitle}}{\crlf\structureuservariable{subtitle}}}

\setuplist[chapter][textcommand=\ChapterTocEntry]

\starttext
\completelist[chapter][criterium=all]

\startchapter[
  title={The Use of Typefaces}][%
  author={Hermann Zapf},
  subtitle={Ein zapfiges Zitat}]

\input zapf

\stopchapter

\startchapter[
  title={Sheep and Goats}][%
  author={Siegfried Tufte},
  subtitle={Tofte Tufte-Zitat}]

\input tufte

\stopchapter

\stoptext
"""

I’m trying to get author and subtitle into the ToC (while in the content, 
subtitle goes to the margin and author to the end of the chapter).
But in this example, both are empty (but not empty enough for doifnotempty), 
while in my actual project I always get author and subtitle from the first 
chapter.
I guess this is an expansion problem?


Greetlings, Hraban
---
http://www.fiee.net
http://wiki.contextgarden.net
GPG Key ID 1C9B22FD

___
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] Labels and Enumerations

2018-01-14 Thread Rik Kabel

On 2018-01-14 09:46, Hans Hagen wrote:

On 1/13/2018 10:17 PM, Rik Kabel wrote:
I would like to request the restoration of labels (\definelabel) to 
full citizenship in MKIV. While enumerations are more flexible in 
many ways, they cannot replace one particular use of labels if find 
necessary. Enumerations are paragraph entities, while labels are not 
so restricted.


I use labels displayed as numbers in the margin to serially identify 
quotations in a book about the development of quotation and 
misquotation, at the same time generating reference information for 
cross-referencing. While most quotations are blocks and can be 
handled by enumerations, many are in-line quotations, and enumeration 
cannot be used for these.


The wiki describes enumerations as the MKIV replacement for labels, 
and the documentation as far as I can see omits \definelabel. Unless 
there is something else supported in MKIV that can assume this 
function of labels, can we please have full support for labels? I 
would not want to see labels deprecated before the functionality is 
reproduced.


(Of course, if you can suggest how enumeration can be adapted to this 
requirement, or suggest an alternative mechanism, this request can be 
rejected.)


two options:

\defineconstructionalternative
  [mylabel]
  [renderingsetup=constructionrenderings:mylabel,
   width=]

\startsetups[constructionrenderings:mylabel]
    \dontleavehmode
    \flushconstructionheadbox
\stopsetups

\defineenumeration[two][alternative=mylabel,display=no,before=,after=]

\definelabel[foo][way=bychapter,prefix=chapter]

\starttext

    \startchapter[title=bar]

    here \starttwo\stoptwo \input tufte

    here \foo[xx] \input tufte

    whatever \in{foo}[xx]

    \stopchapter

\stoptext


I played a bit more with enumerations and resolved one issue, I think. 
The forced paragraph break is a feature of the default before/after keys 
(both of which I need to null). Once this is done, enumerations can be 
used for in-line text as well, and when an explicit \par is added to 
\footnotes, the enumeration index appears there, unlike labels, where it 
does not appear.


Can you explain why the enumeration defined with constructionalternative 
rendering fails in footnotes, as shown in the following example? I 
suspect it has to do with my not understanding the use of 
\flushconstructionheadbox.


   \defineconstructionalternative
  [mylabel]
  [renderingsetup=constructionrenderings:mylabel,
   width=]

   \startsetups[constructionrenderings:mylabel]
    \inright{\dontleavehmode\flushconstructionheadbox}
   \stopsetups

   \defineenumeration[two][alternative=mylabel, % use mylabel rendering
    headcolor=darkgreen,
    text=,   % no name preceding
   label number
    display=no,  % suppresses line
   break with constructs
    before=, % no added text before
   label number
    after=]  % no added text after
   label number

   \defineenumeration[why][alternative=inright, % use inright rendering
    headcolor=blue,
    display=yes, % seems to be the default
    text=,   % no name preceding
   label number
    before=, % no added text before
   label number
    after=]  % no added text after
   label number

   \definelabel[foo][text=,headcolor=red,alternative=inright]

   \starttext

        \startchapter[title=bar]

    here \starttwo[reference=aa]\stoptwo \input ward
   \starttwo[reference=bb]\stoptwo \input ward

    here as well?\footnote{\starttwo[reference=cc]\stoptwo This
   fails.\par}

    whatever \in{two}[aa] and \in{two}[bb] and \in{two}[cc]

    \blank

    here \two[dd]\input ward \two[ee]\input ward

    here as well?\footnote{\two[ff]This fails.\par}

    whatever \in{two}[dd] and \in{two}[ee] and \in{two}[ff] and why
    is this section not three paragraph?

    \blank

    here \why[gg]\input ward \why[hh] \input ward

    here as well?\footnote{\why[ii]This works!\par}

    whatever \in{why}[gg] and \in{why}[hh] and \in{why}[ii]

    \blank

    here \foo[xx] \input ward \foo[yy] \input ward

    here as well?\footnote{\foo[zz]This fails.}

    whatever \in{foo}[xx] and \in{foo}[yy] and \in{foo}[zz]

    \stopchapter


   \stoptext

Could you explain the display key. The best I could determine from 
strc-con.mkvi is that if it is not 'no' in a construction, a \par is 
inserted, although I do not see why it is required in one case, and the 
other in my example above.


Could you also explain why \par is required in the footnotes when it 
does not seem to be needed in 

[NTG-context] uservariables in heads and lists

2018-01-14 Thread Henning Hraban Ramm
Hi, it’s been a while...

For a scientific magazine I need subtitles in the margin and authors as well as 
subtitles in my ToC. I didn’t yet try the latter, since I got stuck with the 
first.

Here’s my complete, not really working example:

"""
\usemodule[visual]
\setuplayout[
backspace=21mm,
topspace=12mm,
width=117mm,
height=270mm,
header=15mm,
headerdistance=2mm,
footer=3mm,
footerdistance=4mm,
rightmargindistance=5mm,
rightmargin=55mm,
leftmargin=0mm,
grid=yes,
location=doublesided
]

\define[2]\ChapterCmd{%
  {\bfa #2}
  {\inouter{\structureuservariable{subtitle}}}
}
\setuphead[chapter][
page=right,
command=\ChapterCmd,
]

\starttext
%\showlayout

\starttitle[title={Content}][subtitle={}]
%\placelist[chapter][criterium=all]
\stoptitle

\startchapter
  [title=My Title,][% is this necessary?
  subtitle=My Subtitle,
  author=Me and I]

\fakewords{100}{200}
\stopchapter

\stoptext
"""

Problems:
(1) The subtitle is not in the margin as defined by \setuplayout, but beside 
the chapter title.

(2) \starttitle throws 
...xmf/tex/texmf-context/tex/context/base/mkiv/node-nut.lua:823: table index is 
nil
stack traceback:
...xmf/tex/texmf-context/tex/context/base/mkiv/node-nut.lua:823: in 
function 'setprop'
...xmf/tex/texmf-context/tex/context/base/mkiv/typo-mar.lua:207: in 
function <...xmf/tex/texmf-context/tex/context/base/mkiv/typo-mar.lua:204>

What does that mean?

Greetlings, Hraban
---
http://www.fiee.net
http://wiki.contextgarden.net
GPG Key ID 1C9B22FD

___
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] Labels and Enumerations

2018-01-14 Thread Hans Hagen

On 1/13/2018 10:17 PM, Rik Kabel wrote:
I would like to request the restoration of labels (\definelabel) to full 
citizenship in MKIV. While enumerations are more flexible in many ways, 
they cannot replace one particular use of labels if find necessary. 
Enumerations are paragraph entities, while labels are not so restricted.


I use labels displayed as numbers in the margin to serially identify 
quotations in a book about the development of quotation and 
misquotation, at the same time generating reference information for 
cross-referencing. While most quotations are blocks and can be handled 
by enumerations, many are in-line quotations, and enumeration cannot be 
used for these.


The wiki describes enumerations as the MKIV replacement for labels, and 
the documentation as far as I can see omits \definelabel. Unless there 
is something else supported in MKIV that can assume this function of 
labels, can we please have full support for labels? I would not want to 
see labels deprecated before the functionality is reproduced.


(Of course, if you can suggest how enumeration can be adapted to this 
requirement, or suggest an alternative mechanism, this request can be 
rejected.)


two options:

\defineconstructionalternative
  [mylabel]
  [renderingsetup=constructionrenderings:mylabel,
   width=]

\startsetups[constructionrenderings:mylabel]
\dontleavehmode
\flushconstructionheadbox
\stopsetups

\defineenumeration[two][alternative=mylabel,display=no,before=,after=]

\definelabel[foo][way=bychapter,prefix=chapter]

\starttext

\startchapter[title=bar]

here \starttwo\stoptwo \input tufte

here \foo[xx] \input tufte

whatever \in{foo}[xx]

\stopchapter

\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] Problem with string.format (Lua)

2018-01-14 Thread Hans Hagen

On 1/14/2018 1:13 PM, Joseph Canedo wrote:

Hi Fabrice,

string.format behaves more or less as C printf. You probably need to 
specify %.4g in 1st argument.


Hope this helps

Best

Joseph

*De : *Fabrice Couvreur 
*Envoyé le :*dimanche 14 janvier 2018 13:05
*À : *mailing list for ConTeXt users 
*Objet :*[NTG-context] Problem with string.format (Lua)

Hello,
I start with Lua and I try to display my result with 4 decimal places 
without success.

Thank you
Fabrice

\startluacode
function Binomial(n,k,p)
     if k > n then return nil end
     if k > n/2 then k = n - k end

     numer, denom = 1, 1
     for i = 1, k do
     numer = numer * ( n - i + 1 )
     denom = denom * i
     end
     return (numer/denom) * p^k * (1-p)^(n-k)
end

\stopluacode

\starttext
\ctxlua{print(string.format("%g",Binomial(100,60,0.25)))}
\stoptext


the % should be \letterpercent

btw, use locals for numer and denom

you can also do this:

\startluacode
function document.Binomial(n,k,p)
if k > n then
return nil
end
if k > n/2 then
k = n - k
end
local numer, denom = 1, 1
for i=1,k do
numer = numer * ( n - i + 1 )
denom = denom * i
end
context("%0.5g",(numer/denom) * p^k * (1-p)^(n-k))
end
\stopluacode

\starttext
\ctxlua{document.Binomial(100,60,0.25)}
\stoptext

in general

context("format",)

is a bit more powerful than using format




--

-
  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] Firstline problem with smallcaps

2018-01-14 Thread Hans Hagen

On 1/12/2018 10:47 PM, Rik Kabel wrote:
When \setfirstline is used to set the first line of a paragraph in a 
small-cap style, the line is mis-set. This does not occur with every 
font and input, but occurs with most fonts and many inputs. The problem 
does not seem to be awakened by other styles (emboldened, italicized).


\definefirstline[SC][alternative=line,style=\setfontfeature{smallcaps}]%
or =\sc
\definefirstline[BD][alternative=line,style=bold]
\definefirstline[IT][alternative=line,style=italic]
\setupbodyfont[termes,11pt]% requires font with small caps
\starttext
   \setfirstline[SC]
   \startparagraph
     \input montgomery
   \stopparagraph
   \setfirstline[BD]
   \startparagraph
     \input montgomery
   \stopparagraph
   \setfirstline[IT]
   \startparagraph
     \input montgomery
   \stopparagraph
\stoptext


fixed in next beta


-
  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] Problem with string.format (Lua)

2018-01-14 Thread Joseph Canedo
Hi Fabrice,

string.format behaves more or less as C printf. You probably need to specify 
%.4g in 1st argument.
Hope this helps

Best
Joseph

De : Fabrice Couvreur
Envoyé le :dimanche 14 janvier 2018 13:05
À : mailing list for ConTeXt users
Objet :[NTG-context] Problem with string.format (Lua)

Hello,
I start with Lua and I try to display my result with 4 decimal places without 
success.
Thank you
Fabrice

\startluacode
function Binomial(n,k,p)
    if k > n then return nil end
    if k > n/2 then k = n - k end 
 
    numer, denom = 1, 1
    for i = 1, k do
    numer = numer * ( n - i + 1 )
    denom = denom * i
    end
    return (numer/denom) * p^k * (1-p)^(n-k)
end

\stopluacode

\starttext
\ctxlua{print(string.format("%g",Binomial(100,60,0.25)))}
\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
___

[NTG-context] Problem with string.format (Lua)

2018-01-14 Thread Fabrice Couvreur
Hello,
I start with Lua and I try to display my result with 4 decimal places
without success.
Thank you
Fabrice

\startluacode
function Binomial(n,k,p)
if k > n then return nil end
if k > n/2 then k = n - k end

numer, denom = 1, 1
for i = 1, k do
numer = numer * ( n - i + 1 )
denom = denom * i
end
return (numer/denom) * p^k * (1-p)^(n-k)
end

\stopluacode

\starttext
\ctxlua{print(string.format("%g",Binomial(100,60,0.25)))}
\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
___

Re: [NTG-context] Command line tool for macro definitions

2018-01-14 Thread Hans Hagen

On 1/14/2018 1:56 AM, Henri wrote:

Dear list,

For TeX/LaTeX users there is the neat command line tool `texdef` with
which you can show the definition of a macro.  Here an example:

$ texdef -t latex section

\section:
\long macro:->\@startsection {section}{1}{\z@ }{-3.5ex \@plus -1ex
\@minus -.2ex}{2.3ex \@plus .2ex}{\normalfont \Large \bfseries }

Is there something similar for ConTeXt?  It is quite tedious to either
grep the full source or setup an extra dummy document to use \show or
\meaning.

i must admit that i never use \show for that ... anyhow, i'll provide

context --extra=meaning --once --pattern=*paper*
context --extra=meaning --once setuplayout
context --extra=meaning --once setup_layout

in the next beta

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
___