Re: [NTG-context] Bug? numberstopper in references

2018-01-16 Thread Otared Kavian
Oh I sent my previous message too quickly… 
I was just using the \at command for referring to captions, while you want to 
use the \in command: maybe this is the problem.

> On 16 Jan 2018, at 22:25, bbvo...@home.nl wrote:
> 
> Dear list,
> 
> When I use the numberstopper option in setupcaptions it appears
> unexpectedly in the references. The wiki states otherwise.
> Wiki and a working example are listed below.
> 
> Kind regards,
> 
> Bernard
> 
> 
> wiki: http://wiki.contextgarden.net/Command/setupcaptions:
> 
> numberstopper MKIV only. The numberstopper text follows the number 
> and,
> if present, the suffix, and precedes the caption text. It does not
> appear in references.
> 
> 
> Working example:
> 
> \setupcaptions[table][numberstopper={:}]
> 
> \starttext
> 
> \placetable[here][tab:ships]{Ships that moored at Hasselt.}{
> \starttable[|c|c|]
> \HL
> \NC \bf Year \NC \bf Number of ships \NC\SR
> \HL
> \NC 1645 \NC 450 \NC\FR
> \NC 1671 \NC 480 \NC\MR
> \NC 1676 \NC 500 \NC\MR
> \NC 1695 \NC 930 \NC\LR
> \HL
> \stoptable
> }
> ...
> 
> See \in{Table}[tab:ships] on \at{page}[tab:ships]
> \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
___

Re: [NTG-context] Bug? numberstopper in references

2018-01-16 Thread Otared Kavian
Hi Bernard,

Transposing your table to an example given by Wolfgang Schuster some time ago I 
obtain the correct behavior, but I don’t know where the problem in your example 
comes from…

Please see whether the following gives what you want and comapre with the PDF I 
get here with ConTeXt  version 2018.01.14 15:55.

Best regards: OK

 begin caption-numberstopper-0.tex
\setupexternalfigure[location=default]

\setupcaptions[numberstopper={:}]
\starttext

Take a look at \at{picture}[fig:cow] below.

\startplacefigure[reference=fig:cow,title=A dutch cow]
 \externalfigure[cow]
\stopplacefigure

\placefigure[here][photo]{This is a cow}{\externalfigure[cow][width=2in]}

Take a look at \at{table}[tab:1] below.

\placetable[here][tab:1]{This is a table}{
\starttable[|c|c|]
\HL
\NC \bf Year \NC \bf Number of ships \NC\SR
\HL
\NC 1645 \NC 450 \NC\FR
\NC 1671 \NC 480 \NC\MR
\NC 1676 \NC 500 \NC\MR
\NC 1695 \NC 930 \NC\LR
\HL
\stoptable}

\stoptext
 end caption-numberstopper-0.tex



caption-numberstopper-0.pdf
Description: Adobe PDF document


> On 16 Jan 2018, at 22:25, bbvo...@home.nl wrote:
> 
> Dear list,
> 
> When I use the numberstopper option in setupcaptions it appears
> unexpectedly in the references. The wiki states otherwise.
> Wiki and a working example are listed below.
> 
> Kind regards,
> 
> Bernard
> 
> 
> wiki: http://wiki.contextgarden.net/Command/setupcaptions:
> 
> numberstopper MKIV only. The numberstopper text follows the number 
> and,
> if present, the suffix, and precedes the caption text. It does not
> appear in references.
> 
> 
> Working example:
> 
> \setupcaptions[table][numberstopper={:}]
> 
> \starttext
> 
> \placetable[here][tab:ships]{Ships that moored at Hasselt.}{
> \starttable[|c|c|]
> \HL
> \NC \bf Year \NC \bf Number of ships \NC\SR
> \HL
> \NC 1645 \NC 450 \NC\FR
> \NC 1671 \NC 480 \NC\MR
> \NC 1676 \NC 500 \NC\MR
> \NC 1695 \NC 930 \NC\LR
> \HL
> \stoptable
> }
> ...
> 
> See \in{Table}[tab:ships] on \at{page}[tab:ships]
> \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
___

[NTG-context] Bug? numberstopper in references

2018-01-16 Thread bbvogel
Dear list,

When I use the numberstopper option in setupcaptions it appears
unexpectedly in the references. The wiki states otherwise.
Wiki and a working example are listed below.

Kind regards,

Bernard


wiki: http://wiki.contextgarden.net/Command/setupcaptions:

numberstopper   MKIV only. The numberstopper text follows the number and,
if present, the suffix, and precedes the caption text. It does not
appear in references.


Working example:

\setupcaptions[table][numberstopper={:}]

\starttext

\placetable[here][tab:ships]{Ships that moored at Hasselt.}{
\starttable[|c|c|]
\HL
\NC \bf Year \NC \bf Number of ships \NC\SR
\HL
\NC 1645 \NC 450 \NC\FR
\NC 1671 \NC 480 \NC\MR
\NC 1676 \NC 500 \NC\MR
\NC 1695 \NC 930 \NC\LR
\HL
\stoptable
}
...

See \in{Table}[tab:ships] on \at{page}[tab:ships]
\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] Word and character count excluding TeX-directives

2018-01-16 Thread Rik Kabel

On 2018-01-16 09:26, Dr. Thomas Möbius wrote:

\definestartstop
    [abstract]
    [style=bold,
    after={\blank[big]}]

\starttext
\title{My title: example of a word and character count}

{\strut\tfx Formal guidelines: word count of abstract: $x$, character
count of main text: $x$, character count of figure captions: $x$.}
\blank

\startabstract
This is the abstract. Read this and that.
\stopabstract

% start of the main text
Some random text with formulas

\startformula
y = α + βx + ε, \quad ε \sim N(0,σ^2)
\stopformula

And there are also figures with captions.

\startplacefigure[
    location=bottom,
    title={Residual plot with time $t$ on the x-axis and
    residuals $e_{jt}$ on the y-axis},
    reference={fig:subject-residual}]
\externalfigure[residuals][height=.242\textheight]
\stopplacefigure

And some more text with $x$ and $y$ and $z$, and \placeformula

\startformula \startalign
\NC a =\NC b \NR
\NC c =\NC d \NR
\stopalign \stopformula

And stop.
\stoptext 


Try something based on this:

   \startluacode
    userdata = userdata or { }

    function userdata.wordcount(listname)
    filename = file.addsuffix(tex.jobname,"words")
    if lfs.isfile(filename) then
    local w = dofile(filename)
    if w then
    if type(w.categories[listname]) == "table" then
    context(w.categories[listname].total)
    else
    context(w.total)
    end
    context.par()
    end
    end
    end
   \stopluacode
   \def\wordcount{%
    \dosingleempty\dowordcount}
   \def\dowordcount[#1]{%
    \ctxlua{userdata.wordcount("#1")}}
   \setupspellchecking[state=start,method=2]
   \ctxlua{languages.words.threshold=1}

   \definestartstop
    [abstract]
    [style=bold,
    after={\blank[big]}]

   \starttext

    \setupspellchecking[list=abstract]

    \startabstract
    This is the abstract. Read this and that.
    \stopabstract

    \setupspellchecking[list=main]

    Some random text with formulas

    \startformula
    y = α + βx + ε, \quad ε \sim N(0,σ^2)
    \stopformula

    And there are also figures with captions.

    \setupspellchecking[list=figures]

    \startplacefigure[
  location=bottom,
  title={Residual plot with time $t$ on the x-axis and
  residuals $e_{jt}$ on the y-axis},
  reference={fig:subject-residual}]
  \externalfigure[residuals][height=.242\textheight]
    \stopplacefigure

    \setupspellchecking[list=main]

    And some more text with $x$ and $y$ and $z$, and \placeformula

    \startformula \startalign
    \NC a =\NC b \NR
    \NC c =\NC d \NR
    \stopalign \stopformula

    And stop.

    \setupspellchecking[state=stop]

   \title{My title: example of a word and character count}

    Abstract: \wordcount[abstract]
    Main: \wordcount[main]
    Figures: \wordcount[figures]
    Wordcount: \wordcount

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

[NTG-context] Word and character count excluding TeX-directives

2018-01-16 Thread Dr . Thomas Möbius
To meet some formal guidelines, I need to provide a word count of my 
abstract and a character count of the main text, and a character count 
of all the text appearing in figure captions.


Is this possible (maybe using some lua-magic)?

Thank you!
Thomas


Minimal example:

\definestartstop
[abstract]
[style=bold,
after={\blank[big]}]

\starttext
\title{My title: example of a word and character count}

{\strut\tfx Formal guidelines: word count of abstract: $x$, character
count of main text: $x$, character count of figure captions: $x$.}
\blank

\startabstract
This is the abstract. Read this and that.
\stopabstract

% start of the main text
Some random text with formulas

\startformula
y = α + βx + ε, \quad ε \sim N(0,σ^2)
\stopformula

And there are also figures with captions.

\startplacefigure[
location=bottom,
title={Residual plot with time $t$ on the x-axis and
residuals $e_{jt}$ on the y-axis},
reference={fig:subject-residual}]
\externalfigure[residuals][height=.242\textheight]
\stopplacefigure

And some more text with $x$ and $y$ and $z$, and \placeformula

\startformula \startalign
\NC a =\NC b \NR
\NC c =\NC d \NR
\stopalign \stopformula

And stop.
\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] Labels and Enumerations

2018-01-16 Thread Hans Hagen

On 1/15/2018 10:15 PM, Rik Kabel wrote:

Hans,

Even with the local scope, I cannot get multiple enumerations in a 
paragraph at the same time as I get inright labels in footnotes. The 
footnote enumerations appear only with display=yes, but that causes 
paragraph breaks after each enumeration. The default alignment works, 
but I need marginal indices.


Labels seem to me a bit more flexible here since they do not require 
paragraph semantics for termination. I am not looking for a taggable 
mark, simply a visible reference index to which reference can be applied.


So, with enumerations providing no benefit and introducing additional 
problems, is it unreasonable to request that labels be officially 
supported in MKIV and not marked as MKII relicts?
Well, they are supported and i don't see them go away (hardly any code 
involved). There are many thingies that make more sense in mkii than in 
mkiv that stay(ed).


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
___