Re: [NTG-context] removing # in XML identifiers

2015-05-07 Thread Pablo Rodriguez
On 05/07/2015 11:44 PM, Hans Hagen wrote:
> [...]
> \startxmlsetups xml:a
>  \cldcontext{string.sub([[\xmlatt{#1}{href}]],2)}
>  % next beta (more efficient):
>  % \xmlrefatt{#1}{href}
> \stopxmlsetups

Many thanks for your reply and the improvement, Hans.


Pablo
-- 
http://www.ousia.tk
___
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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

Re: [NTG-context] removing # in XML identifiers

2015-05-07 Thread Hans Hagen

On 5/6/2015 9:38 PM, Pablo Rodriguez wrote:

Dear list,

I have the following sample:

 \startbuffer[demo]
 the previous section
 \stopbuffer

 \startxmlsetups xml:initialize
  \xmlsetsetup{#1}{a}{xml:*}
 \stopxmlsetups

 \xmlregistersetup{xml:initialize}

 \startxmlsetups xml:a
 \ctxlua{context("\\xmlatt{#1}{href}")}
 \ctxlua{local originalid = "abcde";% doesn’t work with #
 tex.print(string.sub(originalid,2))}
 \stopxmlsetups

 \starttext
  \xmlprocessbuffer{main}{demo}{}
 \stoptext

In both for some reason unknown to me, compilation crashes whe
string.sub has an string with # inside.

How could I get the following command working?

 \ctxlua{tex.print(string.sub(context("\\xmlatt{#1}{href}"),2))}

Even if I remove # from the href attribute, compilation crashes.

Sorry for asking this again, but which is the right way to do this?

I have spent hours trying to find out how to do it, but I’m afraid this
is beyond my knowledge.


\startbuffer[demo]
the previous section
\stopbuffer

\startxmlsetups xml:initialize
 \xmlsetsetup{#1}{a}{xml:*}
\stopxmlsetups

\xmlregistersetup{xml:initialize}

\startxmlsetups xml:a
\cldcontext{string.sub([[\xmlatt{#1}{href}]],2)}
% next beta (more efficient):
% \xmlrefatt{#1}{href}
\stopxmlsetups

\starttext
 \xmlprocessbuffer{main}{demo}{}
\stoptext


-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
 | 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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

Re: [NTG-context] Bibliography: printing just Single Author et al.

2015-05-07 Thread Robert Blackstone

On 7 May 2015, at 12:00 , Mojca Miklavec 
> 
> Is there any trick that would allow liming the number of listed
> authors on per-article basis? Simply specifying
>author = "Just Someone et al.",
> ?
> 
> (MkIV, experimental reimplementation.)

Hello Mojca,
The trick that I would use, in fact the procedure that I always use, is not to 
use bib-files but to separately generate the bbl-file and input that.
ConTeXt uses the .bbl, and once you have that you can tweak it in (almost) any 
way you like. You could if necessary, make two or more versions of the same 
publication, for instance in a footnote “Just Someone et al.” and in the 
Bibliography the complete list of Authors of that publication.
For my Bibliographic data I even needed three versions of each entry, one with 
authorname, to use your example, “Someone, Just” in the Bibliography, “Just 
Someone” for footnotes, the first occurrence, and “Someone” with a short book- 
or article title for all susequent occurrences.
No problem when you use the .bbl. Obviously the different versions should have 
(slightly) diiferent cite-keys.
(And take care not to input the .bib-file, since each time you process the 
thing a fresh .bbl is created wiping out all your modifications.)

I hope it solves your problem.

Best regards,

Robert Blackstone

___
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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

Re: [NTG-context] Math steps (s-pre-50)

2015-05-07 Thread Troy Henderson
use s-pre-60 instead as in:

>
> \usemodule[s-pre-61]
>

This works but seems to be a JavaScript solution which does not work in
Evince.  Is there a way to have it produce separate "frames" (i.e.,
"pages") for each step?

Troy
___
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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

Re: [NTG-context] removing # in XML identifiers

2015-05-07 Thread Pablo Rodriguez
On 05/06/2015 10:49 PM, Thomas A. Schmitz wrote:
> On 05/06/2015 09:38 PM, Pablo Rodriguez wrote:
>> How could I get the following command working?
>>
>>  \ctxlua{tex.print(string.sub(context("\\xmlatt{#1}{href}"),2))}
> 
> I'm not sure that this will ever work - you're mixing and nesting lua 
> and tex code in a messy way. My suggestion would be: if you need to 
> process your xml code with lua, then process things in lua and separate 
> the lua part from your tex code. Write a function xml.functions.a which 
> does the substring split and the printing to context. I have written a 
> page on the wiki http://wiki.contextgarden.net/XML_Lua which may be useful.

Many thanks for your reply, Thomas.

I have tried the following:

\startxmlsetups xml:a
\startluacode
function xml.functions.removehash(str)
   tex.print(string.sub(str,2))
end
\stopluacode
\unexpanded\def\removehash#1%
{\ctxlua{xml.functions.removehash("#1")}}
\startasciimode\removehash{\xmlatt{#1}{href}}\stopasciimode
\stopxmlsetups

But for some reason unknown to me, it doesn’t work. It works on a
standard file, but now there.

What am I missing?

Many thanks for your help,


Pablo
-- 
http://www.ousia.tk
___
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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

Re: [NTG-context] Bibliography: printing just Single Author et al.

2015-05-07 Thread Mojca Miklavec
On Thu, May 7, 2015 at 4:13 PM, Csikos Bela wrote:
> Mojca Miklavec írta:
>>
>>No, configuration of bibliographies in ConTeXt does not (and should
>>not) require knowledge of bst files. I always managed to get around
>>with some relatively straightforward settings and commands.
>
> If you want to remove dots after the initials or remove the space between 
> initials you have to. If you want to modify what is inserted into the bbl 
> file you have to.

ConTeXt has at least three different mechanisms to deal with
bibliographies by now (one is actually using BibTeX, one is using pure
ConTeXt setups for new entries, the third one is new/unstable and
allows entries in "arbitrary" format). From what I understand at least
the last two approaches circumvent BibTeX completely, so bst files are
not used at all.

I admit that I never tried to change spacing or remove the dots after
initials, but I would be surprised if doing that would require
fiddling with bst. I always controlled how a specific entry is
represented (when I wanted modifications) by a relatively readable
ConTeXt setup, but others should comment about specifics.

Mojca
___
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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

Re: [NTG-context] Bibliography: printing just Single Author et al.

2015-05-07 Thread Csikos Bela
Mojca Miklavec írta:
>On Thu, May 7, 2015 at 2:29 PM, Csikos Bela wrote:
>> Mojca Miklavec írta:
>>>Hi,
>>>
>>>When citing articles with five authors I prefer to list all of them,
>>>but in some articles with one hundred authors I would prefer just "J.
>>>Someone et al." since listing five more co-authors doesn't add
>>>anything substantial to the information.
>>>
>>>Is there any trick that would allow liming the number of listed
>>>authors on per-article basis? Simply specifying
>>>author = "Just Someone et al.",
>>
>> It's not clear what you want exactly. That is, how many rules do you want 
>> regarding
>> number of authors?
>>
>> I don't know how ConTeXt handes author numbers. But in normal bibtex this is 
>> generally
>> implemented as max authors and min authors (naturally it depends on the bst 
>> file you use).
>> If the total number of authors is less than or equal to max authors, all 
>> author names are listed.
>> If total number of authors is more than max authors, min authors are listed 
>> followed by et al.
>> By adjusting the bst file you can change every single details.
>>
>> An example: if you set max number to 7 and min number to 3, then in case of 
>> 7 or less
>> authors all are listed, in case of 8 or more the first 3 are listed followed 
>> by et al.
>>
>> Would these two rules fit your requirements? Or do you want a third rule (in 
>> additon to the
>> above rules) for very high number of authors, when only the very first 
>> author is listed?
>
>Oh, interesting. I wasn't aware of that rule. I thought that in case
>of "more than n" authors, the first n would be printed.
>
>I was thinking of a rule "if I specify something special on this
>particular entry, then print one author et al." (without me having to
>bother to actually try to include all the hundred names if I know in
>advance that none of them would be printed anyway), but a rule like
>"if more than N, then print just one" would most probably work for me.
>
>How does one set that lower number?

See my other answer too.
You set authoretallimit=6 % Up to six authors all author are listed
You might need to set artauthoretallimit=6 too.
You set authoretaldisplay=1 % if there are more tnan 6 authors only one is 
listed
You might need to set artauthoretaldisplay=1.

>> In this case you have to edit the bst file as well. What makes it harder 
>> ConTeXt has special bst files and you have to edit those bst files.
>>
>> If you have only a few article like this, the easiest solution might be to 
>> edit the bib file, and change the author field to what you want in the 
>> output.
>>
>> This is a real shortcoming of ConTeXt bibliography generating mechanism. To 
>> customize
>> it you have to be able to edit bst files and be very familiar with ConTeXt 
>> bibliography
>> generating module, and TeX programming might be required too.
>
>No, configuration of bibliographies in ConTeXt does not (and should
>not) require knowledge of bst files. I always managed to get around
>with some relatively straightforward settings and commands.

If you want to remove dots after the initials or remove the space between 
initials you have to. If you want to modify what is inserted into the bbl file 
you have to.

bcsikos
___
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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

Re: [NTG-context] Bibliography: printing just Single Author et al.

2015-05-07 Thread Mojca Miklavec
On Thu, May 7, 2015 at 2:29 PM, Csikos Bela wrote:
> Mojca Miklavec írta:
>>Hi,
>>
>>When citing articles with five authors I prefer to list all of them,
>>but in some articles with one hundred authors I would prefer just "J.
>>Someone et al." since listing five more co-authors doesn't add
>>anything substantial to the information.
>>
>>Is there any trick that would allow liming the number of listed
>>authors on per-article basis? Simply specifying
>>author = "Just Someone et al.",
>
> It's not clear what you want exactly. That is, how many rules do you want 
> regarding
> number of authors?
>
> I don't know how ConTeXt handes author numbers. But in normal bibtex this is 
> generally
> implemented as max authors and min authors (naturally it depends on the bst 
> file you use).
> If the total number of authors is less than or equal to max authors, all 
> author names are listed.
> If total number of authors is more than max authors, min authors are listed 
> followed by et al.
> By adjusting the bst file you can change every single details.
>
> An example: if you set max number to 7 and min number to 3, then in case of 7 
> or less
> authors all are listed, in case of 8 or more the first 3 are listed followed 
> by et al.
>
> Would these two rules fit your requirements? Or do you want a third rule (in 
> additon to the
> above rules) for very high number of authors, when only the very first author 
> is listed?

Oh, interesting. I wasn't aware of that rule. I thought that in case
of "more than n" authors, the first n would be printed.

I was thinking of a rule "if I specify something special on this
particular entry, then print one author et al." (without me having to
bother to actually try to include all the hundred names if I know in
advance that none of them would be printed anyway), but a rule like
"if more than N, then print just one" would most probably work for me.

How does one set that lower number?

> In this case you have to edit the bst file as well. What makes it harder 
> ConTeXt has special bst files and you have to edit those bst files.
>
> If you have only a few article like this, the easiest solution might be to 
> edit the bib file, and change the author field to what you want in the output.
>
> This is a real shortcoming of ConTeXt bibliography generating mechanism. To 
> customize
> it you have to be able to edit bst files and be very familiar with ConTeXt 
> bibliography
> generating module, and TeX programming might be required too.

No, configuration of bibliographies in ConTeXt does not (and should
not) require knowledge of bst files. I always managed to get around
with some relatively straightforward settings and commands.

Mojca
___
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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

Re: [NTG-context] Bibliography: printing just Single Author et al.

2015-05-07 Thread Csikos Bela
Mojca Miklavec írta:
>Hi,
>
>When citing articles with five authors I prefer to list all of them,
>but in some articles with one hundred authors I would prefer just "J.
>Someone et al." since listing five more co-authors doesn't add
>anything substantial to the information.
>
>Is there any trick that would allow liming the number of listed
>authors on per-article basis? Simply specifying
>author = "Just Someone et al.",
>?
>
>(MkIV, experimental reimplementation.)

I checked the bibmod-doc manual. According to it the author numbers can be set 
by
authoretallimit, editoretallimit, artauthoretallimit, authoretaldisplay, 
editoretaldisplay,
artauthoretaldisplay. Don't they work for you? It works for me if I change them 
in
the corresponding bibl-style.tex file. In the document alternative=style as:

\setuppublications[alternative=style]

bcsikos


___
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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

Re: [NTG-context] Bibliography: printing just Single Author et al.

2015-05-07 Thread Csikos Bela
Mojca Miklavec írta:
>Hi,
>
>When citing articles with five authors I prefer to list all of them,
>but in some articles with one hundred authors I would prefer just "J.
>Someone et al." since listing five more co-authors doesn't add
>anything substantial to the information.
>
>Is there any trick that would allow liming the number of listed
>authors on per-article basis? Simply specifying
>author = "Just Someone et al.",

It's not clear what you want exactly. That is, how many rules do you want 
regarding
number of authors?

I don't know how ConTeXt handes author numbers. But in normal bibtex this is 
generally
implemented as max authors and min authors (naturally it depends on the bst 
file you use).
If the total number of authors is less than or equal to max authors, all author 
names are listed.
If total number of authors is more than max authors, min authors are listed 
followed by et al.
By adjusting the bst file you can change every single details.

An example: if you set max number to 7 and min number to 3, then in case of 7 
or less
authors all are listed, in case of 8 or more the first 3 are listed followed by 
et al.

Would these two rules fit your requirements? Or do you want a third rule (in 
additon to the
above rules) for very high number of authors, when only the very first author 
is listed?

In this case you have to edit the bst file as well. What makes it harder 
ConTeXt has special bst files and you have to edit those bst files.

If you have only a few article like this, the easiest solution might be to edit 
the bib file, and change the author field to what you want in the output.

This is a real shortcoming of ConTeXt bibliography generating mechanism. To 
customize
it you have to be able to edit bst files and be very familiar with ConTeXt 
bibliography
generating module, and TeX programming might be required too.

>(MkIV, experimental reimplementation.)

I dont't know about this, what I wrote above applies to normal MkIV (and I 
guess to MkII
too). I have no idea if this experimental reimplementation uses other 
bibliographics
mechanism.

bcsikos
___
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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

Re: [NTG-context] Math steps (s-pre-50)

2015-05-07 Thread Hans Hagen

On 5/6/2015 8:14 PM, Troy Henderson wrote:

\FlushStep does not seem to work when "revealing" steps in a
mathalignment.  Is there a known solution for showing rows of a
mathalignment in their own "frame"?  Here is the code that I am using:

\usemodule[s-pre-50]
\starttext
 \StartSteps
 \startformula
 \startmathalignment[n=3,align={right,middle,left}]
 \NC a \NC = \NC b + c \NR \FlushStep
 \NC \NC = \NC b - d + d + c \NR \FlushStep
 \stopmathalignment
 \stopformula
 \StopSteps
\stoptext


use s-pre-60 instead as in:

\usemodule[s-pre-61]
\setupbodyfont[dejavu]

\starttext
\TitlePage{Stepwise\\Refinement}

\Topics{Topics}

\Topic{Some Math}


\StartSteps
\startformula
\startmathalignment[n=3,align={right,middle,left}]
\NC a \NC = \NC b + c \NR \FlushStep
\NC \NC = \NC b - d + d + c \NR \FlushStep
\stopmathalignment
\stopformula
\StopSteps

\Topic{More Math}

\StartSteps
\startformula
\startmathalignment[n=3,align={right,middle,left}]
\NC a \NC = \NC b + c \NR \FlushStep
\NC \NC = \NC b - d + d + c \NR \FlushStep
\stopmathalignment
\stopformula
\StopSteps
\stoptext



-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
 | 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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

[NTG-context] Bibliography: printing just Single Author et al.

2015-05-07 Thread Mojca Miklavec
Hi,

When citing articles with five authors I prefer to list all of them,
but in some articles with one hundred authors I would prefer just "J.
Someone et al." since listing five more co-authors doesn't add
anything substantial to the information.

Is there any trick that would allow liming the number of listed
authors on per-article basis? Simply specifying
author = "Just Someone et al.",
?

(MkIV, experimental reimplementation.)

Thank you,
Mojca
___
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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___