Re: [NTG-context] two suggestions to \typesetbuffer

2013-11-10 Thread Hans Hagen

On 11/9/2013 12:49 PM, Pablo Rodriguez wrote:


Of course, fonts are embedded fine in documents, but \typesetbuffer is a
special case. Having the fonts embedded only once in the final document
would be better.


You can try the beta ... i'm not sure about it yes but this one is 
faster, we might end up with several methods to choose from depending on 
usage.


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] two suggestions to \typesetbuffer

2013-11-10 Thread Pablo Rodriguez
On 11/10/2013 12:30 PM, Hans Hagen wrote:
 
 You can try the beta ... i'm not sure about it yes but this one is 
 faster, we might end up with several methods to choose from depending on 
 usage.

Many thanks for the improvement, Hans.

Compilation for the first time decreased from 210 seconds to 181
seconds. And subsequent compilations decreased from 70 seconds to 7 seconds.

The sample shows the issue with embedded fonts:

\starttext
These are bufers:

\startbuffer[text:1]
\setuppapersize[A7]
\starttext\input tufte\stoptext
\stopbuffer
\typesetbuffer[text:1][frame=on]

\startbuffer[text:2]
\setuppapersize[A7]
\starttext\input knuth\stoptext
\stopbuffer
\typesetbuffer[text:2][frame=on]
\stoptext

The same font is embedded three times in the final PDF. I wonder whether
it would be possible that the font would be only embedded once in the
final PDF.

Many thanks for your excellent work,


Pablo
-- 
http://www.ousia.tk
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

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


[NTG-context] Chapter endings

2013-11-10 Thread Francisco Gracia
This is a disclaimer to my former message about this subject.

I continued considering the solution to the problem of using *fleurons* in
a document via the suggested *\leaders* command and it turned out to be a
dead end for the following reasons:

1) it acts wrongly if the page in which the *fleuron* is to appear has
a lot of blank space availabe, as the following test code demonstrates:

\setuplayout[lines=30]

\def\Fleuron
{\par
\leaders\vbox to \lineheight{\midaligned{Finis\\coronat\\opus}}\vfil}
\starttext

\dorecurse{32}{Line \recurselevel\par}

\Fleuron

\stoptext

where the intended *fleuron* appears superposed several times instead of
the only one desired;

2) the use of such an instruction is touchy and not dependable. As I
have experienced, things work satisfactorily or not according to the degree
of nesting of the command *\fleuron* in the whole launching command and
possibly according to many other unnoticed factors;

3) the suggested formulation does not allow enough control for the
placement of the *fleuron* in the final document.

In the end all this seems reasonable: the straigth use of the *\leaders*
command  is almost the contrary of the one demanded for the present
functionality. The effect of the (obscure in more than one sense) *Tex*
command *\leaders* is to fill a (rather implicitly defined) surface with
repeated copies of a certain motive. The visibility or not of the result
according to the surrounding text or space in the page has to be considered
therefore as a purely accidental (and noxious) side effect. The content
typesett via *\leaders* is not supposed in any way to disappear when
following lines are added.

I conclude that the only lawful use of *\leaders* in the true context of
*fleurons* would be for the generation of certain repetitive motives (for
instance a kind of small checkered board), but this is only a hint; I have
not explored this possibility.

Fortunately I have been able to advance in another direction and to get
what seems to me a consistent solution to the original problem. I open the
new thread *Using *fleurons** for explaining it more fully.

Regards

Francisco
___
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] Using *fleurons*

2013-11-10 Thread Francisco Gracia
*Fleurons* are small decorative pieces that were often used in the past for
filling big blank spaces in books. They are seldom used nowdays. As besides
they will not appear more than a few times in any book (mainly at the end
of chapters), the easiest thing to do if one insists in using them (for
instance for simulating an old edition of some past work) is to arrange its
presence manually in the source document in the way one would do for any
other figure or piece of text.

I subscribe to this, which is without doubt the way to proceed if the
original document will allways be typesett in the same way. But if it were
an extensive work and one foresees different layouts for its appearence as
different *products*, then one would have one more source of worries after
every run of the work through *Context*, as you can bet that sooner than
later one page will have been included somewhere whose only content will be
the damned *fleuron*, something that obviously should not happen.

This is the problem that I tackled, because I did not find any previous
reference or solution to it. My reasoning, my explanations and the working
code are all contained in the rest of this message.

It is conceived as being composed of two parts, but it can also be saved
and dealt as one piece. If one saves it as two independent files (as should
be done if one intends to use it for any other thing that running the tests
samples) the content of the first file will be the one delimited as
*Fleuron.tex* and that of the second (*Fleuron_test.tex*) would be the rest
of the message. The line of this second file

% \input {Fleuron}

should be uncommented if one intends to run it as such. The one file
version runs as it is.

The script creates the new command *\Fleuron{\motive name}*, which is the
one to include at the place intended in the source document for the
*fleuron* to appear (of course after having incorporated the contents of
*Fleuron.tex* in its preamble with *\input{Fleuron}*). The argument
*motive name* allows the selection of a specific motive among the several
of them that could be available; the user can create and organize all this
according to his wishes. For instance *\Fleuron{\MotiveFive}* would use the
example labelled *\MotiveFive* in the group of examples provided. The
comments in *Fleuron.tex* explain how to handle all this.

Enjoy and critizice

Francisco

%%%
%
% Fleuron.tex
% Script that explains and implements in *ConTeXt* Mk-IV the kind of small
ornaments
% traditionally used by printers for filling big blank spaces in books and
printed works.

%*Fleuron*: subst. masc. 2b) Élément décoratif de fantaisie ornant le titre
ou les blancs des principales divisions d'un ouvrage [livre] (Trésor de la
langue française informatisé).
%
%%%

% Creation of the ornament as an entity (in the form of a box)

% Typesetting true *fleurons* requires the use of *TeX*'s special *box
registers* as arguments;
% here box register number *0* has been arbitrarily selected for the
proceedings.
% The essential steps in the construction are:
%- (typo)graphical composition of the motive (as for instance
*\midaligned{Finis}* in the first example)
%or designation of the source file of an image,
%- enclosure of it in a vertical box (*\vbox{\midaligned{Finis}}*) and
% - finally association of the boxed motive with boxregister *0*
(*\setbox0= ...*), all of which happens
%  in reverse order, from right to left, in the code.
% Here are several examples of this:
%\setbox0=\vbox{\midaligned{Finis}}
%\setbox0=\vbox{\midaligned{Finis\\coronat\\opus}}
%\setbox0=\vbox{\midaligned{*} \Inter \midaligned{***} \Inter
\midaligned{*}}

% In order to get in *TeX* something remotely similar to a normal variable,
% called *Motivo*, the following machinery has to be implemented
\def\Motivo{\copy0}% get a copy of register's *0* content

% the graphic parts of several (typographical) test motives follow:
\def\MotOne{{\midaligned{\em Finis}}}
\def\MotTwo{{\midaligned{\em Finis\\\em coronat\\\em opus}}}
\def\MotThree{{\midaligned{*} \Inter \midaligned{***} \Inter
\midaligned{*}}}
\def\MotFour{{\midaligned{___}}}
\def\MotFive{{\bf \midaligned{\hl[1]} \Inter \midaligned{\hl[5]} \Inter
\midaligned{\hl[1]}}}

%
%
% THINGS THAT DO NOT WORK
%
%\setbox0=\vbox{\midaligned{\switchtobodyfont[20pt]*}}% executing these
corrupt the whole script
%\setbox0=\vbox{\switchtobodyfont[20pt] \midaligned{*\\***\\*}}
%\def\Grande{\midaligned{\switchtobodyfont[50pt]*}}% in any form it
is tried
%\setbox0=\vbox{\Grande}
%
%

%
%
% USING FIGURES AS MOTIVES
%
% Most *fleurons* will be based on figures (usually images of schematic
line drawings)
% rather than on elements of the alphabetical character set.
% So it is important to insure that also this alternative works as it
should.
% *Contextref* says that just 

Re: [NTG-context] two suggestions to \typesetbuffer

2013-11-10 Thread Hans Hagen

On 11/10/2013 1:32 PM, Pablo Rodriguez wrote:

On 11/10/2013 12:30 PM, Hans Hagen wrote:


You can try the beta ... i'm not sure about it yes but this one is
faster, we might end up with several methods to choose from depending on
usage.



The same font is embedded three times in the final PDF. I wonder whether
it would be possible that the font would be only embedded once in the
final PDF.


unless something is wrong in the engine, the actual shapes of fonts 
should be shared but it looks like the subsets are embedded anyway ... 
something to look into (not a context issue afaiks)


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] How to test the emptyness of a variable?

2013-11-10 Thread Géry Ogam
Thank you very much Aditya, now it works.

As you said, the trick was to use \doiftextelse{}{}{} function as test of
emptyness function, and \labeltext{chapter} instead of
\currentstructurelabel as variable for the test because the latter was
never found empty, even when it was.

Thus the right code for me is:

\define[1]
\MyConversion{\doifelse{\currentsectioncountervalue}{1}{\doiftextelse{\labeltext{chapter}}{ONE}{#1}}{#1}}
\defineconversion[MyConversion][\MyConversion]
\setuphead[chapter][conversion=MyConversion]

\starttext

\setuplabeltext[chapter=]
\chapter{Cool}
\chapter{Cat}
\chapter{Mouse}

\setuplabeltext[chapter=CHAPTER~]
\setupheadnumber[chapter][0]
\chapter{Cool}
\chapter{Cat}
\chapter{Mouse}

\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] Using *fleurons*

2013-11-10 Thread Wolfgang Schuster



   	   
   	Francisco Gracia  
  10. November 2013
 16:12
  *Fleurons* are small decorative pieces that were often used in
 the past for filling big blank spaces in books. They are seldom used 
nowdays. As besides they will not appear more than a few times in any 
book (mainly at the end of chapters), the easiest thing to do if one 
insists in using them (for instance for simulating an old edition of 
some past work) is to arrange its presence manually in the source 
document in the way one would do for any other figure or piece of text.
I subscribe to this, which is without doubt the way to proceed if 
the original document will allways be typesett in the same way. But if 
it were an extensive work and one foresees different layouts for its 
appearence as different *products*, then one would have one more source 
of worries after every run of the work through *Context*, as you can bet
 that sooner than later one page will have been included somewhere whose
 only content will be the damned *fleuron*, something that obviously 
should not happen.
This is the problem that I tackled, because I did not find any 
previous reference or solution to it. My reasoning, my explanations and 
the working code are all contained in the rest of this message.It
 is conceived as being composed of two parts, but it can also be saved 
and dealt as one piece. If one saves it as two independent files (as 
should be done if one intends to use it for any other thing that running
 the tests samples) the content of the first file will be the one 
delimited as *Fleuron.tex* and that of the second (*Fleuron_test.tex*) 
would be the rest of the message. The line of this second file
 % \input {Fleuron}should be uncommented if one intends 
to run it as such. The one file version runs as it is.The script
 creates the new command *\Fleuron{\motive name}*, which is the 
one to include at the place intended in the source document for the 
*fleuron* to appear (of course after having incorporated the contents of
 *Fleuron.tex* in its preamble with *\input{Fleuron}*). The argument 
*motive name* allows the selection of a specific motive among 
the several of them that could be available; the user can create and 
organize all this according to his wishes. For instance 
*\Fleuron{\MotiveFive}* would use the example labelled *\MotiveFive* in 
the group of examples provided. The comments in *Fleuron.tex* explain 
how to handle all this.
Enjoy and critiziceFrancisco%
 Fleuron.tex% Script that explains and implements in *ConTeXt* Mk-IV
 the kind of small ornaments% traditionally used by printers for 
filling big blank spaces in books and printed works.
%*Fleuron*: subst. masc. 2b) lment dcoratif de fantaisie ornant 
le titre ou les blancs des principales divisions d'un ouvrage [livre] 
(Trsor de la langue franaise informatis).
% Creation of the ornament as an entity (in the form of a box)%
 Typesetting true *fleurons* requires the use of *TeX*'s special *box 
registers* as arguments;% here box register number *0* has been 
arbitrarily selected for the proceedings.
% The essential steps in the construction are:% - (typo)graphical
 composition of the motive (as for instance *\midaligned{Finis}* in the 
first example)%  or designation of the source file of an 
image,
% - enclosure of it in a vertical box (*\vbox{\midaligned{Finis}}*) 
and%  - finally association of the boxed motive with boxregister 
*0* (*\setbox0= ...*), all of which happens% in reverse 
order, from right to left, in the code.
% Here are several examples of this:%\setbox0=\vbox{\midaligned{Finis}}%\setbox0=\vbox{\midaligned{Finis\\coronat\\opus}}%\setbox0=\vbox{\midaligned{*}
 \Inter \midaligned{***} \Inter \midaligned{*}}
% In order to get in *TeX* something remotely similar to a normal 
variable,% called *Motivo*, the following machinery has to be 
implemented \def\Motivo{\copy0}  % get a copy of register's 
*0* content
% the graphic parts of several (typographical) test motives follow:\def\MotOne{{\midaligned{\em
 Finis}}}\def\MotTwo{{\midaligned{\em Finis\\\em coronat\\\em 
opus}}}\def\MotThree{{\midaligned{*} \Inter \midaligned{***} 
\Inter \midaligned{*}}}
\def\MotFour{{\midaligned{___}}}\def\MotFive{{\bf 
\midaligned{\hl[1]} \Inter \midaligned{\hl[5]} \Inter 
\midaligned{\hl[1]}}}%%% THINGS 
THAT DO NOT WORK%%\setbox0=\vbox{\midaligned{\switchtobodyfont[20pt]*}}
 % executing these corrupt the whole script
%\setbox0=\vbox{\switchtobodyfont[20pt] \midaligned{*\\***\\*}}%\def\Grande{\midaligned{\switchtobodyfont[50pt]*}}
  % in any form it is tried%\setbox0=\vbox{\Grande}%%
%%% USING FIGURES AS MOTIVES%%
 Most *fleurons* will be based on figures (usually images of schematic 
line drawings)% rather than on elements of the alphabetical 
character set.
% So it is important to insure that also this alternative works as it 
should.% 

Re: [NTG-context] Chapter endings

2013-11-10 Thread Wolfgang Schuster


   	   
   	Francisco Gracia  
  10. November 2013
 16:07
  This is a 
disclaimer to my former message about this subject.I continued 
considering the solution to the problem of using *fleurons* in a 
document via the suggested *\leaders* command and it turned out to be a 
dead end for the following reasons:
 1) it acts wrongly if the page in which the *fleuron* is to 
appear has a lot of blank space availabe, as the following test code 
demonstrates:\setuplayout[lines=30]\def\Fleuron{\par\leaders\vbox
 to \lineheight{\midaligned{Finis\\coronat\\opus}}\vfil} \starttext
\dorecurse{32}{Line \recurselevel\par}\Fleuron\stoptextwhere
 the intended *fleuron* appears superposed several times instead of the 
only one desired;

You can avoid this when you limit the space for the leaders command.

\unexpanded\def\Fleuron
 {\par
 \begingroup
 \setupalign[middle]%
 \dowithnextbox
 {\scratchdimen\htdp\nextbox
  \cleaders\box\nextbox\vskip\dimexpr\scratchdimen+\lineheight\relax
  \endgroup}
 \vbox}

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] Configure AUCTeX to run context not texec

2013-11-10 Thread Peter Münster
On Sat, Nov 09 2013, Jean Magnan de Bornier wrote:

 emacs 24.3.1 ubuntu
 context minimal many versions (I update about once a week)
 auctex 11.87.2 (installed via elpa and frequently updated)

Strange. I use also the latest versions, but I observe the same
behaviour as the OP...

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