[NTG-context] learning about the grid

2023-11-19 Thread Miguel Diaz
Hi everyone,
being a newbie I just discovered how different setups for the grid may
affect my (very simple) document.
In the Details manual (which of course I don't understand because of my
unexperience) I read that many people don't use the grid, but when I
configure grid=no the whole lines of a section are printed one over the
other.
Playing with the options and setupinterlinespace I got the unhappily
desired 1.3ex that may school requieres for the teaching programs
(grid=line, interlinespace=1.3ex), but I somehow feel that's not the right
way to go.

1. Why are the lines printed one over the other when grid=no? how do profis
then use context without grid?

2. Is there a document where I can read how the grid is conceived to work
for the many options in a simple way?

thanks in advance
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


Re: [NTG-context] Learning how to use \setupbtxrendering

2018-02-20 Thread Hans Hagen

On 2/20/2018 5:08 PM, Otared Kavian wrote:

Hi Thomas,

Many thanks for your insight. Indeed as Alan and you explain, it is 
straightforward to define one's own specification.
I have not done that yet, but already I could change some of the renderings by 
modifying a few of the definitions in the file publ-imp-default.mkvi in my test 
file. I guess when my file say named, as you put it, publ-imp-otared.mkvi, is 
finished, I have to put it in my personal directory
texmf/tex/context


in

texmf-local/tex/context/user

or

texmf-project/tex/context/user

-
  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] Learning how to use \setupbtxrendering

2018-02-20 Thread Otared Kavian
Hi Thomas,

Many thanks for your insight. Indeed as Alan and you explain, it is 
straightforward to define one's own specification.
I have not done that yet, but already I could change some of the renderings by 
modifying a few of the definitions in the file publ-imp-default.mkvi in my test 
file. I guess when my file say named, as you put it, publ-imp-otared.mkvi, is 
finished, I have to put it in my personal directory 
texmf/tex/context
where ConTeXt would find it.

Regarding my question about extracting a file with the used references, Alan 
explained it to me: it is enough to say
\savebtxdataset[usedreferences.bib]
and then ConTeXt creates the file usedreferences.bib. Including the content of 
that file in the source of the main document into a buffer, then allows me to 
have a single file with the references in it. So this also has been solved by 
Alan and Hans and is waiting there!

Regarding the setups for cite, I did not see where I should put the modified 
block
\startsetups btx:cite:XXX

\stopsetups
As of now it doesn't seem necessary to modify anything for \cite: maybe this 
can be done later on if necessary.

Best regards: OK




> On 20 Feb 2018, at 10:52, Thomas A. Schmitz  
> wrote:
> 
> Hi Otared,
> 
> 
>> 
>> So my first question is: how can one define one's own « specification », 
>> when modifying built-in specifications is not satisfactory for one's needs, 
>> or does not give the expected result? 
> 
> I work with lots of bibliographies and want my very own styles, and I have 
> indeed found that it is easier to define my own styles rather than modify the 
> existing ones. So what you want to do:
> 
> 1. you define your own style, let’s call it otared. So in your main tex file, 
> you would have this line:
> 
> \usebtxdefinitions [otared]
> 
> This means you have to create two files, one for the lua definitions, one for 
> tex. 
> 
> 2. For the lua file, just take publ-imp-apa.lua and cpy it as 
> publ-imp-otared.lua. Chances are you won’t have to make any changes right 
> away. The content is pretty straightforward lua code.
> 
> 3. The tex file publ-imp-otared.mkvi will then contain your definitions in a 
> block 
> 
> \startbtxrenderingdefinitions[otared]
> 
> ...
> 
> \stopbtxrenderingdefinitions
> 
> You define two different sets of definitions: one for the citations in the 
> text (in the form \startsetups btx:cite:XXX), one for the list of references 
> (in the form \startsetups btx:list:XXX). Here you can make all the formatting 
> you want: article name in red, author name for articles in small caps, 
> journal name in 3D, whatever. Again, just look at publ-imp-apa.mkvi and try 
> to understand how it works; it’s not that difficult.
> 
>> The second question is: how can one write a file containing only the 
>> references which are used in a document, so that that file can be in some 
>> way included into the main document (this is somewhat analogous to the .bbl 
>> file created by BibTeX, which allows to include a series of \bibitem into an 
>> article written with LaTeX: this is necessary to do when one submits a paper 
>> to a mathematical journal).
>> 
>> Thanks again for your help: OK
> 
> The list of references is included in the .tuc file that a context run 
> produces. If you need to massage it into any other form, 5 minutes of lua 
> coding can extract the salient information for you.
> 
> HTH
> 
> Thomas
> ___
> 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] Learning how to use \setupbtxrendering

2018-02-20 Thread Thomas A. Schmitz
Hi Otared,


> 
> So my first question is: how can one define one's own « specification », when 
> modifying built-in specifications is not satisfactory for one's needs, or 
> does not give the expected result? 

I work with lots of bibliographies and want my very own styles, and I have 
indeed found that it is easier to define my own styles rather than modify the 
existing ones. So what you want to do:

1. you define your own style, let’s call it otared. So in your main tex file, 
you would have this line:

\usebtxdefinitions [otared]

This means you have to create two files, one for the lua definitions, one for 
tex. 

2. For the lua file, just take publ-imp-apa.lua and cpy it as 
publ-imp-otared.lua. Chances are you won’t have to make any changes right away. 
The content is pretty straightforward lua code.

3. The tex file publ-imp-otared.mkvi will then contain your definitions in a 
block 

\startbtxrenderingdefinitions[otared]

...

\stopbtxrenderingdefinitions

You define two different sets of definitions: one for the citations in the text 
(in the form \startsetups btx:cite:XXX), one for the list of references (in the 
form \startsetups btx:list:XXX). Here you can make all the formatting you want: 
article name in red, author name for articles in small caps, journal name in 
3D, whatever. Again, just look at publ-imp-apa.mkvi and try to understand how 
it works; it’s not that difficult.

> The second question is: how can one write a file containing only the 
> references which are used in a document, so that that file can be in some way 
> included into the main document (this is somewhat analogous to the .bbl file 
> created by BibTeX, which allows to include a series of \bibitem into an 
> article written with LaTeX: this is necessary to do when one submits a paper 
> to a mathematical journal).
> 
> Thanks again for your help: OK

The list of references is included in the .tuc file that a context run 
produces. If you need to massage it into any other form, 5 minutes of lua 
coding can extract the salient information for you.

HTH

Thomas
___
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] Learning how to use \setupbtxrendering

2018-02-19 Thread Otared Kavian
Hi Alan, and all the Gurus on the list,

Many thanks for your help and comments. I am sending again this message which, 
by mistake, was sent only to Alan, in order to get some help.

The manual mkiv-publications.pdf contains indeed many explanations, but 
probably the informations there are too vast for the elementary use I am going 
to need. So many thanks to Alan and Hans for this extensive manual!

Now, this being said, I am neither able, nor do I need, to use the full blown 
power of this environment. In particular I am not familiar with the style apa 
(or aps, which seems to exist too…) or other official specifications. That is 
why I would like to learn by examples, beginning with the one included on page 
4 of the above mentioned manual and then modify things to see what can be done…
However, when I use the modifications which Alan suggested (for the style apa, 
but I dropped the apa: prefix…) I do not get what is desired (please see below 
the code and the attached test.bib file). And if I give explicitely the 
specification apa, then many other things are not satisfactory for my needs…

For now, what I get without changing many things in the first example given in 
the manual, is quite close to what I would like to obtain, except that the 
title of articles is in roman and the name of the journal is in italic, and the 
title of books are in italic (and the modifications suggest by Alan do not 
change this, at least when I am not using apa).

So my first question is: how can one define one's own « specification », when 
modifying built-in specifications is not satisfactory for one's needs, or does 
not give the expected result? 

The second question is: how can one write a file containing only the references 
which are used in a document, so that that file can be in some way included 
into the main document (this is somewhat analogous to the .bbl file created by 
BibTeX, which allows to include a series of \bibitem into an article written 
with LaTeX: this is necessary to do when one submits a paper to a mathematical 
journal).

Thanks again for your help: OK

%% begin test-bibliography.tex
\setupinteraction[state=start]

\usebtxdataset[test.bib]

%% these four setupbtx suggested by Alan have no effects
\setupbtx[list:volume][style={bold}]
\setupbtx[list:title] [style={\it}]
%(the default for apa)
\setupbtx [list:title:book] [style={\ss\it}]
\setupbtx[list:volume][,style=bold]
%(apa default is italic)

%% this has the correct effect...
\setupbtx[
interaction=start,
specification=default,
left={[},
right={]},
]

\starttext
\startbodymatter

See the book by K. Yosida \cite[YosidaK]
and the article by I. Ekeland \cite{EkelandILemme}.

\stopbodymatter

\startbackmatter 

\startchapter[title=Bibliography]

\placelistofpublications
[method=dataset,
sorttype=authoryear,
numbering=yes,
]
\stopchapter

\stopbackmatter

\stoptext
%% end test-bibliography.tex

%% begin content of the file text.bib

@article{FabesEBStrook,
Author = {E.B. Fabes and D.W. Strook},
Journal = {Archives for Rational Mechanics and Analysis},
Pages = {327--338},
Title = {A new proof of Moser's parabolic Harnack inequality via the 
old ideas of Nash},
Volume = {96},
Year = {1986}
}

@book{EvansLC,
Address = {Providence, RI},
Author = {Lawrence C. Evans},
Publisher = {American Mathematical Society},
Series = {Conference Board of the Mathematical Sciences Regional 
Conference Series in Mathematics},
Title = {Weak convergence methods for nonlinear partial differential 
equations},
Volume = {74},
Year = {1990}
}

@book{EkelandITemam,
Address = {Paris},
Author = {Ivar Ekeland and Roger Temam},
Publisher = {Dunod-Gauthiers-Villars},
Title = {Analyse Convexe et Problèmes Variationnels},
Year = {1974}
}

@article{EkelandILemme,
Author = {Ivar Ekeland},
Journal = {Journal of Mathematical Analysis and Applications},
Pages = {324--353},
Title = {On the variational principle},
Volume = {47},
Year = {1974}
}

@book{DieudonneJ,
Address = {Paris},
Author = {Jean Dieudonné},
Publisher = {Gauthiers-Villars},
Title = {Éléments d'Analyse},
Volume = {1},
Year = {1969}
}

@book{YosidaK,
Address = {New York},
Author = {Kôsaku Yosida},
Publisher = {Springer-Verlag},
Series = {Die Grundlehren der Mathematischen Wissenschaften},
Title = {Functional Analysis},
Volume = {123},
Year = {1974}
}

%% end content of the file test.bib



test.bib
Description: Binary data



> On 17 Feb 2018, at 20:29, Alan Braslau  wrote:
> 
> HANS: there is one specific comment for you, below.
> 
> On Sat, 17 Feb 2018 15:27:03 +0100
> Otared Kavian 

Re: [NTG-context] Learning how to use \setupbtxrendering

2018-02-18 Thread Rik Kabel

On 2018-02-18 16:05, Rik Kabel wrote:

On 2018-02-18 15:25, Wolfgang Schuster wrote:



Rik Kabel 
18. Februar 2018 um 21:06
On 2018-02-18 14:33, Wolfgang Schuster wrote:
It does not matter how many fonts support both (LM does, and 
Libertine). One feature of a BibTeX file is reusability for many 
documents, and when the file is created you do not know what will be 
the default emphasis of the document. By explicitly coding \it, you 
are assured that the italic face will be attempted. If it is not 
available, there should be an error message, and you can then have a 
discussion with your editor. The claim of the new bibliography 
subsystem is that it will implement APA strictly, and that calls for 
italic.


I understand as well that \em allows switching (reverse emphasis as 
noted above). It also provides some italic correction. I am asking 
about the appropriate use of the two variations of \em: \emph  
(which is a grouped command \em) and \emphasized (defined as 
\bgroup\em\let\nexttoken). I understand and make use of grouped 
commands -- they are largely syntactic sugar, but I like sugar. I am 
less certain of the purpose of \emphasized, how it works, and why it 
might be useful. I do not recall seeing a command definition with a 
bgroup and no egroup before.


\em -> {\em ...}

\emph -> \emph{...} or {\emph ...}

\emphasized -> \emphasized{...}

Wolfgang
Yes. \em is a font switch. \emph can be either a command or a font 
switch. \emphasized is only a command. But why have \emphasized? Under 
what circumstances would a casual user prefer it? Under what 
circumstances a more advanced user, or someone writing a module, 
employ it? What does it do differently than \emph used as a command?


Grepping the source, I see thirty or so occurrences of the pattern 
\bgroup...\let\nexttoken. I do not understand just what it does. Can 
you explain it, or direct me to a good place to learn about it?



Okay, with some off-list help and a bit more reading, I understand the 
pattern used in the definition of \emphasized, or at least how it works. 
I still do not know when it should be preferred. I suspect it is more 
efficient than \emph. Is that the only advantage?


--
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] Learning how to use \setupbtxrendering

2018-02-18 Thread Rik Kabel

On 2018-02-18 15:25, Wolfgang Schuster wrote:



Rik Kabel 
18. Februar 2018 um 21:06
On 2018-02-18 14:33, Wolfgang Schuster wrote:
It does not matter how many fonts support both (LM does, and 
Libertine). One feature of a BibTeX file is reusability for many 
documents, and when the file is created you do not know what will be 
the default emphasis of the document. By explicitly coding \it, you 
are assured that the italic face will be attempted. If it is not 
available, there should be an error message, and you can then have a 
discussion with your editor. The claim of the new bibliography 
subsystem is that it will implement APA strictly, and that calls for 
italic.


I understand as well that \em allows switching (reverse emphasis as 
noted above). It also provides some italic correction. I am asking 
about the appropriate use of the two variations of \em: \emph  (which 
is a grouped command \em) and \emphasized (defined as 
\bgroup\em\let\nexttoken). I understand and make use of grouped 
commands -- they are largely syntactic sugar, but I like sugar. I am 
less certain of the purpose of \emphasized, how it works, and why it 
might be useful. I do not recall seeing a command definition with a 
bgroup and no egroup before.


\em -> {\em ...}

\emph -> \emph{...} or {\emph ...}

\emphasized -> \emphasized{...}

Wolfgang
Yes. \em is a font switch. \emph can be either a command or a font 
switch. \emphasized is only a command. But why have \emphasized? Under 
what circumstances would a casual user prefer it? Under what 
circumstances a more advanced user, or someone writing a module, employ 
it? What does it do differently than \emph used as a command?


Grepping the source, I see thirty or so occurrences of the pattern 
\bgroup...\let\nexttoken. I do not understand just what it does. Can you 
explain it, or direct me to a good place to learn about it?


--
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] Learning how to use \setupbtxrendering

2018-02-18 Thread Wolfgang Schuster



Rik Kabel 
18. Februar 2018 um 21:06
On 2018-02-18 14:33, Wolfgang Schuster wrote:
It does not matter how many fonts support both (LM does, and 
Libertine). One feature of a BibTeX file is reusability for many 
documents, and when the file is created you do not know what will be 
the default emphasis of the document. By explicitly coding \it, you 
are assured that the italic face will be attempted. If it is not 
available, there should be an error message, and you can then have a 
discussion with your editor. The claim of the new bibliography 
subsystem is that it will implement APA strictly, and that calls for 
italic.


I understand as well that \em allows switching (reverse emphasis as 
noted above). It also provides some italic correction. I am asking 
about the appropriate use of the two variations of \em: \emph  (which 
is a grouped command \em) and \emphasized (defined as 
\bgroup\em\let\nexttoken). I understand and make use of grouped 
commands -- they are largely syntactic sugar, but I like sugar. I am 
less certain of the purpose of \emphasized, how it works, and why it 
might be useful. I do not recall seeing a command definition with a 
bgroup and no egroup before.


\em -> {\em ...}

\emph -> \emph{...} or {\emph ...}

\emphasized -> \emphasized{...}

Wolfgang
___
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] Learning how to use \setupbtxrendering

2018-02-18 Thread Rik Kabel

On 2018-02-18 14:33, Wolfgang Schuster wrote:



Rik Kabel 
18. Februar 2018 um 20:22
On 2018-02-18 12:07, Alan Braslau wrote:

On Sun, 18 Feb 2018 11:58:40 -0500
Rik Kabel  wrote:


Indeed, it is hard to imagine a BibTeX file devoid of such markup.
How would one indicate the (reverse) emphasis of a quoted book title,
as in /The Cambridge Companion to /Ulysses, except by indicating the
emphasis of "Ulysses" and letting ConTeXt reverse it when emphasizing
the complete title? (§4.21 of the APA2013 spec requires this.)

title={The Cambridge Companion to {\em Ulysses}},


I would think that the proper form would be

title={The Cambridge Companion to {\it Ulysses}}

since \em could be, and is by default, slanted, but the standard here 
calls for italic.



1. How many fonts provides a italic *and* slanted style.

2. You change for the style for \em.


That brings up the question of when one should use \em, \emph, and 
\emphasized, all of which appear in font-emp.mkvi. The wiki and other 
documentation provides no guidance.



\starttext

normal {\em emphasized}

{\it normal {\em emphasized}}

\stoptext

Wolfgang

It does not matter how many fonts support both (LM does, and Libertine). 
One feature of a BibTeX file is reusability for many documents, and when 
the file is created you do not know what will be the default emphasis of 
the document. By explicitly coding \it, you are assured that the italic 
face will be attempted. If it is not available, there should be an error 
message, and you can then have a discussion with your editor. The claim 
of the new bibliography subsystem is that it will implement APA 
strictly, and that calls for italic.


I understand as well that \em allows switching (reverse emphasis as 
noted above). It also provides some italic correction. I am asking about 
the appropriate use of the two variations of \em: \emph (which is a 
grouped command \em) and \emphasized (defined as 
\bgroup\em\let\nexttoken). I understand and make use of grouped commands 
-- they are largely syntactic sugar, but I like sugar. I am less certain 
of the purpose of \emphasized, how it works, and why it might be useful. 
I do not recall seeing a command definition with a bgroup and no egroup 
before.


--
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] Learning how to use \setupbtxrendering

2018-02-18 Thread Alan Braslau
On Sun, 18 Feb 2018 20:33:37 +0100
Wolfgang Schuster  wrote:

> > Rik Kabel 
> > 18. Februar 2018 um 20:22
> > On 2018-02-18 12:07, Alan Braslau wrote:  
> >> On Sun, 18 Feb 2018 11:58:40 -0500
> >> Rik Kabel  wrote:
> >>  
> >>> Indeed, it is hard to imagine a BibTeX file devoid of such markup.
> >>> How would one indicate the (reverse) emphasis of a quoted book
> >>> title, as in /The Cambridge Companion to /Ulysses, except by
> >>> indicating the emphasis of "Ulysses" and letting ConTeXt reverse
> >>> it when emphasizing the complete title? (§4.21 of the APA2013
> >>> spec requires this.)  
> >> title={The Cambridge Companion to {\em Ulysses}},  
> >
> > I would think that the proper form would be
> >
> > title={The Cambridge Companion to {\it Ulysses}}
> >
> > since \em could be, and is by default, slanted, but the standard
> > here calls for italic.
> >  
> 1. How many fonts provides a italic *and* slanted style.
> 
> 2. You change for the style for \em.
> >
> > That brings up the question of when one should use \em, \emph, and 
> > \emphasized, all of which appear in font-emp.mkvi. The wiki and
> > other documentation provides no guidance.
> >  
> \starttext
> 
> normal {\em emphasized}
> 
> {\it normal {\em emphasized}}
> 
> \stoptext

Indeed, \it would *not* be the appropriate command to be used
(neither in LaTeX, I believe). As Wolgang's example (and cont-enp.pdf)
shows, \em does *exactly* what is needed.

Alan
___
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] Learning how to use \setupbtxrendering

2018-02-18 Thread Wolfgang Schuster



Rik Kabel 
18. Februar 2018 um 20:22
On 2018-02-18 12:07, Alan Braslau wrote:

On Sun, 18 Feb 2018 11:58:40 -0500
Rik Kabel  wrote:


Indeed, it is hard to imagine a BibTeX file devoid of such markup.
How would one indicate the (reverse) emphasis of a quoted book title,
as in /The Cambridge Companion to /Ulysses, except by indicating the
emphasis of "Ulysses" and letting ConTeXt reverse it when emphasizing
the complete title? (§4.21 of the APA2013 spec requires this.)

title={The Cambridge Companion to {\em Ulysses}},


I would think that the proper form would be

title={The Cambridge Companion to {\it Ulysses}}

since \em could be, and is by default, slanted, but the standard here 
calls for italic.



1. How many fonts provides a italic *and* slanted style.

2. You change for the style for \em.


That brings up the question of when one should use \em, \emph, and 
\emphasized, all of which appear in font-emp.mkvi. The wiki and other 
documentation provides no guidance.



\starttext

normal {\em emphasized}

{\it normal {\em emphasized}}

\stoptext

Wolfgang

___
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] Learning how to use \setupbtxrendering

2018-02-18 Thread Rik Kabel

On 2018-02-18 12:07, Alan Braslau wrote:

On Sun, 18 Feb 2018 11:58:40 -0500
Rik Kabel  wrote:


Indeed, it is hard to imagine a BibTeX file devoid of such markup.
How would one indicate the (reverse) emphasis of a quoted book title,
as in /The Cambridge Companion to /Ulysses, except by indicating the
emphasis of "Ulysses" and letting ConTeXt reverse it when emphasizing
the complete title? (§4.21 of the APA2013 spec requires this.)

title={The Cambridge Companion to {\em Ulysses}},


I would think that the proper form would be

   title={The Cambridge Companion to {\it Ulysses}}

since \em could be, and is by default, slanted, but the standard here 
calls for italic.


That brings up the question of when one should use \em, \emph, and 
\emphasized, all of which appear in font-emp.mkvi. The wiki and other 
documentation provides no guidance.


--
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] Learning how to use \setupbtxrendering

2018-02-18 Thread Alan Braslau
On Sun, 18 Feb 2018 19:23:25 +0100
Hans Hagen  wrote:

> On 2/18/2018 7:07 PM, Rik Kabel wrote:
> > On 2018-02-18 12:23, Thomas A. Schmitz wrote:
> >> On 02/18/2018 06:07 PM, Alan Braslau wrote:
> >>> title={The Cambridge Companion to {\em Ulysses}},
> >>
> >> Alan, I think this was Rik Kabel's point: for some scenarios, you 
> >> cannot avoid to have some sort of context commands in your bibtex 
> >> file. For a while, I also used biblatex from time to time, so I
> >> tried to have a bibtex file that would be as clean as possible and
> >> work with both systems, but your example shows that this is not
> >> always possible. Well, nothing that some well-written perl
> >> couldn't get rid of...
> >>
> >> All best
> >>
> >> Thomas
> > 
> > Indeed, that was my point. Even without the mathematics components
> > that were cited, I cannot imagine how markup could be excluded from
> > the BibTeX file, and for that matter, from any other
> > bibliographical database I have seen, if we have to comply with
> > arbitrary formatting standards. The statement that one should not
> > put any such formatting into the file is perhaps aspirational, but
> > not really useful.
> If you code clean it's no problem as we can map commands
> (\btxcommand) but most (large) bibtex databases we've seen so far are
> quite inconsistent (not only in usage of commands, also in author
> names).
> 
> (And of course Thomas meant Lua and not Perl.)

The message was meant to be "don't abuse" markup in data;
Don't attempt bibtex/latex hackery.

As Hans mentions, \btxcommand was introduced to handle some formatting
in bibtex entries that might be inconsistent or in conflict with
standard ConTeXt commands. When no \btxcommand definition is found,
the system falls-back on standard ConTeXt (or luatex) syntax. Sloppy
bibtex files should be cleaned up, but the aim is to allow files to be
shared with bibtex/latex (minus any hackery, which could/should be
fixed in the bibtex style files, but usually is not).

Alan
___
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] Learning how to use \setupbtxrendering

2018-02-18 Thread Hans Hagen

On 2/18/2018 7:07 PM, Rik Kabel wrote:

On 2018-02-18 12:23, Thomas A. Schmitz wrote:

On 02/18/2018 06:07 PM, Alan Braslau wrote:

title={The Cambridge Companion to {\em Ulysses}},


Alan, I think this was Rik Kabel's point: for some scenarios, you 
cannot avoid to have some sort of context commands in your bibtex 
file. For a while, I also used biblatex from time to time, so I tried 
to have a bibtex file that would be as clean as possible and work with 
both systems, but your example shows that this is not always possible. 
Well, nothing that some well-written perl couldn't get rid of...


All best

Thomas


Indeed, that was my point. Even without the mathematics components that 
were cited, I cannot imagine how markup could be excluded from the 
BibTeX file, and for that matter, from any other bibliographical 
database I have seen, if we have to comply with arbitrary formatting 
standards. The statement that one should not put any such formatting 
into the file is perhaps aspirational, but not really useful.
If you code clean it's no problem as we can map commands (\btxcommand) 
but most (large) bibtex databases we've seen so far are quite 
inconsistent (not only in usage of commands, also in author names).


(And of course Thomas meant Lua and not Perl.)

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] Learning how to use \setupbtxrendering

2018-02-18 Thread Rik Kabel

On 2018-02-18 12:23, Thomas A. Schmitz wrote:

On 02/18/2018 06:07 PM, Alan Braslau wrote:

title={The Cambridge Companion to {\em Ulysses}},


Alan, I think this was Rik Kabel's point: for some scenarios, you 
cannot avoid to have some sort of context commands in your bibtex 
file. For a while, I also used biblatex from time to time, so I tried 
to have a bibtex file that would be as clean as possible and work with 
both systems, but your example shows that this is not always possible. 
Well, nothing that some well-written perl couldn't get rid of...


All best

Thomas


Indeed, that was my point. Even without the mathematics components that 
were cited, I cannot imagine how markup could be excluded from the 
BibTeX file, and for that matter, from any other bibliographical 
database I have seen, if we have to comply with arbitrary formatting 
standards. The statement that one should not put any such formatting 
into the file is perhaps aspirational, but not really useful.


--
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] Learning how to use \setupbtxrendering

2018-02-18 Thread Thomas A. Schmitz

On 02/18/2018 06:07 PM, Alan Braslau wrote:

title={The Cambridge Companion to {\em Ulysses}},


Alan, I think this was Rik Kabel's point: for some scenarios, you cannot 
avoid to have some sort of context commands in your bibtex file. For a 
while, I also used biblatex from time to time, so I tried to have a 
bibtex file that would be as clean as possible and work with both 
systems, but your example shows that this is not always possible. Well, 
nothing that some well-written perl couldn't get rid of...


All best

Thomas
___
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] Learning how to use \setupbtxrendering

2018-02-18 Thread Alan Braslau
On Sun, 18 Feb 2018 11:58:40 -0500
Rik Kabel  wrote:

> Indeed, it is hard to imagine a BibTeX file devoid of such markup.
> How would one indicate the (reverse) emphasis of a quoted book title,
> as in /The Cambridge Companion to /Ulysses, except by indicating the
> emphasis of "Ulysses" and letting ConTeXt reverse it when emphasizing
> the complete title? (§4.21 of the APA2013 spec requires this.)

title={The Cambridge Companion to {\em Ulysses}},
___
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] Learning how to use \setupbtxrendering

2018-02-18 Thread Rik Kabel

On 2018-02-17 14:29, Alan Braslau wrote:

First of all, don't put any such formatting in the BibTeX file: that is
a LaTeX-style hack, and we have designed the ConTeXt system to avoid
any such need. The dataset should contain only data, and hacks should
be avoided.

There is some limitation to this. Say, for example that the title
contains mathematical symbols. One would be hard pressed not to include
dollar-sign delimiters and math syntax! Another example could be
"edition={second}" and "edition={2\high{nd}}". Of course, one could
introduce conversion sets (like for months), but this gets complicated.
How about "edition={second, revised with corrections}"?



Indeed, it is hard to imagine a BibTeX file devoid of such markup. How 
would one indicate the (reverse) emphasis of a quoted book title, as in 
/The Cambridge Companion to /Ulysses, except by indicating the emphasis 
of "Ulysses" and letting ConTeXt reverse it when emphasizing the 
complete title? (§4.21 of the APA2013 spec requires this.)


--
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] Learning how to use \setupbtxrendering

2018-02-18 Thread Hans Hagen

On 2/17/2018 8:29 PM, Alan Braslau wrote:

HANS: there is one specific comment for you, below.


well, up to you to decide if it's auser overload (at some point we need 
to stop and users should copy/patch setups ... that's the idea


concerning a title with commands ... no way around math in titles i 
guess (and tex math is sort of standard); we can think of having a 
"textitle" field, or abuse "title:en" for the formatted ones



On Sat, 17 Feb 2018 15:27:03 +0100
Otared Kavian  wrote:


Dear all,

I am in the process of learning how to use the bibliography mechanism
in mkiv, and I would lik eto understand the meanings of the various
parameters in the command:

\setupbtxrendering [...,1,...] [..,..2=..,..]
1 NAME
2 textstate = start stop
pagestate   = start stop
separator   = COMMAND
criterium   = previous cite here all none
filter  = TEXT
specification   = NAME
title   = TEXT
before  = COMMAND
after   = COMMAND
dataset = NAME
method  = dataset force local global none
sorttype= short dataset list reference used default
cite index repeat   = yes no
group   = NAME
numbering   = yes no num index tag short page

Indeed serveral of them are clear enough (such as dataset), some can
be guessed by trial and error (such as numbering=yes or no) but some
seem to me obscure or difficult to guess (what would numbering=page
mean, or what would separator=COMMAND do, what does the title=TEXT
corresponds to, etc).

Has someone some examples to play with in order to learn the meaning
of these options?

Also, in real case document I would like to be able to typeset the
bibliography with the following style:

the autho's name is followed by a « : »
the title of an article is in italic
the title of a book is in slanted sans serif
the number of the volume is in bold

Is it possible to do this by an appropriate setting of btxrendering,
without going into the BibTeX file?

Thanks in advance for any help: OK


First of all, don't put any such formatting in the BibTeX file: that is
a LaTeX-style hack, and we have designed the ConTeXt system to avoid
any such need. The dataset should contain only data, and hacks should
be avoided.

There is some limitation to this. Say, for example that the title
contains mathematical symbols. One would be hard pressed not to include
dollar-sign delimiters and math syntax! Another example could be
"edition={second}" and "edition={2\high{nd}}". Of course, one could
introduce conversion sets (like for months), but this gets complicated.
How about "edition={second, revised with corrections}"?


Most of the customizations that you ask are obtained through setups:

For the author's name, depends on what you want: " : " after the list
of authors or after each author? If you want this after the list of
authors, then one needs to redefine a setup:

 From publ-imp-authors.mkvi

\startsetups \s!btx:\s!list:\s!author:others
 \ifcase\currentbtxoverflow \else
 \btxparameter\c!otherstext
 \fi
\stopsetups

(this gets called at the end of the author list construction). One could add at
the end \btxcolon, defined (in publ-ini.mkiv) as
\unexpanded\def\btxcolon {\removeunwantedspaces:\space}
but you would want a space before, so you would probably want to add, rather
"\space:\space"

HANS: perhaps this requested use might call for a new parameter
(separator:names:5=,) to be put at the *end* of an author list in *all*
of the appropriate setups, rather than having to redefine the :others
setup which is sort-of a hack? In this case, Otared would then use
\setupbtx [apa:list:author] [separator:names:5={\space:\space}]
(assuming that he uses the apa specification)
DON'T try this, as we do not implement it (yet)!


For the other requests:

\setupbtx [apa:list:title] [style=italic]
(the default for apa)

\setupbtx [apa:list:title:book] [style={slanted,sans}]
(untested)

\setupbtx [apa:list:volume] [style=bold]
(apa default is italic)


On your other questions, a rendering uses the standard list mechanism,
so some of the parameters (such as pagestate) get passed on. See
\setuplist

Others, such as numbering= yes no num index tag short page
controls the numbering of the list. It is numbering=num (or yes for
default and aps) but numbering=no (for apa).
numbering=index puts the dataset index (which depends on an internal
hash) rather than num which is a cite instance number.
numbering=tag puts the bibtex tag (as used in \cite).
numbering=short puts the short tag, for example KAV18, that is a short
author-year concoction.
numbering=page, I don't know what this does (in my test, it put "?").

Many (but not all) of the rendering parameters are described (somewhat)
in the documentation, which of course is not perfect!

Alan




--

-
  

Re: [NTG-context] Learning how to use \setupbtxrendering

2018-02-17 Thread Alan Braslau
HANS: there is one specific comment for you, below.

On Sat, 17 Feb 2018 15:27:03 +0100
Otared Kavian  wrote:

> Dear all,
> 
> I am in the process of learning how to use the bibliography mechanism
> in mkiv, and I would lik eto understand the meanings of the various
> parameters in the command:
> 
> \setupbtxrendering [...,1,...] [..,..2=..,..]
> 1 NAME
> 2 textstate   = start stop
> pagestate = start stop
> separator = COMMAND
> criterium = previous cite here all none 
> filter= TEXT
> specification = NAME
> title = TEXT
> before= COMMAND
> after = COMMAND
> dataset   = NAME
> method= dataset force local global none
> sorttype  = short dataset list reference used default
> cite index repeat = yes no
> group = NAME
> numbering = yes no num index tag short page
> 
> Indeed serveral of them are clear enough (such as dataset), some can
> be guessed by trial and error (such as numbering=yes or no) but some
> seem to me obscure or difficult to guess (what would numbering=page
> mean, or what would separator=COMMAND do, what does the title=TEXT
> corresponds to, etc).
> 
> Has someone some examples to play with in order to learn the meaning
> of these options?
> 
> Also, in real case document I would like to be able to typeset the
> bibliography with the following style:
> 
> the autho's name is followed by a « : »
> the title of an article is in italic
> the title of a book is in slanted sans serif
> the number of the volume is in bold
> 
> Is it possible to do this by an appropriate setting of btxrendering,
> without going into the BibTeX file?
> 
> Thanks in advance for any help: OK

First of all, don't put any such formatting in the BibTeX file: that is
a LaTeX-style hack, and we have designed the ConTeXt system to avoid
any such need. The dataset should contain only data, and hacks should
be avoided.

There is some limitation to this. Say, for example that the title
contains mathematical symbols. One would be hard pressed not to include
dollar-sign delimiters and math syntax! Another example could be
"edition={second}" and "edition={2\high{nd}}". Of course, one could
introduce conversion sets (like for months), but this gets complicated.
How about "edition={second, revised with corrections}"?


Most of the customizations that you ask are obtained through setups:

For the author's name, depends on what you want: " : " after the list
of authors or after each author? If you want this after the list of
authors, then one needs to redefine a setup:

From publ-imp-authors.mkvi

\startsetups \s!btx:\s!list:\s!author:others
\ifcase\currentbtxoverflow \else
\btxparameter\c!otherstext
\fi
\stopsetups

(this gets called at the end of the author list construction). One could add at
the end \btxcolon, defined (in publ-ini.mkiv) as
\unexpanded\def\btxcolon {\removeunwantedspaces:\space}
but you would want a space before, so you would probably want to add, rather
"\space:\space"

HANS: perhaps this requested use might call for a new parameter
(separator:names:5=,) to be put at the *end* of an author list in *all*
of the appropriate setups, rather than having to redefine the :others
setup which is sort-of a hack? In this case, Otared would then use
\setupbtx [apa:list:author] [separator:names:5={\space:\space}]
(assuming that he uses the apa specification)
DON'T try this, as we do not implement it (yet)!


For the other requests:

\setupbtx [apa:list:title] [style=italic]
(the default for apa)

\setupbtx [apa:list:title:book] [style={slanted,sans}]
(untested)

\setupbtx [apa:list:volume] [style=bold]
(apa default is italic)


On your other questions, a rendering uses the standard list mechanism,
so some of the parameters (such as pagestate) get passed on. See
\setuplist

Others, such as numbering= yes no num index tag short page
controls the numbering of the list. It is numbering=num (or yes for
default and aps) but numbering=no (for apa).
numbering=index puts the dataset index (which depends on an internal
hash) rather than num which is a cite instance number.
numbering=tag puts the bibtex tag (as used in \cite).
numbering=short puts the short tag, for example KAV18, that is a short
author-year concoction.
numbering=page, I don't know what this does (in my test, it put "?").

Many (but not all) of the rendering parameters are described (somewhat)
in the documentation, which of course is not perfect!

Alan
___
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] Learning how to use \setupbtxrendering

2018-02-17 Thread Otared Kavian
Dear all,

I am in the process of learning how to use the bibliography mechanism in mkiv, 
and I would lik eto understand the meanings of the various parameters in the 
command:

\setupbtxrendering [...,1,...] [..,..2=..,..]
1 NAME
2 textstate = start stop
pagestate   = start stop
separator   = COMMAND
criterium   = previous cite here all none 
filter  = TEXT
specification   = NAME
title   = TEXT
before  = COMMAND
after   = COMMAND
dataset = NAME
method  = dataset force local global none
sorttype= short dataset list reference used default cite index
repeat  = yes no
group   = NAME
numbering   = yes no num index tag short page

Indeed serveral of them are clear enough (such as dataset), some can be guessed 
by trial and error (such as numbering=yes or no) but some seem to me obscure or 
difficult to guess (what would numbering=page mean, or what would 
separator=COMMAND do, what does the title=TEXT corresponds to, etc).

Has someone some examples to play with in order to learn the meaning of these 
options?

Also, in real case document I would like to be able to typeset the bibliography 
with the following style:

the autho's name is followed by a « : »
the title of an article is in italic
the title of a book is in slanted sans serif
the number of the volume is in bold

Is it possible to do this by an appropriate setting of btxrendering, without 
going into the BibTeX file?

Thanks in advance for any help: OK
___
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] Learning about Kerning

2015-09-16 Thread Michael Guravage
Hi,

The appearance of a gap before the letter T has nothing to do with kerning
per se, but with my use of smallcaps and kerning.

I solved my problem by defining a font feature and applying it with the
\setff command as described on the wiki.

\setuplayout[header=0pt, footer=0pt]
\setupstretched[width=6.25cm]

\definefontfeature[smallcapitals] [smcp=yes]

\starttext
  \setuphead[subject][style=\setff{smallcapitals},
textstyle={\kerncharacters[.40]}]
  \startsubject[title={Properties of Blood}]
  \stopsubject


\setuphead[subject][style=\setff{smallcapitals},deeptextcommand={\kerncharacters[.40]}]
  \startsubject[title={Properties of Blood}]
  \stopsubject


\setuphead[subject][style=\setff{smallcapitals},deeptextcommand={\stretched}]
  \startsubject[title={Properties of Blood}]
  \stopsubject

\stoptext



On Mon, Sep 14, 2015 at 5:33 PM, Michael Guravage 
wrote:

> Hi,
>
> I am trying to use kerning in subject titles. \kernchracters works pretty
> good, but as you can see in the attached example, there is a gap before the
> Ts in Properties, and again in Praefatio and Praefationis. The \stretched
> command yields similar results, vis-à-vis the gaps.
>
> If somebody can enlighten me how to properly use kerning in this
> situation, I'd be immeasurably grateful.
>
> Cheers,
>
> Michael
>
>
___
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] Learning about Kerning

2015-09-15 Thread Michael Guravage
Hi,

I am trying to use kerning in subject titles. \kernchracters works pretty
good, but as you can see in the attached example, there is a gap before the
Ts in Properties, and again in Praefatio and Praefationis. The \stretched
command yields similar results, vis-à-vis the gaps.

If somebody can enlighten me how to properly use kerning in this situation,
I'd be immeasurably grateful.

Cheers,

Michael


kerning.tex
Description: TeX document


kerning.pdf
Description: Adobe PDF document
___
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] Learning ConTeXt from the Ground Up

2013-06-16 Thread Dmitriy Tokarev
 To gather information about ConTeXt I have
 - read the ConTeXt Reference Manual (http://pmrb.free.fr/contextref.pdf)
 - bought a couple of the published books by Hans Hagen
 - started reading the TeX book by Donald Knuth

In addition to the TeX book you might be interested in TeX for the 
Impatient:
http://www.ctan.org/pkg/impatient

see top of p.8 for recommendations for reading.

--
Dmitriy
___
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] Learning ConTeXt from the Ground Up

2013-06-14 Thread luigi scarso
On Fri, Jun 14, 2013 at 7:19 AM, Malte Stien ma...@stien.de wrote:


 To gather information about ConTeXt I have
 - read the ConTeXt Reference Manual (http://pmrb.free.fr/contextref.pdf)
 - bought a couple of the published books by Hans Hagen
 - started reading the TeX book by Donald Knuth


I have even briefly flirted with the idea of switching to LaTeX mainly
 because it would mean having a lot more literature and a broader community
 at my disposal. However, I just prefer the command structure and output of
 ConTeXt. Can anyone relate to my problem? Am I on the right track? What
 else should I be doing or reading to really break into ConTeXt?


you have missed
-  read the source
Take a problem, grep the source see how Hans addresses the problem.
There are examples on how to use a feature that sometime are not explained
in manuals.

I think that here mkiv is better than latex (oh, well, after all it's the
context ml , right ?).



--
luigi
___
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] Learning ConTeXt from the Ground Up

2013-06-14 Thread Procházka Lukáš Ing . - Pontex s . r . o .

Hello,

On Fri, 14 Jun 2013 07:19:44 +0200, Malte Stien ma...@stien.de wrote:


Hello Everyone,

I have been using ConTeXt for over a year now and worked out how to do most 
things I need to do. Every now and then, though, I need to do something that I 
cannot find any information about and in most cases I post a question here on 
the forum. I have received great help here over the months and like to thank 
everyone who took the time to answer my questions. The other day, however, I 
had a problem, posted a message here, got an answer and the answer did not 
quite work; I went back to the forum, got more help...

In the process I realised that I should have been able to work this out myself; I was not 
even able to tweak the first answer and make it work. I am an IT engineer myself, but 
with little time (I guess I am not unique here) and even less experience in TeX. I guess 
what I am saying is, that I would like to gain a much deeper understanding of ConTeXt 
which will allow me to program in ConTeXt rather than just using the 
documented command.

To gather information about ConTeXt I have
- read the ConTeXt Reference Manual (http://pmrb.free.fr/contextref.pdf)
- bought a couple of the published books by Hans Hagen
- started reading the TeX book by Donald Knuth


this is a normal approach - questioning, searching for answers... It's the same 
for ConTeXt as for LaTeX.

Personally, I started with Ltx and migrated to Ctx some years ago.

Big advantages of Ctx are:

- This forum is very alive, almost all questions are answered in short time.

- Ctx document is much more customizable by standard Ctx commands, i.e. - compared with 
Ltx - you don't need to go in the Ltx source and investigate how to do this-or-that. Ltx 
seems to me a bit rigid - it's not so easy to change style of heads, special 
paragraphs, enumerations, ...

- Ctx is still developed; AFAIK Ltx ver. 3.? is being prepared/issued several 
(- at least 5 -) years.

- Ctx: Some features - if they seem useful - may be implemented on-demand, so 
they may be ready to use with a next beta (thanks mainly Hans; as well as Wolfgand, 
Aditya...).

- Although Ctx wiki is not best manual one could imagine, (pros:) it is still 
maintained and developed (cons: some info may be obsolete, some articles may be 
written in old-style fashion...)

- Ltx: I don't know how far Ltx is bound with Lua and how this relation is documented; I 
guess poorly. As Ctx is concerned, many (almost all?) things of TeX/Ctx core may be 
accessible/hookable by Lua - this is a great feature; and IMHO: as if you are 
normal programmer, programming by Lua should be much more quicker for you 
than doing things by TeX macro language.

So, my personal advice would be - try to stay with Ctx, I believe after some initial 
problems/obstacles you'll be becoming master and Ctx will become a good 
slave.

Best regards,

Lukas



I have even briefly flirted with the idea of switching to LaTeX mainly because 
it would mean having a lot more literature and a broader community at my 
disposal. However, I just prefer the command structure and output of ConTeXt. 
Can anyone relate to my problem? Am I on the right track? What else should I be 
doing or reading to really break into ConTeXt?

Regards,
Malte.

PS: Just to be clear; I don't mean for the above to be conceived as 
shortcomings of ConTeXt, rather I think of them as shortcomings of myself. The 
developers of ConTeXt have done a fantastic job and I really enjoy writing in 
ConTeXt and looking at the output.



--
Ing. Lukáš Procházka [mailto:l...@pontex.cz]
Pontex s. r. o.  [mailto:pon...@pontex.cz] [http://www.pontex.cz]
Bezová 1658
147 14 Praha 4

Tel: +420 244 062 238
Fax: +420 244 461 038

___
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] Learning ConTeXt from the Ground Up

2013-06-14 Thread Hans Hagen

On 6/14/2013 9:17 AM, luigi scarso wrote:




On Fri, Jun 14, 2013 at 7:19 AM, Malte Stien ma...@stien.de
mailto:ma...@stien.de wrote:


To gather information about ConTeXt I have
- read the ConTeXt Reference Manual (http://pmrb.free.fr/contextref.pdf)
- bought a couple of the published books by Hans Hagen
- started reading the TeX book by Donald Knuth


I have even briefly flirted with the idea of switching to LaTeX
mainly because it would mean having a lot more literature and a
broader community at my disposal. However, I just prefer the command
structure and output of ConTeXt. Can anyone relate to my problem? Am
I on the right track? What else should I be doing or reading to
really break into ConTeXt?


you have missed
-  read the source
Take a problem, grep the source see how Hans addresses the problem.
There are examples on how to use a feature that sometime are not
explained in manuals.


other resources:

- the wiki
- the test suite (lots of small examples)
- modules by (e.g. wolfgangs modules are mkiv compliant)
- maybe examples on stack exchange (there are nice ones there)
- sites like http://randomdeterminism.wordpress.com

and probably more

Hans



-
  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] Learning ConTeXt from the Ground Up

2013-06-13 Thread Malte Stien
Hello Everyone,

I have been using ConTeXt for over a year now and worked out how to do most 
things I need to do. Every now and then, though, I need to do something that I 
cannot find any information about and in most cases I post a question here on 
the forum. I have received great help here over the months and like to thank 
everyone who took the time to answer my questions. The other day, however, I 
had a problem, posted a message here, got an answer and the answer did not 
quite work; I went back to the forum, got more help...

In the process I realised that I should have been able to work this out myself; 
I was not even able to tweak the first answer and make it work. I am an IT 
engineer myself, but with little time (I guess I am not unique here) and even 
less experience in TeX. I guess what I am saying is, that I would like to gain 
a much deeper understanding of ConTeXt which will allow me to program in 
ConTeXt rather than just using the documented command.

To gather information about ConTeXt I have
- read the ConTeXt Reference Manual (http://pmrb.free.fr/contextref.pdf)
- bought a couple of the published books by Hans Hagen
- started reading the TeX book by Donald Knuth

I have even briefly flirted with the idea of switching to LaTeX mainly because 
it would mean having a lot more literature and a broader community at my 
disposal. However, I just prefer the command structure and output of ConTeXt. 
Can anyone relate to my problem? Am I on the right track? What else should I be 
doing or reading to really break into ConTeXt?

Regards,
Malte.

PS: Just to be clear; I don't mean for the above to be conceived as 
shortcomings of ConTeXt, rather I think of them as shortcomings of myself. The 
developers of ConTeXt have done a fantastic job and I really enjoy writing in 
ConTeXt and looking at the output.

--
“The Electric Monk was a labour-saving device, like a dishwasher or a video 
recorder... Electric Monks believed things for you, thus saving you what was 
becoming an increasingly onerous task, that of believing all the things the 
world expected you to believe.”

― Douglas Adams, Dirk Gently's Holistic Detective Agency

___
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] Learning layers: setlayer vs. setlayerframed

2011-10-26 Thread Mari Voipio
Hello!

Based on a discussion with Hans at the ConTeXt meeting I'm starting to
migrate my book covers from CorelDraw to ConTeXt using layers.

After a bit of experimenting I managed to achieve my first layer, but
looking at the examples on the wiki page, I'm wondering: what's the
difference between \setlayer and \setlayerframed.

Is the latter a subset of the first and possibly equal to

\setlayer   [name]  % name of the layer
{\framed[...=...,...=...]{LAYER}}  % the actual contents of the layer

or something else?

And which one should I use, anyway? I need to put a bit of text and a
bit of graphics onto the pages, but nothing complicated, just boxes.
But as I'm starting from zero, it would be nice to know what's the
smartest way of doing it (on the moment).

I'm running the newest or at least almost newest beta of ConTeXt and
can update if needed.


Thanks,

Mari
___
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] Learning layers: setlayer vs. setlayerframed

2011-10-26 Thread Wolfgang Schuster

Am 26.10.2011 um 09:42 schrieb Mari Voipio:

 Hello!
 
 Based on a discussion with Hans at the ConTeXt meeting I'm starting to
 migrate my book covers from CorelDraw to ConTeXt using layers.
 
 After a bit of experimenting I managed to achieve my first layer, but
 looking at the examples on the wiki page, I'm wondering: what's the
 difference between \setlayer and \setlayerframed.
 
 Is the latter a subset of the first and possibly equal to
 
 \setlayer [name]  % name of the layer
 {\framed[...=...,...=...]{LAYER}}  % the actual contents of the layer
 
 or something else?

Yes, this is more or less the definition of \setlayerframed.

 And which one should I use, anyway? I need to put a bit of text and a
 bit of graphics onto the pages, but nothing complicated, just boxes.
 But as I'm starting from zero, it would be nice to know what's the
 smartest way of doing it (on the moment).

For the graphics you can use \setlayer but \setlayerframed is better when
you a longer text which should be broken into lines.

Wolfgang

___
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] Learning LuaTeX : Invoice

2011-02-22 Thread Henning Hraban Ramm

Am 2011-02-20 um 21:20 schrieb Philipp Gesang:

Anyways, looking forward to see your invoice code


Here you are:
http://wiki.contextgarden.net/Calculations_in_Lua

It’s just in a works for me state, and the page can go away as soon  
as the spreadsheet module goes live.



Greetlings from Lake Constance!
Hraban
---
http://www.fiee.net/texnique/
http://wiki.contextgarden.net
https://www.cacert.org (I'm an assurer)

___
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] Learning LuaTeX : Invoice

2011-02-22 Thread luigi scarso
On Tue, Feb 22, 2011 at 10:47 AM, Henning Hraban Ramm hra...@fiee.net wrote:
 Am 2011-02-20 um 21:20 schrieb Philipp Gesang:

 Anyways, looking forward to see your invoice code

 Here you are:
 http://wiki.contextgarden.net/Calculations_in_Lua

 It’s just in a works for me state, and the page can go away as soon as the
 spreadsheet module goes live.
Can you add a small example ?

-- 
luigi
___
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] Learning LuaTeX : Invoice

2011-02-22 Thread Wolfgang Schuster

Am 22.02.2011 um 10:51 schrieb luigi scarso:

 On Tue, Feb 22, 2011 at 10:47 AM, Henning Hraban Ramm hra...@fiee.net wrote:
 Am 2011-02-20 um 21:20 schrieb Philipp Gesang:
 
 Anyways, looking forward to see your invoice code
 
 Here you are:
 http://wiki.contextgarden.net/Calculations_in_Lua
 
 It’s just in a works for me state, and the page can go away as soon as the
 spreadsheet module goes live.
 Can you add a small example ?

The spreadsheet module has a example at the end of the file and Hennings code
has also a example at the end.

Wolfgang
___
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] Learning LuaTeX : Invoice

2011-02-22 Thread luigi scarso
On Tue, Feb 22, 2011 at 11:01 AM, Wolfgang Schuster
schuster.wolfg...@googlemail.com wrote:

 Am 22.02.2011 um 10:51 schrieb luigi scarso:

 On Tue, Feb 22, 2011 at 10:47 AM, Henning Hraban Ramm hra...@fiee.net 
 wrote:
 Am 2011-02-20 um 21:20 schrieb Philipp Gesang:

 Anyways, looking forward to see your invoice code

 Here you are:
 http://wiki.contextgarden.net/Calculations_in_Lua

 It’s just in a works for me state, and the page can go away as soon as the
 spreadsheet module goes live.
 Can you add a small example ?

 The spreadsheet module has a example at the end of the file and Hennings code
 has also a example at the end.
Yes I've seen
-- register invoice items

userdata.RegisterAmountItem(Some introductional text, 0) -- just text

userdata.RegisterTimeItem(Learn \\LUATEX, 2.5)
userdata.RegisterTimeItem(Do some calculations in \\CONTEXT, 3.5 + 7)

userdata.RegisterAmountItem(Donations to Open Source projects, 99) -- lump sum

-- output

userdata.Invoice()

But it' s better
\startluacode
-- functions
\stopluacode
%%
\starttext
\startluacode
-- register invoice items
userdata.RegisterAmountItem(Some introductional text, 0) -- just text
userdata.RegisterTimeItem(Learn \\LUATEX, 2.5)
userdata.RegisterTimeItem(Do some calculations in \\CONTEXT, 3.5 + 7)
userdata.RegisterAmountItem(Donations to Open Source projects, 99) -- lump sum
-- output
userdata.Invoice()
\stopluacode
\stoptext

(or maybe a  better example)

-- 
luigi
___
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] Learning LuaTeX : Invoice

2011-02-22 Thread Henning Hraban Ramm

Am 2011-02-22 um 11:14 schrieb luigi scarso:


Can you add a small example ?


The spreadsheet module has a example at the end of the file and  
Hennings code

has also a example at the end.

Yes I've seen

...

But it' s better
\startluacode
-- functions
\stopluacode
%%
\starttext
\startluacode
-- register invoice items
userdata.RegisterAmountItem(Some introductional text, 0) -- just  
text

userdata.RegisterTimeItem(Learn \\LUATEX, 2.5)
userdata.RegisterTimeItem(Do some calculations in \\CONTEXT, 3.5 +  
7)
userdata.RegisterAmountItem(Donations to Open Source projects, 99)  
-- lump sum

-- output
userdata.Invoice()
\stopluacode
\stoptext

(or maybe a  better example)


Feel free to change it, it’s a wiki.

In my own document the functions live in an environment, together with  
all the definitions for the letter, and the invoice items in the  
actual invoice document. I wanted to make a rather minimal example, so  
I left out all the letter stuff.


The page is of use only for those who speak little Lua (I was looking  
for a similar example); if you know better, you won’t need it, and if  
you don’t speak Lua at all, it’s useless for you.



Greetlings from Lake Constance!
Hraban
---
http://www.fiee.net/texnique/
http://wiki.contextgarden.net
https://www.cacert.org (I'm an assurer)

___
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] Learning LuaTeX : Invoice

2011-02-20 Thread Henning Hraban Ramm

Maybe similar to the spreadsheet question:
I'm trying to use Wolfgang's letter module for my invoices and would  
like to use Lua for the sums.

But I fail already at the beginning:

\startluacode
userdata = userdata or {}

userdata.invoice = userdata.invoice or { sum = 0 } -- global table for  
sums


function userdata.singlesum(hours, perhour)
amount = hours * perhour
userdata.invoice.sum = userdata.invoice.sum + amount
global.context(string.gsub(string.format(\%.2f, amount), %., ,))
return amount
end

\stopluacode

gives:

(virtual://viafile.1 unknown preamble key [the character )] unknown  
preamble key [the character )] unknown preamble key [the character )]

! LuaTeX error main ctx instance:1: '=' expected near 'eof'.

system   tex  error on line 11 in file invoice.tex: LuaTeX  
error  ...


 4 \startluacode
 5 userdata = userdata or {}
 6
 7 userdata.invoice = userdata.invoice or { sum = 0 }
 8
 9 function userdata.singlesum(hours, perhour)
10  amount = hours * perhour
11  userdata.invoice.sum = userdata.invoice.sum + amount
12 	global.context(string.gsub(string.format(\%.2f, amount),  
%., ,))

13  return amount
14 end


I can't see what's wrong!?

I tried local and usercode, but didn’t get further.


Greetlings from Lake Constance!
Hraban
---
http://www.fiee.net/texnique/
http://wiki.contextgarden.net
https://www.cacert.org (I'm an assurer)

___
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] Learning LuaTeX : Invoice

2011-02-20 Thread Henning Hraban Ramm

Am 2011-02-20 um 12:55 schrieb Henning Hraban Ramm:


But I fail already at the beginning:

\startluacode


Sorry for the noise, the error was in the call, not in the definition.



Greetlings from Lake Constance!
Hraban
---
http://www.fiee.net/texnique/
http://wiki.contextgarden.net
https://www.cacert.org (I'm an assurer)

___
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] Learning LuaTeX : Invoice

2011-02-20 Thread Wolfgang Schuster

Am 20.02.2011 um 12:55 schrieb Henning Hraban Ramm:

 Maybe similar to the spreadsheet question:
 I'm trying to use Wolfgang's letter module for my invoices and would like to 
 use Lua for the sums.
 But I fail already at the beginning:
 
 \startluacode
 userdata = userdata or {}
 
 userdata.invoice = userdata.invoice or { sum = 0 } -- global table for sums
 
 function userdata.singlesum(hours, perhour)
   amount = hours * perhour
   userdata.invoice.sum = userdata.invoice.sum + amount
   global.context(string.gsub(string.format(\%.2f, amount), %., ,))
   return amount
 end
 
 \stopluacode

\startluacode

userdata = userdata or {}

userdata.invoice = userdata.invoice or { sum = 0 } -- global table for sums

function userdata.singlesum(hours, perhour)
local amount = hours * perhour
userdata.invoice.sum = userdata.invoice.sum + amount
context(string.gsub(string.format(%.2f,amount),%.,,))
end

\stopluacode

\starttext
\ctxlua{userdata.singlesum(3,4)}
\stoptext

Wolfgang

___
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] Learning LuaTeX : Invoice

2011-02-20 Thread Henning Hraban Ramm

Am 2011-02-20 um 13:08 schrieb Wolfgang Schuster:


local amount = hours * perhour


Thank you - I guess you meant that local. I tried that, but since my  
error was in the call... anyway.


Please consider the following nearly-minimal example:

\starttext

\startluacode
userdata = userdata or {}

userdata.invoice = { sum = 0, hours = 0, perhour = 100 }

function userdata.numberformat(amount)
context(string.gsub(string.format(\%.2f, amount), %., ,))
end

function userdata.InvoiceLine(text, hours)
context.NC()
context(text)
context.NC()
userdata.numberformat(hours)
context(\\,h)
context.NC()
context.NC()
userdata.numberformat(hours * userdata.invoice.perhour)
context(\\,€)
context.NC()
context.NR()
	userdata.invoice.sum = userdata.invoice.sum + hours *  
userdata.invoice.perhour

userdata.invoice.hours = userdata.invoice.hours + hours
end

function userdata.InvoiceSumLine(text)
context.HL()
context.NC()
context(text)
context.NC()
userdata.numberformat(userdata.invoice.hours)
context(\\,h)
context.NC()
userdata.numberformat(userdata.invoice.perhour)
context(\\,€/h)
context.NC()
userdata.numberformat(userdata.invoice.sum)
context(\\,€)
context.NC()
context.NR()
end

\stopluacode

\starttabulate[|lw(8cm)|rg(,)w(2cm)|rg(,)w(2cm)|rg(,)w(3cm)|]
%\ctxlua{userdata.InvoiceLine(Play with \\LUATEX, 2.5)}
\ctxlua{userdata.InvoiceLine(Do some \\CONTEXT, 0.5)}
\ctxlua{userdata.InvoiceSumLine(Sum)}
\stoptabulate

\stoptext


That seems to work so far, but invoice.hours and invoice.sum are  
always doubled!

In my letter setup, it’s even quadrupled!
I guess my functions gets called several times, but how can I avoid  
that?



Greetlings from Lake Constance!
Hraban
---
http://www.fiee.net/texnique/
http://wiki.contextgarden.net
https://www.cacert.org (I'm an assurer)

___
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] Learning LuaTeX : Invoice

2011-02-20 Thread Wolfgang Schuster

Am 20.02.2011 um 13:58 schrieb Henning Hraban Ramm:

 \starttabulate[|lw(8cm)|rg(,)w(2cm)|rg(,)w(2cm)|rg(,)w(3cm)|]
 %\ctxlua{userdata.InvoiceLine(Play with \\LUATEX, 2.5)}
 \ctxlua{userdata.InvoiceLine(Do some \\CONTEXT, 0.5)}
 \ctxlua{userdata.InvoiceSumLine(Sum)}
 \stoptabulate

\startluacode
context.starttabulate({|lw(8cm)|rg(,)w(2cm)|rg(,)w(2cm)|rg(,)w(3cm)|})
userdata.InvoiceLine(Do some \\CONTEXT, 0.5)
userdata.InvoiceSumLine(Sum)
context.stoptabulate()
\stopluacode

 That seems to work so far, but invoice.hours and invoice.sum are always 
 doubled!
 In my letter setup, it’s even quadrupled!
 I guess my functions gets called several times, but how can I avoid that?

The content of tabulate is processed twice to get the information for
“p” columns and you get therefore the wrong values in the last row.

Wolfgang

___
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] Learning LuaTeX : Invoice

2011-02-20 Thread Henning Hraban Ramm

Am 2011-02-20 um 13:58 schrieb Henning Hraban Ramm:

That seems to work so far, but invoice.hours and invoice.sum are  
always doubled!

In my letter setup, it’s even quadrupled!
I guess my functions gets called several times, but how can I avoid  
that?


I found a better approach, but with the letter module involved, my  
RegisterItem is called twice!


\starttext
\usemodule[letter]

\startluacode
userdata = userdata or {}

userdata.invoice = { amount = 0, hours = 0, perhour = 100, items = {} }

function userdata.numberformat(amount)
context(string.gsub(string.format(\%.2f, amount), %., ,))
end

function userdata.InvoiceLine(text, hours)
context.NC()
context(text)
context.NC()
userdata.numberformat(hours)
context(\\,h)
context.NC()
context.NC()
userdata.numberformat(hours * userdata.invoice.perhour)
context(\\,€)
context.NC()
context.NR()
end

function userdata.InvoiceSumLine(text)
context.HL()
context.NC()
context(text)
context.NC()
userdata.numberformat(userdata.invoice.hours)
context(\\,h)
context.NC()
context(à )
userdata.numberformat(userdata.invoice.perhour)
context(\\,€/h)
context.NC()
userdata.numberformat(userdata.invoice.amount)
context(\\,€)
context.NC()
context.NR()
end

function userdata.RegisterItem(text, hours)
for no, item in ipairs(userdata.invoice.items) do
		-- we need to check for double registering due to some call logic of  
ConTeXt and the letter module

if item.text == text then
--return -- commented to show double calling
end
end
table.insert(userdata.invoice.items, {text=text, hours=hours})
end

function userdata.Invoice()
local amountsum, hoursum = 0,0
	context(\\starttabulate[|lw(8cm)|rg(,)w(2cm)|rg(,)w(2cm)| 
rg(,)w(3cm)|])

for no, item in ipairs(userdata.invoice.items) do
userdata.InvoiceLine(item.text, item.hours)
hoursum = hoursum + item.hours
amountsum = amountsum + item.hours * userdata.invoice.perhour
end
userdata.invoice.hours = hoursum
userdata.invoice.amount = amountsum
userdata.InvoiceSumLine(Sum)
context.stoptabulate()
end

\stopluacode

\startletter[subject={INVOICE}]

\startluacode

userdata.RegisterItem(Do some \\CONTEXT , 0.5)
userdata.RegisterItem(Do some \\LUATEX , 1.5)

userdata.Invoice()

\stopluacode

\stopletter

\stoptext



Greetlings from Lake Constance!
Hraban
---
http://www.fiee.net/texnique/
http://wiki.contextgarden.net
https://www.cacert.org (I'm an assurer)

___
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] Learning LuaTeX : Invoice

2011-02-20 Thread Wolfgang Schuster

Am 20.02.2011 um 14:29 schrieb Henning Hraban Ramm:

 I found a better approach, but with the letter module involved, my 
 RegisterItem is called twice!

The letter modules does trialtypesetting of the content to get the content
of the \cc, \encl and \ps commands. To prevent that certain commands and
environments are preprocessed you can wrap them in

\iftrialtypesetting \else
...
\fi

or

\unless\iftrialtypesetting
...
\fi

@Hans: Is it possible to write the above like this

\startnotmode[trialtypesetting]
...
\stopnotmode

Wolfgang

___
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] Learning LuaTeX : Invoice

2011-02-20 Thread Henning Hraban Ramm


Am 2011-02-20 um 14:41 schrieb Wolfgang Schuster:



Am 20.02.2011 um 14:29 schrieb Henning Hraban Ramm:

I found a better approach, but with the letter module involved, my  
RegisterItem is called twice!


The letter modules does trialtypesetting of the content to get the  
content
of the \cc, \encl and \ps commands. To prevent that certain commands  
and

environments are preprocessed you can wrap them in

\iftrialtypesetting \else
...
\fi

or

\unless\iftrialtypesetting
...
\fi



Thank you, but how does that map to Lua? I couldn't find  
trialtypesetting in the LuaTeX manual.

I tried
if context.trialtypesetting() then return end
but get only undefined control sequence.


context.iftrialtypesetting()
do
return
end
context.fi()

can't work, of course (Incomplete \iffalse)

Greetlings from Lake Constance!
Hraban
---
http://www.fiee.net/texnique/
http://wiki.contextgarden.net
https://www.cacert.org (I'm an assurer)

___
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] Learning LuaTeX : Invoice

2011-02-20 Thread Hans Hagen

On 20-2-2011 2:41, Wolfgang Schuster wrote:


Am 20.02.2011 um 14:29 schrieb Henning Hraban Ramm:


I found a better approach, but with the letter module involved, my 
RegisterItem is called twice!


The letter modules does trialtypesetting of the content to get the content
of the \cc, \encl and \ps commands. To prevent that certain commands and
environments are preprocessed you can wrap them in

\iftrialtypesetting \else

\fi

or

\unless\iftrialtypesetting

\fi

@Hans: Is it possible to write the above like this

\startnotmode[trialtypesetting]

\stopnotmode


it's a system mode, so

\startnotmode[*trialtypesetting] ...

and in lua

if tex.systemmodes.trialtypesetting then ...

but, you need to use \settrialtypesetting (see syst-aux.mkiv) as there 
is more than the \if now (too late to get rid of the if)


Hans

-
  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] Learning LuaTeX : Invoice

2011-02-20 Thread Hans Hagen

On 20-2-2011 3:49, Henning Hraban Ramm wrote:


trialtypesetting in the LuaTeX manual.


things like this are not part of luatex but of context so you need the 
cld manual (or wait till more documentation shows up, or ask ..)



context.iftrialtypesetting()
do
return
end
context.fi()

can't work, of course (Incomplete \iffalse)


please not that kind of horrible misuse of the context.* namespace
as you don't want to end up with expandafter's at that end

Hans

-
  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] Learning LuaTeX : Invoice

2011-02-20 Thread Henning Hraban Ramm

Am 2011-02-20 um 16:09 schrieb Hans Hagen:


it's a system mode, so

\startnotmode[*trialtypesetting] ...

and in lua

if tex.systemmodes.trialtypesetting then ...

but, you need to use \settrialtypesetting (see syst-aux.mkiv) as  
there is more than the \if now (too late to get rid of the if)


You mean, Wolfgang must set it in his module? I guess he did.

At least this works as expected:

function userdata.RegisterItem(text, hours)
if tex.systemmodes.trialtypesetting then return end
table.insert(userdata.invoice.items, {text=text, hours=hours})
end

Thank you!


Am 2011-02-20 um 16:12 schrieb Hans Hagen:


On 20-2-2011 3:49, Henning Hraban Ramm wrote:


trialtypesetting in the LuaTeX manual.


things like this are not part of luatex but of context so you need  
the cld manual (or wait till more documentation shows up, or ask ..)


Ah, I guess the CLD manual was what I was looking for all the time ;-)

I suggest you mention tex.systemmodes.trialtypesetting in section 3.3.  
trial typesetting - the return true approach didn't help in my  
case (or I didn't understand it).



I'll wikify my invoice sample soon. LuaTeX docs in the wiki are a bit  
scattered ATM... (e.g. Lua, LuaTeX, CLD and MkIV all explain LuaTeX  
basics)



Greetlings from Lake Constance!
Hraban
---
http://www.fiee.net/texnique/
http://wiki.contextgarden.net
https://www.cacert.org (I'm an assurer)

___
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] Learning LuaTeX : Invoice

2011-02-20 Thread Philipp Gesang
Hi Hraban!

On 2011-02-20 20:16:03, Henning Hraban Ramm wrote:
 … /
 I'll wikify my invoice sample soon. LuaTeX docs in the wiki are a
 bit scattered ATM... (e.g. Lua, LuaTeX, CLD and MkIV all explain
 LuaTeX basics)

“Lua” is intended to be some kind of portal for all topics
related to Lua programming in Luatex. As opposed to “Luatex”
which should have a focus on typesetting-specific stuff, new
primitives and everything else revolutionary that Luatex offers.
“CLD” is *very* specific and basically just a demonstration for
what a wiki reader might expect in the manual. “MkIV” seems
outdated but I have no idea what content should go there. (Btw.
there’s also a page “programming in luatex”…)

Personally I would prefer that the distinction between the
categories typesetting and Lua scripting be emphasized, e.g. that
info on using the token, node or tex libs goes into the former
(or the Luatex wiki…) whereas Lua-based approaches to stuff that
used to be hacked in Tex macros would go into the latter. Does
this make sense?

Anyways, looking forward to see your invoice code

Philipp


 Greetlings from Lake Constance!
 Hraban
 ---
 http://www.fiee.net/texnique/
 http://wiki.contextgarden.net
 https://www.cacert.org (I'm an assurer)
 
 ___
 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
 ___


pgpSgDZohoSwG.pgp
Description: PGP signature
___
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] Learning LuaTeX : Invoice

2011-02-20 Thread Wolfgang Schuster

Am 20.02.2011 um 21:20 schrieb Philipp Gesang:

 Anyways, looking forward to see your invoice code

It would be more interesting to have something like luacalc [1] available
in context. As it is only another kind of table one could insert the data
with a syntax like this

\startspreadsheet
  \startrow
\startcell 3 \stopcell
\startcell 5 \stopcell
\startcell = A1 + A3 \stopcell
  \stoprow
\stopspreadsheet

and the final result is printed with a natural table.

[1] http://luacalc.sourceforge.net/

Wolfgang

___
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] Learning LuaTeX : Invoice

2011-02-20 Thread Hans Hagen

On 20-2-2011 9:28, Wolfgang Schuster wrote:


Am 20.02.2011 um 21:20 schrieb Philipp Gesang:


Anyways, looking forward to see your invoice code


It would be more interesting to have something like luacalc [1] available
in context. As it is only another kind of table one could insert the data
with a syntax like this

\startspreadsheet
   \startrow
 \startcell 3 \stopcell
 \startcell 5 \stopcell
 \startcell = A1 + A3 \stopcell
   \stoprow
\stopspreadsheet

and the final result is printed with a natural table.


See attached file.

For this to work ok we need a reset hook into TABLE but it shows the 
principle.


I think that we should stick close to lua so it's mostly a matter of tex 
interfacing. I can even imagine named sheets so that results can be 
recalled later on.


A nice distraction from more complex coding as this is rather simple so 
I'll think a bit about it.


Hans

-
  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
-
% an experiment, no module yet

\startluacode
local byte, format = string.byte, string.format

spreadsheets = { }

local mt = {
__index = function(t,k)
local v = { }
setmetatable(v,mt)
t[k] = v
return v
end,
}

function spreadsheets.reset()
spreadsheets.data = { }
setmetatable(spreadsheets.data,mt)
end

spreadsheets.reset()

-- I'll make a nice lpeg

local offset = byte(A) - 1

local function execute(r,c,str)
str = string.gsub(str,([A-Z]),function(s)
return format(spreadsheets.data[%s],byte(s)-offset)
end)
-- todo: error checking + report
local result = loadstring(return .. str)
result = result and result() or 0
spreadsheets.data[c][r] = result
return result
end

function spreadsheets.set(r,c,str)
execute(r,c,str)
end

function spreadsheets.get(r,c,str)
local result = execute(r,c,str)
if result then
context(result)
end
end
\stopluacode

\def\resetspreadsheet{\ctxlua{spreadsheets.reset()}}
\def\setspreadsheet#1{\ctxlua{spreadsheets.set(\number\tblrow+1,\number\tblcol,#1)}}
\def\getspreadsheet#1{\ctxlua{spreadsheets.get(\number\tblrow+1,\number\tblcol,#1)}}

% we need an everyTABLE

\let\set\setspreadsheet
\let\get\getspreadsheet

\starttext

\bTABLE[align=middle]
   \bTR
 \bTD \get{100} \eTD \bTD test \set{30} \eTD
   \eTR
   \bTR
 \bTD \get{20} \eTD \bTD \get{4+3} \eTD
   \eTR
   \bTR
 \bTD \get{A[1] + A[2]} \eTD
 \bTD \get{B[1] + B[2]} \eTD
   \eTR
   \bTR
 \bTD[nx=2] \bf \get{A[3] + B[3]} \eTD
   \eTR
\eTABLE

\def\startspreadsheet#1\stopspreadsheet
  {\resetspreadsheet
   \bTABLE#1\eTABLE}

\def\startrow#1\stoprow
  {\bTR#1\eTR}

\def\startcell#1\stopcell
  {\bTD\get{#1}\eTD}

\startspreadsheet
   \startrow
 \startcell 3 \stopcell
 \startcell 5 \stopcell
 \startcell A[1] + B[1] \stopcell
   \stoprow
\stopspreadsheet

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


Re: [NTG-context] learning LuaTeX (was: Hans' presentation: using plain TEX (from TUG 2009) [apologies if OT])

2010-04-04 Thread Graham Douglas

Hello Patrick

who said...

Besides the gdb part, this is pretty much how I learned LuaTeX 
(still on my path). I suggest you stay with plain, then add features 
as you go along:


 * write your own font handler (see the bluewiki page) - LuaTeX 
supports many different kinds of fonts

* write your own kpathsea module (and thus replace kpathsea)
* do a nodelist traversal and find out about the different node types
* create a nodelist and write it out to TeX (node.write(...))
* use tex.linebreak() for creating a paragraph.
...

Good to know that I'm not the only one going down the simple
path. My plans are indeed along the lines you indicate. I have the
utmost admiration and respect for the work that has gone into ConTeXt, a 
great piece of work. For now, I just need to get back to the very 
basics and a minimal installation of LuaTeX with plain seems to do that

nicely, for now.

 If you understand german or use google translate, have a look at

 http://www.luatex.de

Sadly, I do not read German, a real pity as there are some interesting
bits of code on there. Google Translate, here I come :-)

Warm regards and thanks again for your time to reply.

Cheers!

Graham

___
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] learning LuaTeX (was: Hans' presentation: using plain TEX (from TUG 2009) [apologies if OT])

2010-04-03 Thread Patrick Gundlach
Hello Graham,

 Thank you for your commnts. Oh, for sure, tinkering with
 plain is just an interim step along the (long...) road. A very minimal 
 harness setup to write minimal code --- to play with the various LuaTeX API 
 functions via GNU's gdb debugger. By building a small test 
 environment/playground from scratch, including compiling LuaTeX, and
 hacking together a basic TDS, gives me a way to learn about stuff like 
 kpathsea etc.

Besides the gdb part, this is pretty much how I learned LuaTeX (still on my 
path). I suggest you stay with plain, then add features as you go along:

* write your own font handler (see the bluewiki page) - LuaTeX supports many 
different kinds of fonts
* write your own kpathsea module (and thus replace kpathsea)
* do a nodelist traversal and find out about the different node types
* create a nodelist and write it out to TeX (node.write(...))
* use tex.linebreak() for creating a paragraph.
...

Hans' font stuff is rather advanced and therefore complex (IIRC  1 lines 
of code), so don't try to understand it as your first exercise.

There is no need to use ConTeXt if all you want is knowledge of the LuaTeX API. 
If you understand german or use google translate, have a look at

http://www.luatex.de

Patrick

___
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] Learning ConTeXt

2007-08-20 Thread Istvan Hollerbach
Hi Everybody,

I want to learn ConTeXt, but 'cont-enp.pdf' and 'mp-cb-en.pdf' do not 
explain many things in detail, for example the parameters of command 
\setuplayout on the page 24 of cont-enp.pdf. Or am I careless? How shall 
I start to learn? And how shall I go on learning?

Best regards,
Istvan Hollerbach

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


Re: [NTG-context] Learning ConTeXt

2007-08-20 Thread Liesbeth van der Plas
I included an example context file from Sanjoy Mahajan.

Best regards,
Liesbeth van der Plas


2007/8/20, Istvan Hollerbach [EMAIL PROTECTED]:

 Hi Everybody,

 I want to learn ConTeXt, but 'cont-enp.pdf' and 'mp-cb-en.pdf' do not
 explain many things in detail, for example the parameters of command
 \setuplayout on the page 24 of cont-enp.pdf. Or am I careless? How shall
 I start to learn? And how shall I go on learning?

 Best regards,
 Istvan Hollerbach


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

 ___




-- 
[EMAIL PROTECTED]
www.wiskunde-interactief.nl


simpel.tex
Description: TeX document
___
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  : https://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] Learning ConTeXt

2007-08-20 Thread Saji Njarackalazhikam Hameed
Hi Istvan,

For somebody used to LaTeX, it may be useful to check up

http://www.berenddeboer.net/tex/

there is an article about doing similar things in LaTeX and
ConTeXt.

The options relevant to all ConTeXt commands are provided towards the
end of cont-en?.pdf

Perhaps mp-cb-en.pdf should be read first. I started out doing regular
stuff such as formatting tables, sections, columns and the like. For
more detailed control, it may be better to dwelve into some of the
more specialized manuals archived at context.pragma.de

The following website also may be of interest to you:

http://levana.de/context/
 
And then there is the wiki:

http://wiki.contextgarden.net

I think the best way to learn is by trying to make the document you want
in ConTeXt and asking questions to the mailing list when you cannot figure out
how to do it.

hope it helps,

saji
...

* Istvan Hollerbach [EMAIL PROTECTED] [2007-08-20 12:24:04 +0200]:

 Hi Everybody,
 
 I want to learn ConTeXt, but 'cont-enp.pdf' and 'mp-cb-en.pdf' do not 
 explain many things in detail, for example the parameters of command 
 \setuplayout on the page 24 of cont-enp.pdf. Or am I careless? How shall 
 I start to learn? And how shall I go on learning?
 
 Best regards,
 Istvan Hollerbach
 
 ___
 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  : https://foundry.supelec.fr/projects/contextrev/
 wiki : http://contextgarden.net
 ___

-- 
Saji N. Hameed

APEC Climate Center +82 51 668 7470
National Pension Corporation Busan Building 12F 
Yeonsan 2-dong, Yeonje-gu, BUSAN 611705 [EMAIL PROTECTED]
KOREA
___
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  : https://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] Learning ConTeXt

2007-08-20 Thread George N. White III
On 8/20/07, Saji Njarackalazhikam Hameed [EMAIL PROTECTED] wrote:

 [...]
 And then there is the wiki:

 http://wiki.contextgarden.net

Highly recommended.

 I think the best way to learn is by trying to make the document you want
 in ConTeXt and asking questions to the mailing list when you cannot figure out
 how to do it.

Another strategy is to find a document that can serve as a template for
what you need.   The wiki provides examples of fragments to do a particular
task, and there are lots of examples of complete documents available,
including the pdftex manual and various slide presentations.

 * Istvan Hollerbach [EMAIL PROTECTED] [2007-08-20 12:24:04 +0200]:

  Hi Everybody,
 
  I want to learn ConTeXt, but 'cont-enp.pdf' and 'mp-cb-en.pdf' do not
  explain many things in detail, for example the parameters of command
  \setuplayout on the page 24 of cont-enp.pdf. Or am I careless? How shall
  I start to learn? And how shall I go on learning?
 
  Best regards,
  Istvan Hollerbach


-- 
George N. White III [EMAIL PROTECTED]
Head of St. Margarets Bay, Nova Scotia
___
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  : https://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] Learning ConTeXt

2007-08-20 Thread Aditya Mahajan
On Mon, 20 Aug 2007, Istvan Hollerbach wrote:

 Hi Everybody,

 I want to learn ConTeXt, but 'cont-enp.pdf' and 'mp-cb-en.pdf' do not
 explain many things in detail, for example the parameters of command
 \setuplayout on the page 24 of cont-enp.pdf. Or am I careless? How shall
 I start to learn? And how shall I go on learning?

Specifically for page layout, you may find Paul Tremblay's tutorial 
page useful.
http://getfo.org/context_xml/index.html

It is about using xml, but does explains the context's page layout 
terminology in detail.

http://getfo.org/context_xml/page3.html

Aditya


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


Re: [NTG-context] Learning ConTeXt

2007-08-20 Thread Istvan Hollerbach
Dear Aditya,

I found that page yesterday and saved all the document.

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


[NTG-context] Learning

2006-05-30 Thread Johan Blixt-Dackhammar
Hi,

I'm trying to learn ConTeXt and has so far read parts of the manuals
available on the website (http://www.pragma-ade.com). However, I feel
that these manuals only give me a quite limited knowledge.

Therefore I wonder if there are any chance that the source code for
some advanced documents are available on the internet. Some of the
really well designed manuals (eg. XML in ConTeXt, Charts in
ConTeXt and ConTeXt - an excursion) or other documents with a high
level of design.

On to another subject, I'm having trouble using the chart module. I
get no errors while typesetting, but the flowcharts doesn't show up.
The only command that showed anything among the ones I tried was
\FLOWchart[grid]. Has the commands changed since the chart
manual(Charts uncovered) was written?

-Johan
___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context


Re: [NTG-context] Learning

2006-05-30 Thread Mojca Miklavec
On 5/30/06, Johan Blixt-Dackhammar wrote:

 Therefore I wonder if there are any chance that the source code for
 some advanced documents are available on the internet. Some of the
 really well designed manuals (eg. XML in ConTeXt, Charts in
 ConTeXt and ConTeXt - an excursion) or other documents with a high
 level of design.

On http://wiki.contextgarden.net/Official_ConTeXt_Documentation you
have some links on the top of the pabe (probably not so well visible).
You can either use SVN from svn://ctx.pragma-ade.nl/manuals
(http://tortoisesvn.tigris.org/ can help you on Windows) or download
them from Taco's mirror ([http://context.aanhet.net/svn/).

Not all the manuals are available there, but it should be enough for beginning.

Mojca
___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context


[NTG-context] Learning

2006-05-30 Thread Johan Blixt-Dackhammar
Hi,

I'm trying to learn ConTeXt and has so far read parts of the manuals
available on the website (http://www.pragma-ade.com). However, I feel
that these manuals only give me a quite limited knowledge.

Therefore I wonder if there are any chance that the source code for
some advanced documents are available on the internet. Some of the
really well designed manuals (eg. XML in ConTeXt, Charts in
ConTeXt and ConTeXt - an excursion) or other documents with a high
level of design.

On to another subject, I'm having trouble using the chart module. I
get no errors while typesetting, but the flowcharts doesn't show up.
The only command that showed anything among the ones I tried was
\FLOWchart[grid]. Has the commands changed since the chart
manual(Charts uncovered) was written?

-Johan
___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context


Re: [NTG-context] Learning

2006-05-30 Thread Willi Egger
Hi Johan,

Johan Blixt-Dackhammar wrote:
 Hi,

 I'm trying to learn ConTeXt and has so far read parts of the manuals
 available on the website (http://www.pragma-ade.com). However, I feel
 that these manuals only give me a quite limited knowledge.

 Therefore I wonder if there are any chance that the source code for
 some advanced documents are available on the internet. Some of the
 really well designed manuals (eg. XML in ConTeXt, Charts in
 ConTeXt and ConTeXt - an excursion) or other documents with a high
 level of design.

   
As Mojca mentioned ...
 On to another subject, I'm having trouble using the chart module. I
 get no errors while typesetting, but the flowcharts doesn't show up.
 The only command that showed anything among the ones I tried was
 \FLOWchart[grid]. Has the commands changed since the chart
 manual(Charts uncovered) was written?

   
In order to get the grid, you need to set the option test and tell how 
the grid should look like:

\usemodule[chart]


\starttext
\setupFLOWcharts
[option=test,
nx=4,
ny=4,
dx=2\bodyfontsize,
dy=2\bodyfontsize,
width=12\bodyfontsize,
height=7\bodyfontsize,
maxwidth=\textwidth]

\startFLOWchart[grid]
\startFLOWcell
\name{1}
\location{1,1}
\shape{product}
\text{NONE}
\stopFLOWcell
\stopFLOWchart
\FLOWchart[grid]
\stoptext

Kindr regards

Willi

 -Johan
 ___
 ntg-context mailing list
 ntg-context@ntg.nl
 http://www.ntg.nl/mailman/listinfo/ntg-context
   
___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context


Re: [NTG-context] learning path

2005-10-28 Thread Mojca Miklavec
olivier Turlier wrote:
 
 Hi everybody,
 
 I wish to set up kind of a learning path (= pedagogic progression
 bar, like in http://www.dokeos.com/scorm_compliant_course_content.php)

/.../

 Sorry for not being clear enough.

 learning path is an acronym I've found while using Dokeos elearning
 platform, as an equivalent to a course i guess. For creating a
 course/learning path  you assemble differents documents in a l.p.. When
 the alumni/trainee reads this course, he will be able what he have to
 read next after the fisrt doc, and so on. I've made a graphic capture of
 the webpage for showing what elements are making a learning path in the
 Dokeos vision : list of doc allready readen, docs to read, progression
 bar, plus the breadcrumb trail;

for lists of already learnt documents: you can make a list of
chapters/sections/subsections somewhere on the page if you have enough
place. If you would like to get the chapter/section/subsection name,
you can get them with something like
\getmarking[chapter] $$ \getmarking[section] $$ \getmarking[subsection]
Perhaps some ifs are missing to check if a section/subsection is
defined, but someone else has to help you with it.

 i don't want to put so much stuff in the pdfs made wit Context(apart
 putting an A4 text on an A3 page!) because i keep a printable A4 format
 for my courses, even i there interaction in it, for screen usage.

I'm not sure if I understood it properly, but if you need two
different versions of your documents with the same content, but
different layout, you can use modes
(http://wiki.contextgarden.net/Modes).

 So i wish to have only vertical progression bars + percentage in the
 inner margin. s-pre-01 original style show a bottom interaction bar
 filled with pagenumbers drawn as little rectangles. Maybe it's possible
 to draw a continuous bar with metapost, but for percentage ?

 Ideally, i wish to have 2 progression bars : one for project progression
 and second for product prog.

How would you calculate the project progression? The example below
calculates the percentage out of the number of pages in the current
document.

Here's an example how to make an extremely simple and ugly progression
bar at the bottom of the page. Take a look into the .mp file produced.
You'll find many other variables thay you may use to position your
progression bar properly.

\defineoverlay
  [ProgressBar A]
  [\useMPgraphic{ProgressBarA}]
\setupbackgrounds
  [text]
  [background={ProgressBar A}]

\startuseMPgraphic{ProgressBarA}
barW = 5cm;
barH = .7cm;

StartPage;
   fill unitsquare xyscaled(barW*(PageNumber/NOfPages),barH)
  withcolor .625red;
   draw unitsquare xyscaled(barW,barH);
   label.rt(textext($  decimal(round(100*PageNumber/NOfPages)) 
  \,\%$), (barW,.5barH));
   currentpicture := currentpicture shifted
(LeftMarginWidth+LeftMarginDistance,2cm);
StopPage;
\stopuseMPgraphic

\starttext

first page\page
second page\page
third page

\stoptext


I would suggest you to get familiar with metapost/metafun (learning
metapost by doing, the metapost manual, metafun manual, ...) if
you aren't yet. It's a simple and great programming/drawing language
and you can do amazing things with it.

Mojca


PS: just a note. Trying to execute the code written above under MikTeX
(on the old ;) ConTeXt version, 2005.08.31) leads to distrous
results and nothing worked as expected. It claims
\loadfontfileoncetrue to be undefined command, it complains about file
endings (it doesn't create .mpx files, so the label(textext ...)
doesn't work) ... and so on. It may be that something is wrongly
configured here, but I'm glad that I'm able to use the minimal ConTeXt
distr. as an alternative when something fails under MikTeX.
___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context


[NTG-context] Learning ConTeXt, typical hurdle

2005-03-10 Thread Gerben Wierda
Maybe I should start a blog somewhere...

Anyway, I have started my conversion to ConTeXT project.

So, I used the fiee perl script to set up my project. Then I started to
fill things in. Everything is still in one directory (I do not understand
directory searching in ConTeXt yet and I haven't seen a example for a book
project).

So, I have a project file:

===
% output=pdf interface=en
\usemodule[bib]
\startproject project_teoada
\environment env_teoada

%  \showlayout
%  \showgrid
%  \showbodyfontenvironment

\product prd_book
\stopproject
===

A product file:

===
\startproduct prd_book
\project project_teoada

\startfrontmatter
\component c_introduction
\stopfrontmatter
\component c_chapter1
\component c_chapter2
\component c_chapter3
\component c_chapter4
\component c_chapter5
\component c_chapter6
\component c_chapter7
\startbackmatter
\component c_appendixa
\component c_appendixb
\stopbackmatter
\stopproduct
===

I defined a description environment to replace LaTeX's description. In the
environment file:
===
\startenvironment env_teoada
\project project_teoada

\definedescription [description]
[location=hanging, margin=standard, headstyle=bold]
\definestartstop [descriptions] [before=\blank\startpacked,
after=\stoppacked\blank]

\stopenvironment
===

And I put some info in c_introduction.tex. There I used the description
thingy:

===
\startcomponent c_introduction
\product prd_book
\project project_teoada

\starttext
\chapter[h:guide]{Guide}

\startdescriptions
\description{Chapter \in[h:ch1]} Bla bla
\description{Chapter \in[h:ch2]} Bla bla
\stopdescriptions

\stoptext

\stopcomponent
===

Now, this fails. Why? I was completely stumped. I get an error message I
do not understand:

references  : unknown reference [][h:ch2]
! Extra }, or forgotten \endgroup.
\stopdescriptions -\dostopattributes \egroup
  \getvalue {\??be
descriptions\...
argument Bla bla \stopdescriptions
 \@@stopdescription
{description}\stoptext

\dodowithpar ...cription}[]{Chapter \in [h:ch2]}#1
  \@@stopdescription
{descri...
l.14

? x

Now what turns out to solve this? Empty lines before \description and
\stopdescriptions

Though I like ConTeXt if I look at certain design aspects, behaviour that
depends on whitespace before a command frightens me.

G

___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context