[NTG-context] Code Called Twice?

2013-10-11 Thread Thangalin
Hi,

I noticed something unexpected with the following code:

\enabletrackers[metapost.showlog]

\startuseMPgraphic{heading:ThemeTitleStyle}
  show HEADING:THEMETITLESTYLE;
  show \MPstring{heading:title};

  draw textext( \MPstring{heading:title} ) rotated 5
withcolor blue;
\stopuseMPgraphic

\defineframed[ThemeTitleStyle][
  background=\useMPgraphic{ThemeTitleStyle},
]

\def\processword#1{%
  \setMPtext{heading:title}{#1}%
  \useMPgraphic{heading:ThemeTitleStyle}
}

\define[1]\ThemeChapterTitle{\applytosplitstringword\processword{#1}}
\setuphead[chapter][deeptextcommand={\ThemeChapterTitle}]

\starttext
  \startchapter[title=Why Is heading:ThemeTitleStyle Called Twice?]
  \input knuth
  \stopchapter
\stoptext

It appears as though heading:ThemeTitleStyle is being called twice:

metapost info:
 HEADING:THEMETITLESTYLE
 Why
metapost info:
 HEADING:THEMETITLESTYLE
 Why

I am trying to produce a random number that is not equal to the
previous random number. However, if the code is called twice, then I'd
have to add code to ignore one of the calls.

Any ideas why the code seems to be called twice and what can be done
to ensure that it is only called once?

Thank you!
___
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] Bug: Reloading Font

2013-10-11 Thread luigi scarso
On Fri, Oct 11, 2013 at 5:35 AM, Thangalin thanga...@gmail.com wrote:

 Hi,

 A font causes mtxrun to hang upon reloading. Replicate:

 mkdir $HOME/.fonts
 cd $HOME/.fonts
 wget http://whitemagicsoftware.com/Copperplate-ThirtyThreeBC.ttf
 export OSFONTDIR=$HOME/.fonts
 mtxrun --script fonts --reload

 Expected Results

 All the fonts in $HOME/.fonts and subdirectories are globbed and
 imported, within a few seconds.

 Actual Results

 The program hangs at Copperplate 33BC font with the CPU locked at
 100%. The process must be killed.

I have not downloaded the file
but you can try copying the font file into a local folder like
texmf-project/test
together with this test.tex

\starttext
 
\definedfont[./Copperplate-ThirtyThreeBC.ttfhttp://whitemagicsoftware.com/Copperplate-ThirtyThreeBC.ttf
]
 \input knuth
\stoptext

and see what happens



-- 
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] graphictext bug?

2013-10-11 Thread Marco Patzer
On 2013–10–10 Thangalin wrote:

 Hi,
 
 From the October 8, 2010 context mkiv MetaFun manual (section 8.6),
 the following example does not produce any output beyond the caption:

http://wiki.contextgarden.net/ConTeXt_Standalone#Dependencies

Do you have pstoedit installed?

Marco


signature.asc
Description: Digital 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
___

[NTG-context] Problem with \overrightarrow over BC and CB

2013-10-11 Thread Mikael P. Sundqvist
Dear all,

with the latest beta (and older ones), the following file

%%% start test file
\definefontfamily [mainface] [serif] [DejaVu Serif]
\definefontfamily [mainface] [sans]  [DejaVu Sans]
\definefontfamily [mainface] [mono]  [DejaVu Sans Mono] [feature=none]
\definefontfamily [mainface] [math]  [TeX Gyre Pagella Math][scale=1.12]

\setupbodyfont[mainface]

\starttext
$
\overrightarrow{AB}
\overrightarrow{BA}
\overrightarrow{AC}
\overrightarrow{CA}
\overrightarrow{AD}
\overrightarrow{DA}
\overrightarrow{BC}
\overrightarrow{CB}
\overrightarrow{BD}
\overrightarrow{DB}
\overrightarrow{CD}
\overrightarrow{DC}
$
\stoptext
%%% end test file

gives a shorter arrow than expected above BC and CB (but over the other
ones it is OK).

Is this a bug in the Pagella math font (it looks OK if one comments out the
\setupbodyfont[mainface] above)?

Can it be fixed?

Best regards, Mikael
___
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] (no subject)

2013-10-11 Thread Xan
 On 2013–10–10 Xan wrote:
 
  ! Undefined control sequence.
  
  system   tex  error on line 28 in file 
  /home/xan/fems/proves-context/prova.tex: Undefined control sequence ...
  
  18   \starttikzpicture
  19 [decoration={
  20markings,
  21mark=
  22between positions 0 and 1 step 0.5
  23with {
  24 \draw (0,-2pt) -- (0,2pt);
  25}
  26  }
  27 ]
  28   \coordinate (F) at (0,0);
 
 I can reproduce it now. Funnily it works on my regular installation
 (same version). When I run it on a clean minimal installation I get
 the same error. No clue what's going on and I don't have much time
 to check at the moment.
 
 Marco

Perhaps anyone could see us with this minimal example.
Does anyone?

Thanks in advance,
Xan
___
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] Possibly bug in ConTexT with TikZ

2013-10-11 Thread Xan
 On 2013–10–10 Xan wrote:
 
  ! Undefined control sequence.
  
  system   tex  error on line 28 in file 
  /home/xan/fems/proves-context/prova.tex: Undefined control sequence ...
  
  18   \starttikzpicture
  19 [decoration={
  20markings,
  21mark=
  22between positions 0 and 1 step 0.5
  23with {
  24 \draw (0,-2pt) -- (0,2pt);
  25}
  26  }
  27 ]
  28   \coordinate (F) at (0,0);
 
 I can reproduce it now. Funnily it works on my regular installation
 (same version). When I run it on a clean minimal installation I get
 the same error. No clue what's going on and I don't have much time
 to check at the moment.
 
 Marco

Perhaps anyone could see us with this minimal example.
Does anyone?

Thanks in advance,
Xan
___
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] Possibly bug in ConTexT with TikZ

2013-10-11 Thread Xan
With version 2013-09-07 (sh ./first-setup.sh --context=2013-09-07 --modules=all 
--engine=luatex) it works
With version 2013.10.09 it does not

So there is a bug.

Can anyone fix it?

Thanks,
Xan
___
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] Bug: Reloading Font

2013-10-11 Thread Hans Hagen

On 10/11/2013 8:55 AM, luigi scarso wrote:




On Fri, Oct 11, 2013 at 5:35 AM, Thangalin thanga...@gmail.com
mailto:thanga...@gmail.com wrote:

Hi,

A font causes mtxrun to hang upon reloading. Replicate:

mkdir $HOME/.fonts
cd $HOME/.fonts
wget http://whitemagicsoftware.com/Copperplate-ThirtyThreeBC..ttf
http://whitemagicsoftware.com/Copperplate-ThirtyThreeBC.ttf
export OSFONTDIR=$HOME/.fonts
mtxrun --script fonts --reload

Expected Results

All the fonts in $HOME/.fonts and subdirectories are globbed and
imported, within a few seconds.

Actual Results

The program hangs at Copperplate 33BC font with the CPU locked at
100%. The process must be killed.

I have not downloaded the file
but you can try copying the font file into a local folder like
texmf-project/test
together with this test.tex

\starttext
  \definedfont[./Copperplate-ThirtyThreeBC.ttf
http://whitemagicsoftware.com/Copperplate-ThirtyThreeBC.ttf]
  \input knuth
\stoptext

and see what happens


it hangs ...

\enabletrackers[otf.*]

... shows that it probably hangs in the engine itself; the same can be 
seen with


mtxrun --script font --save  Copperplate-ThirtyThreeBC.ttf

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] Possibly bug in ConTexT with TikZ

2013-10-11 Thread Keith J. Schultz
Hi,

I just tested the below MWE!

It worked with the latest beta MKIV (--modules=all), an three day old beta, and 
with the TeXLive 2013 (MacTeX)

No errors. Running via TeXShop on a Mac OS 10.85

I can only assume that something is wrong with your set-up! maybe a path 
problem and the wrong TiKZ is being loaded.

reagrds
Keith.

Am 10.10.2013 um 13:09 schrieb Xan dxpubl...@telefonica.net:

 Minimal example:
 
 % Regime
 \enableregime[utf]
 
 % Choose a language, and associated hyphenation rules.
 \mainlanguage[ca]
 
 \usemodule [tikz]
 \usetikzlibrary [decorations]
 \usetikzlibrary[decorations.markings]
 
 
 
 \starttext
 
 
 
 \starttext
  \starttikzpicture
[decoration={
   markings,
   mark=
   between positions 0 and 1 step 0.5
   with {
\draw (0,-2pt) -- (0,2pt);
   }
 }
 ]
\coordinate (F) at (0,0);
\draw[very thick,color=green, loosely dashed,postaction={decorate}] (0,1) 
 -- (F);
  \stoptikzpicture
 \stoptext
 
 \stoptext
 
 
 does not work.
 
 Without \coordinate it works. What fails?
 
 Thanks in advance,
 Xan.
 ___
 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] Bug: Reloading Font

2013-10-11 Thread luigi scarso
On Fri, Oct 11, 2013 at 5:35 AM, Thangalin thanga...@gmail.com wrote:

 Hi,

 A font causes mtxrun to hang upon reloading. Replicate:

 mkdir $HOME/.fonts
 cd $HOME/.fonts
 wget http://whitemagicsoftware.com/Copperplate-ThirtyThreeBC.ttf
 export OSFONTDIR=$HOME/.fonts
 mtxrun --script fonts --reload

 Expected Results

 All the fonts in $HOME/.fonts and subdirectories are globbed and
 imported, within a few seconds.

 Actual Results

 The program hangs at Copperplate 33BC font with the CPU locked at
 100%. The process must be killed.

 Can you check the fotn with fontforge ?

-- 
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] Code Called Twice?

2013-10-11 Thread Philipp Gesang
···date: 2013-10-10, Thursday···from: Thangalin···

 
 I noticed something unexpected with the following code:
 
 \enabletrackers[metapost.showlog]
 
 \startuseMPgraphic{heading:ThemeTitleStyle}
   show HEADING:THEMETITLESTYLE;
   show \MPstring{heading:title};
 
   draw textext( \MPstring{heading:title} ) rotated 5
 withcolor blue;
 \stopuseMPgraphic
 
 \defineframed[ThemeTitleStyle][
   background=\useMPgraphic{ThemeTitleStyle},
 ]
 
 \def\processword#1{%
   \setMPtext{heading:title}{#1}%
   \useMPgraphic{heading:ThemeTitleStyle}
 }
 
 \define[1]\ThemeChapterTitle{\applytosplitstringword\processword{#1}}
 \setuphead[chapter][deeptextcommand={\ThemeChapterTitle}]
 
 \starttext
   \startchapter[title=Why Is heading:ThemeTitleStyle Called Twice?]
   \input knuth
   \stopchapter
 \stoptext
 
 It appears as though heading:ThemeTitleStyle is being called twice:
 
 metapost info:
  HEADING:THEMETITLESTYLE
  Why
 metapost info:
  HEADING:THEMETITLESTYLE
  Why
 
 I am trying to produce a random number that is not equal to the
 previous random number. However, if the code is called twice, then I'd
 have to add code to ignore one of the calls.
 
 Any ideas why the code seems to be called twice and what can be done
 to ensure that it is only called once?

Don’t use text ;-) That’s a known issue: as soon as your Metapost
code contains text, it will be processed twice. E.g.:


  \starttext
\setMPtext{heading:title}{foo}
\startMPcode
  show This gets printed twice.;
  draw textext( \MPstring{heading:title} );
\stopMPcode
  \stoptext

Same for labels, {b,e}tex. See also this thread:

  http://www.ntg.nl/pipermail/ntg-context/2011/056047.html

Best regards,
Philipp



pgpClW2rfjEVB.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] Bug: Reloading Font

2013-10-11 Thread luigi scarso
On Fri, Oct 11, 2013 at 10:59 AM, luigi scarso luigi.sca...@gmail.comwrote:




 On Fri, Oct 11, 2013 at 5:35 AM, Thangalin thanga...@gmail.com wrote:

 Hi,

 A font causes mtxrun to hang upon reloading. Replicate:

 mkdir $HOME/.fonts
 cd $HOME/.fonts
 wget http://whitemagicsoftware.com/Copperplate-ThirtyThreeBC.ttf
 export OSFONTDIR=$HOME/.fonts
 mtxrun --script fonts --reload

 Expected Results

 All the fonts in $HOME/.fonts and subdirectories are globbed and
 imported, within a few seconds.

 Actual Results

 The program hangs at Copperplate 33BC font with the CPU locked at
 100%. The process must be killed.

 Can you check the fotn with fontforge ?

 also ttx (under linux) should shows some informations


 --
 luigi




-- 
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] Bug: Reloading Font

2013-10-11 Thread Taco Hoekwater

On Oct 11, 2013, at 1:55 PM, luigi scarso luigi.sca...@gmail.com wrote:

 
 
 
 On Fri, Oct 11, 2013 at 10:59 AM, luigi scarso luigi.sca...@gmail.com wrote:
 
 
 
 On Fri, Oct 11, 2013 at 5:35 AM, Thangalin thanga...@gmail.com wrote:
 Hi,
 
 A font causes mtxrun to hang upon reloading. Replicate:
 
 mkdir $HOME/.fonts
 cd $HOME/.fonts
 wget http://whitemagicsoftware.com/Copperplate-ThirtyThreeBC.ttf
 export OSFONTDIR=$HOME/.fonts
 mtxrun --script fonts --reload
 
 Expected Results
 
 All the fonts in $HOME/.fonts and subdirectories are globbed and
 imported, within a few seconds.
 
 Actual Results
 
 The program hangs at Copperplate 33BC font with the CPU locked at
 100%. The process must be killed.
 
 Can you check the fotn with fontforge ?
 
 also ttx (under linux) should shows some informations

Font Book (Apple) says this font has five serious errors and should not be used.




___
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] [***SPAM***] itemization

2013-10-11 Thread hwitloc

I want to mave minimal inter-column spacing in the following construct, or be 
able to specify a maximum width for the full populated reactangular area.

For example the results of the below source have inter-column spacing of about 
5 cm.

Regards


- minimum example (How to specify an overall width or the 
inter-column spacing.
\starttext
\startitemize[none,columns,three,packed,joinedup,8*serried,][width=0mm]
\item A \item B \item C
\item D \item E \item F
\item G \item H \item I
\stopitemize
\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] [***SPAM***] itemization

2013-10-11 Thread luigi scarso
On Fri, Oct 11, 2013 at 2:15 PM, hwit...@gmail.com wrote:


 I want to mave minimal inter-column spacing in the following construct, or
 be able to specify a maximum width for the full populated reactangular area.

 For example the results of the below source have inter-column spacing of
 about 5 cm.

 Regards


 - minimum example (How to specify an overall width or the
 inter-column spacing.
 \starttext
 \startitemize[none,columns,three,packed,joinedup,8*serried,][width=0mm]
 \item A \item B \item C
 \item D \item E \item F
 \item G \item H \item I
 \stopitemize
 \stoptext



Maybe starttabulate
http://wiki.contextgarden.net/Command/starttabulate
?
-- 
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] graphictext bug?

2013-10-11 Thread Thangalin
Hi,

I have pstoedit installed now (that should be emphasized in section 8.6).

$ pstoedit
pstoedit: version 3.60 / DLL interface 108 (built: Dec  3 2011 -
release build - g++ 4.6.2 - 64-bit) : Copyright (C) 1993 - 2011
Wolfgang Glunz
No output format specified (-f option) and format could not be deduced
from suffix of output file since no output file name was given
Usage: pstoedit -f format inputfile outputfile or run pstoedit
-help to get a complete list available options.

The -mpgraph.pdf file is created with the quoted content, but has no
outline. The .mpy file is 0 bytes. I could not see anywhere pstoedit
is being called in the logs.

Same result: no outline.

Kind regards.
___
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] Bug: Reloading Font

2013-10-11 Thread Thangalin
Hi,

The font does not render properly in Inkscape, yet does not cause
Inkscape to hang. (That is, I can select and apply the font to text,
but it is obviously not in the same family.)

As Taco mentioned, the font file is corrupt.
___
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] Code Called Twice?

2013-10-11 Thread Marco Patzer
On 2013–10–10 Thangalin wrote:

 I noticed something unexpected with the following code:
 
 \enabletrackers[metapost.showlog]
 
 \startuseMPgraphic{heading:ThemeTitleStyle}
   show HEADING:THEMETITLESTYLE;
   show \MPstring{heading:title};
 
   draw textext( \MPstring{heading:title} ) rotated 5
 withcolor blue;
 \stopuseMPgraphic

 […]
 
 It appears as though heading:ThemeTitleStyle is being called twice:

If I'm not mistaken that's the way MP works when text is involved,
it's a two-pass approach. In graphics without text MP has all
information it needs to create the image. The text in MP graphics is
typeset using TeX. After it's typeset MP picks it up in a second
run.

 I am trying to produce a random number that is not equal to the
 previous random number. However, if the code is called twice, then I'd
 have to add code to ignore one of the calls.

Maintain a vector with the last two elements to check against.

Marco


signature.asc
Description: Digital 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] Code Called Twice?

2013-10-11 Thread Thangalin
Hi,

 typeset using TeX. After it's typeset MP picks it up in a second
 run.

That also explains why the spacing between words is correct (I didn't
think MP could typeset text).

 Maintain a vector with the last two elements to check against.

An interesting approach; I used a Boolean flag as per this thread:

http://www.ntg.nl/pipermail/ntg-context/2011/056078.html

Works as expected.

Thank you for the all help!
___
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] \def\MyChapterCommand#1#2 error...

2013-10-11 Thread Ciro A. Soto
I am not able to use #1#2 arguments... Don't know what is going on.
thank you for your help

ciro
-


*Case 1)  *
\setuphead[chapter][command=\MyChapterCommand]
\def\MyChapterCommand{}

\starttext
\chapter{first chapter}
\stoptext

*output:* no error message, pdf file produced. Everything as expected.

*Case 2)*
\setuphead[chapter][command=\MyChapterCommand]
\def\MyChapterCommand#1#2{{#1} : {#2}}

\starttext
\chapter{first chapter}
\stoptext

*output:*
.
.
.
fonts'fallback modern rm 12pt' is loaded
structuresectioning  chapter @ level 2 : 0.1 - first chapter
! Argument of \MyChapterCommand has an extra }.

system   tex  error on line 6 in file
/home/ciro/Desktop/TGM_SpanishTranslation/test2.tex: Argument of  ...

1 \setuphead[chapter][command=\MyChapterCommand]
2 %\def\MyChapterCommand{}
3 \def\MyChapterCommand#1#2{{#1} : {#2}
4 }
5 \starttext
6   \chapter{first chapter}
7 \stoptext
8
___
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] Bug: Reloading Font

2013-10-11 Thread Hans Hagen

On 10/11/2013 2:02 PM, Taco Hoekwater wrote:


On Oct 11, 2013, at 1:55 PM, luigi scarso luigi.sca...@gmail.com wrote:





On Fri, Oct 11, 2013 at 10:59 AM, luigi scarso luigi.sca...@gmail.com wrote:



On Fri, Oct 11, 2013 at 5:35 AM, Thangalin thanga...@gmail.com wrote:
Hi,

A font causes mtxrun to hang upon reloading. Replicate:

mkdir $HOME/.fonts
cd $HOME/.fonts
wget http://whitemagicsoftware.com/Copperplate-ThirtyThreeBC.ttf
export OSFONTDIR=$HOME/.fonts
mtxrun --script fonts --reload

Expected Results

All the fonts in $HOME/.fonts and subdirectories are globbed and
imported, within a few seconds.

Actual Results

The program hangs at Copperplate 33BC font with the CPU locked at
100%. The process must be killed.

Can you check the fotn with fontforge ?

also ttx (under linux) should shows some informations


Font Book (Apple) says this font has five serious errors and should not be used.


it has no hyphen so it's rather useless anyway

-
  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] \def\MyChapterCommand#1#2 error...

2013-10-11 Thread Hans Hagen

On 10/11/2013 11:13 PM, Ciro A. Soto wrote:

I am not able to use #1#2 arguments... Don't know what is going on.
thank you for your help

ciro
-


*Case 1) *
\setuphead[chapter][command=\MyChapterCommand]
\def\MyChapterCommand{}

\starttext
\chapter{first chapter}
\stoptext

*output:* no error message, pdf file produced. Everything as expected.

*Case 2)*
\setuphead[chapter][command=\MyChapterCommand]
\def\MyChapterCommand#1#2{{#1} : {#2}}


\unexpanded\def 



\starttext
\chapter{first chapter}
\stoptext

*output:*
.
.
.
fonts'fallback modern rm 12pt' is loaded
structuresectioning  chapter @ level 2 : 0.1 - first chapter
! Argument of \MyChapterCommand has an extra }..

system   tex  error on line 6 in file
/home/ciro/Desktop/TGM_SpanishTranslation/test2.tex: Argument of  ...

1 \setuphead[chapter][command=\MyChapterCommand]
2 %\def\MyChapterCommand{}
3 \def\MyChapterCommand#1#2{{#1} : {#2}
4 }
5 \starttext
6   \chapter{first chapter}
7 \stoptext
8





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




--

-
  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] Code Called Twice?

2013-10-11 Thread Hans Hagen

On 10/11/2013 1:00 PM, Philipp Gesang wrote:

···date: 2013-10-10, Thursday···from: Thangalin···



I noticed something unexpected with the following code:

\enabletrackers[metapost.showlog]

\startuseMPgraphic{heading:ThemeTitleStyle}
   show HEADING:THEMETITLESTYLE;
   show \MPstring{heading:title};

   draw textext( \MPstring{heading:title} ) rotated 5
 withcolor blue;
\stopuseMPgraphic

\defineframed[ThemeTitleStyle][
   background=\useMPgraphic{ThemeTitleStyle},
]

\def\processword#1{%
   \setMPtext{heading:title}{#1}%
   \useMPgraphic{heading:ThemeTitleStyle}
}

\define[1]\ThemeChapterTitle{\applytosplitstringword\processword{#1}}
\setuphead[chapter][deeptextcommand={\ThemeChapterTitle}]

\starttext
   \startchapter[title=Why Is heading:ThemeTitleStyle Called Twice?]
   \input knuth
   \stopchapter
\stoptext

It appears as though heading:ThemeTitleStyle is being called twice:

metapost info:

HEADING:THEMETITLESTYLE
Why

metapost info:

HEADING:THEMETITLESTYLE
Why


I am trying to produce a random number that is not equal to the
previous random number. However, if the code is called twice, then I'd
have to add code to ignore one of the calls.

Any ideas why the code seems to be called twice and what can be done
to ensure that it is only called once?


Don’t use text ;-) That’s a known issue: as soon as your Metapost
code contains text, it will be processed twice. E.g.:


   \starttext
 \setMPtext{heading:title}{foo}
 \startMPcode
   show This gets printed twice.;
   draw textext( \MPstring{heading:title} );
 \stopMPcode
   \stoptext

Same for labels, {b,e}tex. See also this thread:

   http://www.ntg.nl/pipermail/ntg-context/2011/056047.html


you can check for it:

\enabletrackers[metapost.showlog]

and in the mp code:

message(if mfun_first_run : first run else : final run fi) ;
message(if mfun_trial_run : trial run else : final run fi) ;

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] Bug: Reloading Font

2013-10-11 Thread Thangalin
FYI,

I didn't know that the font was corrupt. I have over 400 fonts on my
machine, and had to reload to pick up the new ones. You'll find that
having a large number of fonts will start to become a common situation
as more fonts become public (e.g., Google's Free Web Fonts project).
This increases the chances that some of those fonts will be corrupt.

It is a low priority, but a corrupt font should not cause a program to
hang or crash. The software should exit gracefully, and perhaps
strongly suggest to standard error that the user investigate that
particular font file.
For my particular application, eventually I will allow users to upload
custom fonts. If they upload a font that is corrupt (accidentally or
intentionally), a run-away process would make for a rainy day.

Kindest regards.
___
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] \def\MyChapterCommand#1#2 error...

2013-10-11 Thread Ciro A. Soto
thank you again.
(\unexpanded was not needed 5 years ago...)

ciro

ciro


Books you should read:

[image: Lead, Follow  Suceed] http://www.kavyata.com/lfs.html  [image:
The Guitar Maker] http://www.kavyata.com/tgm.html  [image: La Vida, El
Amor, La Mujer] http://www.kavyata.com/vam.html
My social profile: [image:
Facebook]http://www.facebook.com/profile.php?id=752641627 [image:
Twitter] http://www.twitter.com/CASotoAguirre


On Fri, Oct 11, 2013 at 5:18 PM, Hans Hagen pra...@wxs.nl wrote:

 On 10/11/2013 11:13 PM, Ciro A. Soto wrote:

 I am not able to use #1#2 arguments... Don't know what is going on.
 thank you for your help

 ciro
 --**---


 *Case 1) *

 \setuphead[chapter][command=\**MyChapterCommand]
 \def\MyChapterCommand{}

 \starttext
 \chapter{first chapter}
 \stoptext

 *output:* no error message, pdf file produced. Everything as expected.

 *Case 2)*

 \setuphead[chapter][command=\**MyChapterCommand]
 \def\MyChapterCommand#1#2{{#1} : {#2}}


 \unexpanded\def 


  \starttext
 \chapter{first chapter}
 \stoptext

 *output:*

 .
 .
 .
 fonts'fallback modern rm 12pt' is loaded
 structuresectioning  chapter @ level 2 : 0.1 - first chapter
 ! Argument of \MyChapterCommand has an extra }..


 system   tex  error on line 6 in file
 /home/ciro/Desktop/TGM_**SpanishTranslation/test2.tex: Argument of  ...

 1 \setuphead[chapter][command=\**MyChapterCommand]
 2 %\def\MyChapterCommand{}
 3 \def\MyChapterCommand#1#2{{#1} : {#2}
 4 }
 5 \starttext
 6   \chapter{first chapter}
 7 \stoptext
 8





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



 --

 --**--**-
   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 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/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] Bug: Reloading Font

2013-10-11 Thread Philipp Gesang
···date: 2013-10-11, Friday···from: Thangalin···

 FYI,
 
 I didn't know that the font was corrupt. I have over 400 fonts on my
 machine, and had to reload to pick up the new ones. You'll find that
 having a large number of fonts will start to become a common situation
 as more fonts become public (e.g., Google's Free Web Fonts project).
 This increases the chances that some of those fonts will be corrupt.
 
 It is a low priority, but a corrupt font should not cause a program to
 hang or crash. The software should exit gracefully, and perhaps
 strongly suggest to standard error that the user investigate that
 particular font file.

+1

 For my particular application, eventually I will allow users to upload
 custom fonts. If they upload a font that is corrupt (accidentally or
 intentionally), a run-away process would make for a rainy day.

That’s a serious problem with Luatex. The fontforge libraries
used to import font data simply hang with various corrupt fonts.
So far the only viable workaround is to manually create a
blacklist of bad fonts. E.g. this is the current list for
Luaotfload:

  https://github.com/lualatex/luaotfload/blob/master/luaotfload-blacklist.cnf

(Copperplate is going to be added soon.) Unfortunately, Context
does not yet have blacklisting functionality (it’s marked as todo
in the source) so you’re going to have to filter out bad files
from your font directories by hand.

Regards,
Philipp



pgpG9PmgyuKh_.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] Bug: Reloading Font

2013-10-11 Thread Thangalin
Hi

 (Copperplate is going to be added soon.) Unfortunately, Context

Keep in mind it was only Copperplate 33 BC. Also note that I could not
find any version of Copperplate 33 BC online that had the same file
size as my corrupt version. (I was trying to find the source of the
corrupt copy.)

Most other copies, I'd imagine, are fine, so don't be too quick to blacklist it.

 does not yet have blacklisting functionality (it’s marked as todo
 in the source) so you’re going to have to filter out bad files
 from your font directories by hand.

Sounds like the real solution is to fix fontforge so that it doesn't hang.

Dave
___
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] graphictext bug?

2013-10-11 Thread luigi scarso
On Fri, Oct 11, 2013 at 5:07 PM, Thangalin thanga...@gmail.com wrote:

 Hi,

 I have pstoedit installed now (that should be emphasized in section 8.6).

 $ pstoedit
 pstoedit: version 3.60 / DLL interface 108 (built: Dec  3 2011 -
 release build - g++ 4.6.2 - 64-bit) : Copyright (C) 1993 - 2011
 Wolfgang Glunz
 No output format specified (-f option) and format could not be deduced
 from suffix of output file since no output file name was given
 Usage: pstoedit -f format inputfile outputfile or run pstoedit
 -help to get a complete list available options.

 The -mpgraph.pdf file is created with the quoted content, but has no
 outline. The .mpy file is 0 bytes. I could not see anywhere pstoedit
 is being called in the logs.

 Same result: no outline.


it works with pstoedit 3.62 and ghostscript 9.06 on linux 64 bit
and windows.

-- 
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] Bug: Reloading Font

2013-10-11 Thread Hans Hagen

On 10/12/2013 12:26 AM, Philipp Gesang wrote:

···date: 2013-10-11, Friday···from: Thangalin···


FYI,

I didn't know that the font was corrupt. I have over 400 fonts on my
machine, and had to reload to pick up the new ones. You'll find that
having a large number of fonts will start to become a common situation
as more fonts become public (e.g., Google's Free Web Fonts project).
This increases the chances that some of those fonts will be corrupt.


sure, but fonts should be chosen with care .. and illegal ripoffs should 
be avoided (those cd's with hundreds of fonts, nowadays sites)


(quality of design / digitization, completeness of coverage, correctness 
of features ... much can be wrong)



It is a low priority, but a corrupt font should not cause a program to
hang or crash. The software should exit gracefully, and perhaps
strongly suggest to standard error that the user investigate that
particular font file.


+1


For my particular application, eventually I will allow users to upload
custom fonts. If they upload a font that is corrupt (accidentally or
intentionally), a run-away process would make for a rainy day.


In that case I'd run a separate font checker, as you never know what 
users upload. Similar issues can occur with those tagged formats that 
are in fact linked lists.



That’s a serious problem with Luatex. The fontforge libraries
used to import font data simply hang with various corrupt fonts.
So far the only viable workaround is to manually create a
blacklist of bad fonts. E.g. this is the current list for
Luaotfload:

   https://github.com/lualatex/luaotfload/blob/master/luaotfload-blacklist.cnf

(Copperplate is going to be added soon.) Unfortunately, Context
does not yet have blacklisting functionality (it’s marked as todo
in the source) so you’re going to have to filter out bad files
from your font directories by hand.


a slippery road .. blacklisting .. this is why it's todo .. (actually in 
the beginning context had something like that) ... the problem is that 
such lists can be persistent and users don't know about them


(anyhow, I enabled it in the treatments but probably am not going to 
waste much time on such fonts ... a font not loading is one, but in 
order to be complete blacklisting would also need to involve fonts with 
bugged encodings - and i've seen some - and other issues ... i also want 
to avoid a 'why doesn't this font work, it should because it's not 
blacklisted' kind of discussions)



Regards,
Philipp



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




--

-
  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] graphictext bug?

2013-10-11 Thread Hans Hagen

On 10/12/2013 1:18 AM, luigi scarso wrote:




On Fri, Oct 11, 2013 at 5:07 PM, Thangalin thanga...@gmail.com
mailto:thanga...@gmail.com wrote:

Hi,

I have pstoedit installed now (that should be emphasized in section
8.6).

$ pstoedit
pstoedit: version 3.60 / DLL interface 108 (built: Dec  3 2011 -
release build - g++ 4.6.2 - 64-bit) : Copyright (C) 1993 - 2011
Wolfgang Glunz
No output format specified (-f option) and format could not be deduced
from suffix of output file since no output file name was given
Usage: pstoedit -f format inputfile outputfile or run pstoedit
-help to get a complete list available options.

The -mpgraph.pdf file is created with the quoted content, but has no
outline. The .mpy file is 0 bytes. I could not see anywhere pstoedit
is being called in the logs.

Same result: no outline.


it works with pstoedit 3.62 and ghostscript 9.06 on linux 64 bit
and windows.


also, watch the error messages closely: mixed 32/64 bit pstoedit/gs does 
not work for instance


-
  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] \def\MyChapterCommand#1#2 error...

2013-10-11 Thread Hans Hagen

On 10/11/2013 11:45 PM, Ciro A. Soto wrote:

thank you again.
(\unexpanded was not needed 5 years ago...)


indeed, but at some point in mkiv development it was decided that it 
made sense .. already a few years ago


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] Bug: Reloading Font

2013-10-11 Thread Hans Hagen

On 10/12/2013 12:48 AM, Thangalin wrote:

Hi


(Copperplate is going to be added soon.) Unfortunately, Context


Keep in mind it was only Copperplate 33 BC. Also note that I could not
find any version of Copperplate 33 BC online that had the same file
size as my corrupt version. (I was trying to find the source of the
corrupt copy.)

Most other copies, I'd imagine, are fine, so don't be too quick to blacklist it.


indeed, and when you don't notice that it's blacklisted, it can happen 
that this one instance gets unnoticed



does not yet have blacklisting functionality (it’s marked as todo
in the source) so you’re going to have to filter out bad files
from your font directories by hand.


Sounds like the real solution is to fix fontforge so that it doesn't hang.


sure, although a crash has the nice advantage of knowing that a font 
(collection) is crap (which i then can blacklist permanently in my mind)


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] Code Called Twice?

2013-10-11 Thread Philipp Gesang
···date: 2013-10-11, Friday···from: Hans Hagen···

 On 10/11/2013 1:00 PM, Philipp Gesang wrote:
  ···date: 2013-10-10, Thursday···from: Thangalin···
 
 
  I noticed something unexpected with the following code:
 
  \enabletrackers[metapost.showlog]
 
  \startuseMPgraphic{heading:ThemeTitleStyle}
 show HEADING:THEMETITLESTYLE;
 show \MPstring{heading:title};
 
 draw textext( \MPstring{heading:title} ) rotated 5
   withcolor blue;
  \stopuseMPgraphic
 
  \defineframed[ThemeTitleStyle][
 background=\useMPgraphic{ThemeTitleStyle},
  ]
 
  \def\processword#1{%
 \setMPtext{heading:title}{#1}%
 \useMPgraphic{heading:ThemeTitleStyle}
  }
 
  \define[1]\ThemeChapterTitle{\applytosplitstringword\processword{#1}}
  \setuphead[chapter][deeptextcommand={\ThemeChapterTitle}]
 
  \starttext
 \startchapter[title=Why Is heading:ThemeTitleStyle Called Twice?]
 \input knuth
 \stopchapter
  \stoptext
 
  It appears as though heading:ThemeTitleStyle is being called twice:
 
  metapost info:
  HEADING:THEMETITLESTYLE
  Why
  metapost info:
  HEADING:THEMETITLESTYLE
  Why
 
  I am trying to produce a random number that is not equal to the
  previous random number. However, if the code is called twice, then I'd
  have to add code to ignore one of the calls.
 
  Any ideas why the code seems to be called twice and what can be done
  to ensure that it is only called once?
 
  Don’t use text ;-) That’s a known issue: as soon as your Metapost
  code contains text, it will be processed twice. E.g.:
 
 
 \starttext
   \setMPtext{heading:title}{foo}
   \startMPcode
 show This gets printed twice.;
 draw textext( \MPstring{heading:title} );
   \stopMPcode
 \stoptext
 
  Same for labels, {b,e}tex. See also this thread:
 
 http://www.ntg.nl/pipermail/ntg-context/2011/056047.html
 
 you can check for it:
 
 \enabletrackers[metapost.showlog]
 
 and in the mp code:
 
 message(if mfun_first_run : first run else : final run fi) ;
 message(if mfun_trial_run : trial run else : final run fi) ;
 
 Hans

That’s handy! I added a section on dealing with multi-pass to the
“gotchas” page:

http://wiki.contextgarden.net/Unexpected_behavior#Multipass

There is a subsection about MP at the end.

Btw. the behavior of mfun_trial_run is not very intuitive. I’d
expect it to work like \iftrialtypesetting, but in a single-pass
context it evaluates to true:

\enabletrackers[metapost.showlog]

\starttext
  \startMPcode
if mfun_trial_run :
  show This should be printed during the trial pass.;
else :
  show This should be printed during the final pass.;
fi;
fill unitcircle scaled 1cm withcolor blue;
%label (btex Some label text etex, (0,0));
  \stopMPcode
\stoptext

Uncommenting the label yields two passes, as expected.

Best regards,
Philipp



pgpgZd0xBOdkD.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] Bug: Reloading Font

2013-10-11 Thread Philipp Gesang
···date: 2013-10-12, Saturday···from: Hans Hagen···

 On 10/12/2013 12:48 AM, Thangalin wrote:
  Hi
 
  (Copperplate is going to be added soon.) Unfortunately, Context
 
  Keep in mind it was only Copperplate 33 BC. Also note that I could not
  find any version of Copperplate 33 BC online that had the same file
  size as my corrupt version. (I was trying to find the source of the
  corrupt copy.)
 
  Most other copies, I'd imagine, are fine, so don't be too quick to 
  blacklist it.
 
 indeed, and when you don't notice that it's blacklisted, it can happen 
 that this one instance gets unnoticed
 
  does not yet have blacklisting functionality (it’s marked as todo
  in the source) so you’re going to have to filter out bad files
  from your font directories by hand.
 
  Sounds like the real solution is to fix fontforge so that it doesn't hang.
 
 sure, although a crash has the nice advantage of knowing that a font 
 (collection) is crap (which i then can blacklist permanently in my mind)

Sure, but there’s a difference between a crash and a freeze. The
latter can be quite annoying for those who work with strange
editors that run TeX somewhere in the background making it
impossible to kill the process using Ctrl-C.

Philipp



pgpYYsl3noIpe.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] Code Called Twice?

2013-10-11 Thread Hans Hagen

On 10/12/2013 2:09 AM, Philipp Gesang wrote:


Btw. the behavior of mfun_trial_run is not very intuitive. I’d
expect it to work like \iftrialtypesetting, but in a single-pass
context it evaluates to true:


keep in mind that one really needs to process the text in order to get 
the dimensions right ... so trialtypesetting is something else


so, the trial run flag has to be used with care

also, texts are cached, so if you typeset for instance labels, 500 times 
a '1' or '2' will only be typeset once (over the years lots of small 
optimizations took place)


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] Bug: Reloading Font

2013-10-11 Thread Hans Hagen

On 10/12/2013 2:15 AM, Philipp Gesang wrote:

···date: 2013-10-12, Saturday···from: Hans Hagen···


On 10/12/2013 12:48 AM, Thangalin wrote:

Hi


(Copperplate is going to be added soon.) Unfortunately, Context


Keep in mind it was only Copperplate 33 BC. Also note that I could not
find any version of Copperplate 33 BC online that had the same file
size as my corrupt version. (I was trying to find the source of the
corrupt copy.)

Most other copies, I'd imagine, are fine, so don't be too quick to blacklist it.


indeed, and when you don't notice that it's blacklisted, it can happen
that this one instance gets unnoticed


does not yet have blacklisting functionality (it’s marked as todo
in the source) so you’re going to have to filter out bad files
from your font directories by hand.


Sounds like the real solution is to fix fontforge so that it doesn't hang.


sure, although a crash has the nice advantage of knowing that a font
(collection) is crap (which i then can blacklist permanently in my mind)


Sure, but there’s a difference between a crash and a freeze. The
latter can be quite annoying for those who work with strange
editors that run TeX somewhere in the background making it
impossible to kill the process using Ctrl-C.


it depends what causes the freeze, for instance if there is a circular 
reference someplace, then that is hard to catch unless one uses timeouts 
which in themselves are tricky (not much different from browsers locking 
up on some javascript); keep in mind that we load a whole font, while 
other applications might do a partial load and never see the problematic 
data (maybe even ignore portions of the font)


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] [***SPAM***] itemization

2013-10-11 Thread hwitloc

Good idea.  It has documented spacing controls.  I'll give it a try.
Thanks

luigi scarso luigi.sca...@gmail.com wrote:
 On Fri, Oct 11, 2013 at 2:15 PM, hwit...@gmail.com wrote:
 
 I want to mave minimal inter-column spacing in the following
 construct, or be able to specify a maximum width for the full
 populated reactangular area.
 
 For example the results of the below source have inter-column
 spacing of about 5 cm.
 
 Regards
 
 
 - minimum example (How to specify an overall width
 or the inter-column spacing.
 \starttext
 \startitemize[none,columns,three,packed,joinedup,8*serried,]
 [width=0mm]
 \item A \item B \item C
 \item D \item E \item F
 \item G \item H \item I
 \stopitemize
 \stoptext
 
 Maybe starttabulate 
 http://wiki.contextgarden.net/Command/starttabulate
 ?
 -- 
 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
 ___
___
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] Bug: Reloading Font

2013-10-11 Thread Thangalin
Hi,

 sure, but fonts should be chosen with care .. and illegal ripoffs should be
 avoided (those cd's with hundreds of fonts, nowadays sites)

See: https://github.com/w0ng/googlefontdirectory

 (quality of design / digitization, completeness of coverage, correctness of
 features ... much can be wrong)

See also: http://hellohappy.org/beautiful-web-type/

 In that case I'd run a separate font checker, as you never know what users
 upload. Similar issues can occur with those tagged formats that are in fact
 linked lists.

That's a good idea. The TTX font tool was going to be my first stop.

http://sourceforge.net/projects/fonttools/

 sure, although a crash has the nice advantage of knowing that a font 
 (collection)
 is crap (which i then can blacklist permanently in my mind)

A crash, from a practical point of view, is much easier to deal with
than a runaway CPU, which is altogether nasty. (On older systems, if
you have only one or two CPUs, it can quite quickly take down a
system.)

Warm regards.
___
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
___