Re: [NTG-context] Marking a textfragment for later reference

2012-08-07 Thread Robert Blackstone

On 6 aug. 2012, Robert Blackstone blackstone.rob...@gmail.com
wrote
 
 On 6 aug. 2012, Mon, 6 Aug 2012 14:16:09 +020
 Wolfgang Schuster wolfgang.schus...@gmail.com wrote
 Am 06.08.2012 um 09:41 schrieb Robert Blackstone 
 blackstone.rob...@gmail.com:
 
 Thank you Marco. Another very useful tool for me. I realize now that many 
 things with labels can be used as anchors for references, and I'm still a 
 bit surprised that a delimited text with a label cannot be used that way.
 
 Where has the delimited text in your example a label?
 
 Wolfgang
 
 
 I had not included a minimal example but I had run some trials. Since they 
 did not work, and you gave me a good solution, I trashed them. I kept the 
 pdf's though, in which I included the source. So I can reconstruct the 
 examples.
 I'll try to make it again tomorrow morning. I would be interested to learn 
 what sort of errors I committed.
 Kind regards,
 Robert Blackstone


Here follows my minimal example. I reasoned that the identifier [topica] might 
act as a label, or an anchor, or whatever the correct ConTeXt name is, for a 
reference.
---

\definedelimitedtext[topica]
\setupdelimitedtext[topica][left=,right=] %maybe superfluous? I do not need a 
layout different from the rest of the text.
\starttext

 Some text.

\starttopica
Some text to explain a certain topic, called topica.
\stoptopica

Some more text about topica. (See discussion on \at{page}[topica])

\stoptext

---
To avoid any misunderstanding: this is no longer a problem since I have been 
given excellent advice. But it intrigues me. Why can some identifiers, for 
example of figures, be used for internal references and others not?

Best regards,
Robert Blackstone
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] Marking a textfragment for later reference

2012-08-07 Thread Pontus Lurcock
On Tue 07 Aug 2012, Robert Blackstone wrote:

 Here follows my minimal example. I reasoned that the identifier [topica] 
 might act as a label, or an anchor, or whatever the correct ConTeXt name is, 
 for a reference.
 ---
 
 \definedelimitedtext[topica]
 \setupdelimitedtext[topica][left=,right=] %maybe superfluous? I do not need a 
 layout different from the rest of the text.
 \starttext
 
  Some text.
 
 \starttopica
 Some text to explain a certain topic, called topica.
 \stoptopica
 
 Some more text about topica. (See discussion on \at{page}[topica])
 
 \stoptext
 
 ---
 To avoid any misunderstanding: this is no longer a problem since I have been 
 given excellent advice. But it intrigues me. Why can some identifiers, for 
 example of figures, be used for internal references and others not?

In this case, I'd say it's because you're defining a delimited text
style which can be used in multiple places. Your document could have
five hundred \starttopica...\stoptopica blocks on different pages.
A figure identifier, on the other hand, is meant to be unique.

Pont
___
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] [Dev-luatex] new/missing feature in luamplib

2012-08-07 Thread Hans Hagen

On 7-8-2012 09:29, Keith J. Schultz wrote:

Hi Manuel, Everybody,

I am just getting into LuaLaTeX.

I needed to do some work with MetaPost.

While working I came across a kudo. That is once inside the mblibcode
environment one can not call Lua. THIS I consider a missing feature and
a VERY important one.


Some (simple) support for lua calls is on the (long term) agenda but not 
before the current mplib extensions project is done (i.e. the decimal 
calculation plugins).


Calling lua in itself is not so much an issue; after all one can just do 
a \directlua inside a blob of mp passed to mplib (I do that all the 
time). For an lua 'primitive' in mplib (which then probably would just 
be called just 'lua') we first need to figure out:


1 - how to access mp internals (and that relates to the mentioned 
decimal extensions, as we might need to get and set)

2 - if and how we can share the state with the (main) tex lua instance
3 - how we want to print back to mp (like tex.[s]print)

It's one of those feature we have discussed (maybe too) long ago, but 
because it has to be more than just (3) it never ended up first on the 
todo list (first finishing the main lib).


The problem with these things is that it has to be mostly 'right from 
the start' in order not to conflict too much with long term usage).


Anyhow, if you play with such things, best have something

  lua mp.print(123)

Given mp's somewhat different parsing and expansion compared to tex 
there are also some conceptual issues involved. It also relates to input 
buffers (and file reading) and io is somewhat messy in mp and on the 
agenda for cleaning up.


(Luigi Scarso has done this with metafont, so that might be a starting 
point for experimenting.)


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] [Dev-luatex] new/missing feature in luamplib

2012-08-07 Thread Taco Hoekwater
Hi,

On Aug 7, 2012, at 10:12 AM, Hans Hagen wrote:

 On 7-8-2012 09:29, Keith J. Schultz wrote:
 Hi Manuel, Everybody,
 
 I am just getting into LuaLaTeX.
 
 I needed to do some work with MetaPost.
 
 While working I came across a kudo. That is once inside the mblibcode
 environment one can not call Lua. THIS I consider a missing feature and
 a VERY important one.
 
 Some (simple) support for lua calls is on the (long term) agenda but not 
 before the current mplib extensions project is done (i.e. the decimal 
 calculation plugins).
 
 Calling lua in itself is not so much an issue; after all one can just do a 
 \directlua inside a blob of mp passed to mplib (I do that all the time). 

I was under the impression that this was all that the proposed patch does. 
Luamplib
did not allow any (tex nor lua) escapes within the block, if I understand 
correctly.

Best wishes,
Taco
___
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] [Dev-luatex] new/missing feature in luamplib

2012-08-07 Thread Hans Hagen

On 7-8-2012 10:33, Taco Hoekwater wrote:

Hi,

On Aug 7, 2012, at 10:12 AM, Hans Hagen wrote:


On 7-8-2012 09:29, Keith J. Schultz wrote:

Hi Manuel, Everybody,

I am just getting into LuaLaTeX.

I needed to do some work with MetaPost.

While working I came across a kudo. That is once inside the mblibcode
environment one can not call Lua. THIS I consider a missing feature and
a VERY important one.


Some (simple) support for lua calls is on the (long term) agenda but not before 
the current mplib extensions project is done (i.e. the decimal calculation 
plugins).

Calling lua in itself is not so much an issue; after all one can just do a 
\directlua inside a blob of mp passed to mplib (I do that all the time).


I was under the impression that this was all that the proposed patch does. 
Luamplib
did not allow any (tex nor lua) escapes within the block, if I understand 
correctly.


ok, so it's not a luatex/mplib issue but something for the maintainer of 
that package as deciding what characters need what catcode is a package 
issue (probably obeying \ { } is enough then)


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] Draft version of document

2012-08-07 Thread Roger Mason

Hello Sietse,

On 08/06/12 13:44, Sietse Brouwer wrote:

Hi Roger,

Firstly: drafts are indeed the way to go. \completelistoffigures
places a complete list of figure *captions*, so that takes care of
that.


I have made this reply long because I lack the time to make it short.

Cheers,
Sietse

Many thanks for your thorough reply.  I will try it out over the next 
few days.


Best wishes,
Roger

(who is glad you did not have the time to make it shorter, if you see 
what I mean :-) )


This electronic communication is governed by the terms and conditions at
http://www.mun.ca/cc/policies/electronic_communications_disclaimer_2012.php
___
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] A series of articles about text-editors for the MAPS

2012-08-07 Thread Willi Egger
Dear TeX users and TeX friends,

At one of the last NTG-meetings we discussed possibilities to write a series of 
articles presenting the different text editors used in modern TeX-environments. 

Such an article could have ingredients like availability, general use, 
highlights, issues related to TeX coding and whether it is suitable for 
Plain-tex, Latex, Context, configurability etc.

The idea is to produce a MAPS-issue in color, so that also screenshots can be 
included. 

We have already a couple of volunteers to write on certain editors, however it 
is for sure not a bad idea to include even two articles on the same editor. 
What we definitely are looking for is someone who would be prepared to write an 
article over WinEdt.

I am looking forward hearing from you, kind regards

Willi Egger
Secretary NTG
ntg-secret...@ntg.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] Marking a textfragment for later reference

2012-08-07 Thread Robert Blackstone

On 7 aug. 2012,  Pontus Lurcock p...@talvi.net
wrote
 
 On Tue 07 Aug 2012, Robert Blackstone wrote:
 
 Here follows my minimal example. I reasoned that the identifier [topica] 
 might act as a label, or an anchor, or whatever the correct ConTeXt name is, 
 for a reference.
 ---
 
 \definedelimitedtext[topica]
 \setupdelimitedtext[topica][left=,right=] %maybe superfluous? I do not need 
 a layout different from the rest of the text.
 \starttext
 
 Some text.
 
 \starttopica
 Some text to explain a certain topic, called topica.
 \stoptopica
 
 Some more text about topica. (See discussion on \at{page}[topica])
 
 \stoptext
 
 ---
 To avoid any misunderstanding: this is no longer a problem since I have been 
 given excellent advice. But it intrigues me. Why can some identifiers, for 
 example of figures, be used for internal references and others not?
 
 In this case, I'd say it's because you're defining a delimited text
 style which can be used in multiple places. Your document could have
 five hundred \starttopica...\stoptopica blocks on different pages.
 A figure identifier, on the other hand, is meant to be unique.
 
 Pont
Hi Pont,
Thanks for your comment. I realized this. There would of course be only one 
\starttopica...\stoptopica block in my text. If I would like to use delimited 
texts in this manner for several different topics, I would simply give them 
different names. Each topic its own name, like [topicb], [topicc], etc. Like 
you would do if you wanted to use slightly different types of blockquote in 
your document.
So my question: Why can some identifiers, for example of figures, be used for 
internal references and others not? remains unanswered.
Best regards,
Robert

___
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] Marking a textfragment for later reference

2012-08-07 Thread Sietse Brouwer
Hi Robert,

 So my question: Why can some identifiers,
 for example of figures, be used for internal
 references and others not? remains unanswered.

That would be because there are
* names, for creating a named variant of some command
* and labels, which are used for cross-references,
and I think you are calling them both identifiers. (Not sure I'm using
the official terms, or if there are any.)

Some examples below, I hope they'll clarify things. I never had any
problems confusing labels and names myself, so I'm not sure how to
explain what was obvious to me, but perhaps this will help:

Names occur when you're defining things; Labels occur when you're
placing things.

As for why you can't do

\definedelimitedtext[AA]

\startAA[mylabel]
bla
\stopAA

I guess that was never baked in. Probably because quotations are not
really numbered objects, and so not obvious candidates for having
their own labels.

Cheers,

Sietse

%%% Example: label %
\placefigure
  [here]
  [fig:myfig] % label: used to refer to the figure
  {caption}{figure}

%%% Example: command like \startNAME %
\definedelimitedtext
[smallquote]  % name
[style=small]

\startsmallquote % our own named environment
   bla bla bla
\stopsmallquote

% Example: names and labels %
\useexternalfigure
[littlecow]   % define a named picture
[cow.pdf]
[width=1cm]

\placefigure
[here]
[fig:littlecow]  % a label for the figure float
{Kleine, kleine koe}
{\externalfigure[littlecow]} % invoking a named picture


--
Sietse Brouwer -- sbbrou...@gmail.com -- +31 6 13.456.848
Verlengde Wassenaarseweg 4a -- 2342 BG Oegstgeest -- the Netherlands
MSN: sie...@gawab.com -- ICQ: 341232104


On Tue, Aug 7, 2012 at 11:44 AM, Robert Blackstone
blackstone.rob...@gmail.com wrote:

 On 7 aug. 2012,  Pontus Lurcock p...@talvi.net
 wrote

 On Tue 07 Aug 2012, Robert Blackstone wrote:

 Here follows my minimal example. I reasoned that the identifier [topica] 
 might act as a label, or an anchor, or whatever the correct ConTeXt name 
 is, for a reference.
 ---

 \definedelimitedtext[topica]
 \setupdelimitedtext[topica][left=,right=] %maybe superfluous? I do not need 
 a layout different from the rest of the text.
 \starttext

 Some text.

 \starttopica
 Some text to explain a certain topic, called topica.
 \stoptopica

 Some more text about topica. (See discussion on \at{page}[topica])

 \stoptext

 ---
 To avoid any misunderstanding: this is no longer a problem since I have 
 been given excellent advice. But it intrigues me. Why can some identifiers, 
 for example of figures, be used for internal references and others not?

 In this case, I'd say it's because you're defining a delimited text
 style which can be used in multiple places. Your document could have
 five hundred \starttopica...\stoptopica blocks on different pages.
 A figure identifier, on the other hand, is meant to be unique.

 Pont
 Hi Pont,
 Thanks for your comment. I realized this. There would of course be only one 
 \starttopica...\stoptopica block in my text. If I would like to use 
 delimited texts in this manner for several different topics, I would simply 
 give them different names. Each topic its own name, like [topicb], [topicc], 
 etc. Like you would do if you wanted to use slightly different types of 
 blockquote in your document.
 So my question: Why can some identifiers, for example of figures, be used 
 for internal references and others not? remains unanswered.
 Best regards,
 Robert

 ___
 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
 ___
___
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] Draft version of document

2012-08-07 Thread Sietse Brouwer
Hi Robert,
Debugged and all, here you go.
Cheers,
Sietse

\useexternalfigure[img:fig:cow][cow.pdf]
\useexternalfigure[img:fig:mill][mill.png]

\starttext

\section{Pictures}
% The externalfigure names HAVE TO take the form 'img:FIGURELABEL',
% or the automatic image list at the end on won't be able to
% guess the image names from the figure labels.
\placefigure[here][fig:cow]
{cap-cow}
{\externalfigure[img:fig:cow]}

\section{More pictures}
\placefigure[here][fig:mill]
{cap-mill}
{\externalfigure[img:fig:mill]}


 Lists start here %%%
\enablemode[draft]
\startmode[draft]

% Better list heading --- the captions are what matters
\setupheadtext[figures=List of Captions]
\completelistoffigures

% Now for printing all the images
\section{List of Pictures}
\startluacode
-- we won't need the keys k, but still.
for k,v in pairs(structures.lists.ordered.float.figure) do
label_string = v.references.reference
-- `..` is Lua for string concatenation
image_string = img: .. label_string

-- TeX -- Lua, passing arguments to commands
-- [stuff] -- { 'stuff' }
-- [stuff=bother] -- { stuff = 'bother' }
-- {stuff} --  'stuff'

-- context.in() seems to have some Lua meaning
-- so we print the command string directly, instead
context(\\in{Figure}[ .. label_string .. ])
context.page( { 'no' } )
context.externalfigure( { image_string }, { 'here' } )
context.hairline()
context.par() -- end paragraph
end
\stopluacode
\stopmode

\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] Italic page number.

2012-08-07 Thread john Culleton
On Sun, 5 Aug 2012 09:39:24 +0200
Wolfgang Schuster wolfgang.schus...@gmail.com wrote:

 
 Am 05.08.2012 um 02:37 schrieb john Culleton j...@wexfordpress.com:
 
  IMO the following code should result in an italic iii on the
  contents page. Instead I get a roman 1.
  ---
  \startfrontmatter
  \setuppagenumbering[alternative=doublesided,conversion=romannumerals]
  \setuppagenumber[number=iii]
  \setuppagenumber[state=start]
  \completecontent
  --
  I have tried variations such as a single \setupagenumber with two
  parameters, using \page[iii] instead and so on. 
  
  This ought to be a smple task: start page numbering on the
  contents page with iii. But I haven't mastered it yet.
 
 \setuppagenumbering[alternative=doublesided]
 
 % You can use this instead of
 \setuppagenumbering[numberconversion=romannumerals] % to set the
 conversion of the pagenumber outside of the sectionblock environment,
 % the first argument takes the name of the conversion which is
 applied to the % userpage counter with
 \setupcounter[userpage][numberconversionset=pagenumber]. % % You can
 set a conversion for a certain sectionblock when you write the name %
 of the block before the name of the conversion set separated by a
 ___:___. %
 %\defineconversionset[frontpart:pagenumber][][romannumerals]
 
 \startsectionblockenvironment[frontpart]
 
 \setuppagenumbering[numberconversion=romannumerals]
 
 \setcounter[userpage][3]
 
 \stopsectionblockenvironment
 
 \startsectionblockenvironment[bodypart]
 
 \setcounter[userpage][1]
 
 \stopsectionblockenvironment
 
 \starttext
 
 \startfrontmatter
 
 \completecontent
 
 \stopfrontmatter
 
 \startbodymatter
 
 \dorecurse{100}
   {\chapter{Chapter #1}
\dorecurse{5}
  {\section{Section #1.##1}}}
 
 \stoptext
 
 BTW: Send next time a complete minimal example.
 
 Wolfgang

Thanks very much. Playing with your code I discovered that if I use:

 \defineconversionset[frontpart:pagenumber][][romannumerals]
-
in your example then the following statement is not needed
-
\setuppagenumbering[numberconversion=romannumerals]


but not vice versa. So the last statement quoted is defective in some
way or so it seems to me. In any case I now have code that works. Is
the command \defineconversionset documented anywhere or do I have to dig
into the macro code?

-- 
John Culleton
Free list of books for self-publishers:
http://wexfordpress.net/shortlist.html
Police Procedural and Expose: Death Wore Black
Create Book Covers with Scribus
http://www.booklocker.com/books/4055.html
___
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] Draft version of document

2012-08-07 Thread Hans Hagen

On 7-8-2012 14:51, Sietse Brouwer wrote:

Hi Robert,
Debugged and all, here you go.
Cheers,
Sietse

\useexternalfigure[img:fig:cow][cow.pdf]
\useexternalfigure[img:fig:mill][mill.png]

\starttext

\section{Pictures}
% The externalfigure names HAVE TO take the form 'img:FIGURELABEL',
% or the automatic image list at the end on won't be able to
% guess the image names from the figure labels.
\placefigure[here][fig:cow]
 {cap-cow}
 {\externalfigure[img:fig:cow]}

\section{More pictures}
\placefigure[here][fig:mill]
 {cap-mill}
 {\externalfigure[img:fig:mill]}


 Lists start here %%%
\enablemode[draft]
\startmode[draft]

% Better list heading --- the captions are what matters
\setupheadtext[figures=List of Captions]
\completelistoffigures

% Now for printing all the images
\section{List of Pictures}
\startluacode
 -- we won't need the keys k, but still.
 for k,v in pairs(structures.lists.ordered.float.figure) do
 label_string = v.references.reference
 -- `..` is Lua for string concatenation
 image_string = img: .. label_string

 -- TeX -- Lua, passing arguments to commands
 -- [stuff] -- { 'stuff' }
 -- [stuff=bother] -- { stuff = 'bother' }
 -- {stuff} --  'stuff'

 -- context.in() seems to have some Lua meaning
 -- so we print the command string directly, instead
 context(\\in{Figure}[ .. label_string .. ])
 context.page( { 'no' } )
 context.externalfigure( { image_string }, { 'here' } )
 context.hairline()
 context.par() -- end paragraph
 end
\stopluacode
\stopmode

\stoptext



\starttext

\placefigure{}{\externalfigure[mill]}
\placefigure{}{\externalfigure[cow]}

\page

\startluacode
context.bTABLE { spit = yes, offset = 1ex }
for k, v in next, figures.found do
inspect(v)
context.bTR()
context.bTD { width = 4cm, align = middle }
context.dontleavehmode()
context.externalfigure( { v.foundname }, { height = 
2cm } )

context.eTD()
context.bTD()
context(v.askedname)
context.eTD()
context.bTD()
context(file.basename(v.foundname))
context.eTD()
context.eTR()
end
context.eTABLE()
\stopluacode

\stoptext


-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
 | www.pragma-pod.nl
-
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] Draft version of document

2012-08-07 Thread Hans Hagen

On 7-8-2012 14:51, Sietse Brouwer wrote:

Hi Robert,
Debugged and all, here you go.
Cheers,
Sietse

\useexternalfigure[img:fig:cow][cow.pdf]
\useexternalfigure[img:fig:mill][mill.png]

\starttext


Actually, this is something that should be doable with user data weren't 
it that for floats that's not yet available. So I've added it to the 
core (will be in next upload) ...


% macros=mkvi

\unprotect

% let's pick up two arguments

\unexpanded\def\strc_floats_start_place#tag%
  {\flushnotes
   \page_otr_command_flush_side_floats % here !
   \strc_floats_begin_group
   \strc_floats_set_current_tag{#tag}%
   \dodoubleempty\strc_floats_start_place_indeed}

% and store the user data for a while

\def\strc_floats_start_place_indeed[#settings][#userdata]%
  {\strc_floats_reset_variables
   \edef\savedfloatlocation{\floatcaptionparameter\c!location}%

\setupcurrentfloatcaption[\c!location=,\c!reference=,\c!title=,\c!marking=,\c!list=,\c!bookmark=,#settings]%
   \def\savedfloatuserdata{#2}%
   \edef\floatlocation{\floatcaptionparameter\c!location}%
   \setupcurrentfloatcaption[\c!location=\savedfloatlocation]%
   \ifx\floatlocation\empty
  \edef\floatlocation{\floatparameter\c!default}%
   \fi

\doifinsetelse\v!split\floatlocation\strc_floats_place_next_box_split\strc_floats_place_next_box_normal
   \bgroup
   \ignorespaces}

% here we need to expand it one level (else detokenize will spoil it)

\def\strc_floats_place_packaged_boxes

{\expandafter\strc_floats_place_packaged_boxes_indeed\expandafter{\savedfloatuserdata}}

\def\strc_floats_place_packaged_boxes_indeed#userdata%
  {\bgroup
   \ifconditional\usesamefloatnumber
 \globallet\currentfloatnumber \previousfloatnumber
 \globallet\currentfloatattribute  \empty
 \globallet\currentfloatsynchronize\relax
   \else
 \ifnofloatnumber \else \ifnofloatcaption \else
   \strc_counters_increment{\strc_counters_the\currentfloat}%
 \fi \fi
 \strc_counters_register_component
   {float}%
   \setupcurrentfloatcaption
   \floatcaptionparameter
   \detokenizedfloatcaptionparameter
   \relax
   \relax
   \relax
   [\c!name=\currentfloat,%
\s!counter=\strc_counters_the\currentfloat,%
\s!hascaption=\ifnofloatcaption \v!no\else\v!yes\fi,%
\s!hasnumber=\ifnofloatnumber   \v!no\else\v!yes\fi,%
\s!hastitle=\ifemptyfloatcaption\v!no\else\v!yes\fi]%
   [#userdata]%
 \globallet\previousfloatnumber 
\m_strc_counters_last_registered_index
 \globallet\currentfloatnumber 
\m_strc_counters_last_registered_index
 \globallet\currentfloatattribute 
\m_strc_counters_last_registered_attribute


\globallet\currentfloatsynchronize\m_strc_counters_last_registered_synchronize
   \fi
   %
   \global\setfalse\usesamefloatnumber % one shot
   % check float box
   \strc_floats_set_natural_dimensions\nextbox
   \global\setbox\floatbox\vbox{\floatparameter\c!command{\box\nextbox}}%
   \strc_floats_set_natural_dimensions\floatbox
   \ifdim\htdp\floatbox=\zeropoint
 \showmessage\m!floatblocks{11}\empty
 \global\setbox\floatbox\vbox
   {\dostarttagged\t!floatcontent\empty
\strc_floats_place_empty_box
\dostoptagged}%
   \fi
   % deal with lack of caption
   \global\setbox\floatbox\vbox \floatcaptionattribute
 {\doifelsemainfloatbody\currentfloatsynchronize\donothing
  \unvbox\floatbox
  \ifnofloatcaption
\vss
  \fi}% gets rid of the depth (unless tabulate)
   \egroup
   % place the float
   \strc_floats_set_box
   \strc_floats_get_box
   \global\insidefloatfalse}

% we need a raw untagged and expandable fetch:

\def\rawstructurelistuservariable#name%
  {\ctxcommand{listuserdata(\currentlist,\currentlistindex,#name)}}

\protect

% so, after some 5 lines patching we can do:

\starttext

\startplacefigure[reference=fig:mill,title={A Mill}][resource=mill]
\externalfigure[mill]
\stopplacefigure

\startplacefigure[reference=fig:cow,title={A Cow}][resource=cow]
\externalfigure[cow]
\stopplacefigure

\page

\unexpanded\def\FigureListEntry#1#2#3%
  {\dontleavehmode
   \tbox{\hbox to 
2cm{\externalfigure[\rawstructurelistuservariable{resource}][height=1cm]\hss}}%

   \hbox to 2em{#1\hss}%
   #2\hfill
   \hbox to 2em{\hss#3}%
   \blank}

\setuplist[figure][alternative=command,command=\FigureListEntry]

\placelist[figure]

\stoptext

Of course, the 'command' is not that nice looking but that's for others 
to improve.


(In a similar fashion one can associate a resource or whatever to a 
section head and use it in a toc.)


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
-

Re: [NTG-context] Marking a textfragment for later reference

2012-08-07 Thread Wolfgang Schuster

Am 07.08.2012 um 09:42 schrieb Robert Blackstone blackstone.rob...@gmail.com:

 
 On 6 aug. 2012, Robert Blackstone blackstone.rob...@gmail.com
 wrote
 
 On 6 aug. 2012, Mon, 6 Aug 2012 14:16:09 +020
 Wolfgang Schuster wolfgang.schus...@gmail.com wrote
 Am 06.08.2012 um 09:41 schrieb Robert Blackstone 
 blackstone.rob...@gmail.com:
 
 Thank you Marco. Another very useful tool for me. I realize now that many 
 things with labels can be used as anchors for references, and I'm still a 
 bit surprised that a delimited text with a label cannot be used that way.
 
 Where has the delimited text in your example a label?
 
 Wolfgang
 
 
 I had not included a minimal example but I had run some trials. Since they 
 did not work, and you gave me a good solution, I trashed them. I kept the 
 pdf's though, in which I included the source. So I can reconstruct the 
 examples.
 I'll try to make it again tomorrow morning. I would be interested to learn 
 what sort of errors I committed.
 Kind regards,
 Robert Blackstone
 
 
 Here follows my minimal example. I reasoned that the identifier [topica] 
 might act as a label, or an anchor, or whatever the correct ConTeXt name is, 
 for a reference.
 ---
 
 \definedelimitedtext[topica]
 \setupdelimitedtext[topica][left=,right=] %maybe superfluous? I do not need a 
 layout different from the rest of the text.

Here you’re telling context to create the new delimitedtext environment 
\starttopica … \stoptopica. The first argument for both commands (\define and 
\setup) is the new of the environment which you want to create or change.

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] Italic page number.

2012-08-07 Thread Wolfgang Schuster

Am 07.08.2012 um 16:22 schrieb john Culleton j...@wexfordpress.com:

 On Sun, 5 Aug 2012 09:39:24 +0200
 Wolfgang Schuster wolfgang.schus...@gmail.com wrote:
 
 
 Am 05.08.2012 um 02:37 schrieb john Culleton j...@wexfordpress.com:
 
 IMO the following code should result in an italic iii on the
 contents page. Instead I get a roman 1.
 ---
 \startfrontmatter
 \setuppagenumbering[alternative=doublesided,conversion=romannumerals]
 \setuppagenumber[number=iii]
 \setuppagenumber[state=start]
 \completecontent
 --
 I have tried variations such as a single \setupagenumber with two
 parameters, using \page[iii] instead and so on. 
 
 This ought to be a smple task: start page numbering on the
 contents page with iii. But I haven't mastered it yet.
 
 \setuppagenumbering[alternative=doublesided]
 
 % You can use this instead of
 \setuppagenumbering[numberconversion=romannumerals] % to set the
 conversion of the pagenumber outside of the sectionblock environment,
 % the first argument takes the name of the conversion which is
 applied to the % userpage counter with
 \setupcounter[userpage][numberconversionset=pagenumber]. % % You can
 set a conversion for a certain sectionblock when you write the name %
 of the block before the name of the conversion set separated by a
 ___:___. %
 %\defineconversionset[frontpart:pagenumber][][romannumerals]
 
 \startsectionblockenvironment[frontpart]
 
 \setuppagenumbering[numberconversion=romannumerals]
 
 \setcounter[userpage][3]
 
 \stopsectionblockenvironment
 
 \startsectionblockenvironment[bodypart]
 
 \setcounter[userpage][1]
 
 \stopsectionblockenvironment
 
 \starttext
 
 \startfrontmatter
 
 \completecontent
 
 \stopfrontmatter
 
 \startbodymatter
 
 \dorecurse{100}
  {\chapter{Chapter #1}
   \dorecurse{5}
 {\section{Section #1.##1}}}
 
 \stoptext
 
 BTW: Send next time a complete minimal example.
 
 Wolfgang
 
 Thanks very much. Playing with your code I discovered that if I use:
 
 \defineconversionset[frontpart:pagenumber][][romannumerals]
 -
 in your example then the following statement is not needed
 -
 \setuppagenumbering[numberconversion=romannumerals]
 
 
 but not vice versa. So the last statement quoted is defective in some
 way or so it seems to me. In any case I now have code that works.

See my other mail for the correct usage of numberconversion.

 Is the command \defineconversionset documented anywhere or do I have to dig
 into the macro code?

You can find a explanation of the command in the mail archive but you have
to look for old name \definestructureconverionset.

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] A series of articles about text-editors for the MAPS

2012-08-07 Thread john Culleton
On Tue, 7 Aug 2012 11:34:28 +0200 Willi Egger cont...@boede.nl
wrote:

 Dear TeX users and TeX friends,
 
 At one of the last NTG-meetings we discussed possibilities to
 write a series of articles presenting the different text
 editors used in modern TeX-environments. 
 
 Such an article could have ingredients like availability,
 general use, highlights, issues related to TeX coding and
 whether it is suitable for Plain-tex, Latex, Context,
 configurability etc.
 
 The idea is to produce a MAPS-issue in color, so that also
 screenshots can be included. 
 
 We have already a couple of volunteers to write on certain
 editors, however it is for sure not a bad idea to include even
 two articles on the same editor. What we definitely are looking
 for is someone who would be prepared to write an article over
 WinEdt.
 
 I am looking forward hearing from you, kind regards
 
 Willi Egger Secretary NTG ntg-secret...@ntg.nl

I use Gvim for all editing, including all forms of TeX, columns
submitted to my newspaper editors, programs (Tcl etc.) and emails.
The virtue is I do not have to learn and relearn a new editor for
each. And my custmizations such as F2 to justify each paragraph
ragged right, are common for all. I even assign F keys for
running pdftex or context on a file named book.tex (every book I
work on is in a separate directory so all of them are called
book.tex.) I have an  F key for acroread book.pdf

Just FYI. I doubt if I am the only one. 


-- John Culleton 
___
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] \product tag

2012-08-07 Thread john Culleton
In a MKIV file using the approved method of structuring projects,
does the \product tag do anything or is it just internal
documentation for the source file? When I process a file called
book.tex and containing the tag:
\product foobar
the result is a file called book.pdf, just as if the tag did not
exist. 

-- 
John Culleton
Free list of books for self-publishers:
http://wexfordpress.net/shortlist.html
Police Procedural and Expose: Death Wore Black
Create Book Covers with Scribus
http://www.booklocker.com/books/4055.html
___
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] \product tag

2012-08-07 Thread Wolfgang Schuster

Am 08.08.2012 um 02:29 schrieb john Culleton j...@wexfordpress.com:

 In a MKIV file using the approved method of structuring projects,
 does the \product tag do anything or is it just internal
 documentation for the source file? When I process a file called
 book.tex and containing the tag:
 \product foobar
 the result is a file called book.pdf, just as if the tag did not
 exist. 

The name of the output file is always the name of the main input file
and you can only change this with the result option for context/texexec scripts.

The \product command is a special version of \input and the given file
is only read when the command appears in a project file and since it is
no longer recommended to use a project as main file the command has
no real purpose except a internal reference (in a component) to the parent file.

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
___