Re: [NTG-context] compresslevel and png graphics (mkiv)

2011-05-27 Thread Henning Hraban Ramm

Am 2011-05-26 um 19:43 schrieb mathew:


Some numbers:

SVG to PDF: Two diagrams, 25k.
SVG to EPS: Same two diagrams, 54k.
Difference: 29k.

Document rendered using the PDFs: 535k.
Document rendered using the EPSs: 463k.
Difference: 72k in the opposite direction.


Be aware that ConTeXt needs to convert EPS (or SVG) to PDF before  
including - so providing EPS might elongate processing time.
And PDF sizes depend very much on the used tools, e.g. Acrobat  
Distiller PDFs are often smaller than GhostScript PDFs, even if  
there's no downgrading of pixel images involved.



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

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

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


Re: [NTG-context] compresslevel and png graphics (mkiv)

2011-05-27 Thread Hans Hagen

On 27-5-2011 8:17, Henning Hraban Ramm wrote:


Be aware that ConTeXt needs to convert EPS (or SVG) to PDF before
including - so providing EPS might elongate processing time.


Only once, as conversion is cached.


And PDF sizes depend very much on the used tools, e.g. Acrobat Distiller
PDFs are often smaller than GhostScript PDFs, even if there's no
downgrading of pixel images involved.


Actually, adobe tools tend to bloat pdf nowadays esp because of those 
uncompressed xml blobs (last week I saw an indesign file that had 6 
lines of xml for each time the file has been edited (timestamps etc, 
rather useless info) which added up to quite some Kbytes.


And, adding structure (tagged pdf) is really bloating the file.

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] [solved] t-filter: no table created when Unicode characters are included

2011-05-27 Thread Paul Menzel
Am Montag, den 02.05.2011, 17:30 +0200 schrieb Paul Menzel:
 Am Sonntag, den 01.05.2011, 15:09 -0400 schrieb Aditya Mahajan:
  On Sun, 1 May 2011, Aditya Mahajan wrote:
  
   On Sun, 1 May 2011, Peter Münster wrote:
  
   So, whatever the original enviroment is, context and/or luatex sets
   LC_COLLATE=C
   LC_CTYPE=C
   LC_NUMERIC=C
  
   Confirmed. Now the question is, why does this cause pandoc to behave 
   strangely.
  
  Perhaps due to a old bug in pandoc
  http://code.google.com/p/pandoc/issues/detail?id=233
  http://www.readmespot.com/question/f/163755/pandoc-locale-problems
  
  This was fixed in pandoc 1.6 that is why I don't see it. Paul, you will 
  have to manually update pandoc.
 
 Thank you very much for all your help. I will wait for the updated
 Pandoc and retest. In the mean time I am going to use t-rst.

Pandoc 1.8.1.1 is available in the Debian Sid/unstable repositories [1]
now. I tested the minimal example and after adding the

\setupbodyfont[times]

as you did, everything works as expected.

Thank you very much and sorry for noise, because this was an external
problem.


Thanks,

Paul


[1] http://packages.qa.debian.org/p/pandoc/news/20110526T214713Z.html


signature.asc
Description: This is a digitally signed message part
___
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] \asciimode and cld

2011-05-27 Thread Peter Münster
Hello,

How can one use \asciimode in cld syntax?

This does not seem to work:

context.starttext()
context.asciimode()
contextbla % bla
context.stoptext()

TIA for any hints!

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


Re: [NTG-context] TOC : Chapter title under its number (separate lines)

2011-05-27 Thread Alan Braslau
On Thu, May 26, 2011 at 08:16:21PM +0200, Wolfgang Schuster wrote:
 
 Am 26.05.2011 um 18:48 schrieb Alan Braslau:
 
  \setuplist[chapter][label=yes,alternative=vertical,command=\ChapterList,interaction=all]
  
  Almost works. Almost in that all lines get indented by one level,
  and then the page number (and the title if it is long and multi-line)
  stick(s) out by this much on the right.
  
  The manual is a bit cryptic concerning horizontal and vertical:
  As an alternative for none, we can use horizontal and vertical.
  Both commands have their spacing tuned for typesetting lists in
  for instance menus.
 
 I don’t read the manual very often, so i missed this.

Before asking for help, I always
1) experiment
2) look in the manual(s)
3) search the mailing list
4) consult the wiki
5) try to understand the sources
I'm sure that you start with the last step.

 
 There are two ways to have a interactive list:
 
 1. Patch the command alternative
 
 2. Introduce a new alternative which has interactive support
plus a few more missing features (e.g. label support)
 
 Wolfgang

In fact,
\setuplist [chapter] [label=yes]
should work out of the box.

Currently, one must set:
\setuplabeltext [chapter=Chapter ] % with trailing space; blank by default
\setuplabeltext [appendix=Appendix ]  % with trailing space; blank by default
(This *should* be included in the language files, not redefined by the user. 
Indeed, \setuphead [chapter] [label=no] could be the default, not blanking 
out the labeltext.)
Secondly, the spacing of the TOC is all wrong. This should not need patching to 
yield an acceptable result.

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

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

[NTG-context] checking mainlanguage setup

2011-05-27 Thread Jeong Dalyoung
Dear all,

Is it possible to check what is the mainlanguage set in document?
Now, I use \enablemode[kr] to do something A. But, I'd like to do it 
automatically if possible.

For example,

I'd like to do the following type of setup.


if mainlanguage == kr then

do something A

elseif mainlanguage == en then

do something B

else
do something C

endif

So, if \mainlanguage[kr] is set, then do A, and etc.

Thank you for reading.

Best regards,

Dalyoung



___
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] checking mainlanguage setup

2011-05-27 Thread Pontus Lurcock
On Fri 27 May 2011, Jeong Dalyoung wrote:

 Is it possible to check what is the mainlanguage set in document?
 Now, I use \enablemode[kr] to do something A. But, I'd like to do it
 automatically if possible.

According to http://wiki.contextgarden.net/Modes#System_modes , 
the mode **kr should be automatically set if kr is the main language
(I haven't tried it, though).

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] checking mainlanguage setup

2011-05-27 Thread Marco
 I'd like to do the following type of setup.
 
 
 if mainlanguage == kr then
 
   do something A
 
 elseif mainlanguage == en then
 
   do something B
 
 else
   do something C
 
 endif

\starttext
\startluacode
  if languages.current() == kr then
context(Something A)
  elseif languages.current() == en then
 context(Something B)
  else
 context(Something C)
  end
\stopluacode
\stoptext

Marco


___
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] checking mainlanguage setup

2011-05-27 Thread Peter Münster
On Fri, May 27 2011, Jeong Dalyoung wrote:

 Is it possible to check what is the mainlanguage set in document?

Yes. Example:

%\mainlanguage[fr]
%\language[fr]
\starttext
currentlanguage:
\doifelse\currentlanguage{fr}{French}{Not French}\par
currentmainlanguage:
\doifelse\currentmainlanguage{fr}{French}{Not French}\par
translate: \translate[fr=Français, en=French]
\stoptext

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

[NTG-context] [metafun] graphictext in mkiv

2011-05-27 Thread Marco
The »graphictext« makro does not work in mkiv, is it a bug
or intended? This example works in mkii:

\starttext
\startMPcode
draw image(graphictext FooBar scaled 8);
\stopMPcode
\stoptext

Marco


___
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] compresslevel and png graphics (mkiv)

2011-05-27 Thread Peter Rolf
Am 26.05.2011 18:17, schrieb Peter Rolf:
 Am 26.05.2011 12:52, schrieb Peter Rolf:
 Am 25.05.2011 21:54, schrieb Hartmut Henkel:
 [..]

 no. There is a PNG Copy function for literal embedding of the PNG
 file, but that triggers only, if the file simultaneously satisfies quite
 a few conditions, which are about: non-interlaced, no palette, no
 transparency, no gamma coming with it, no gamma modification requested,
 no white adjustment in the PNG, and a few more rare others. Else it's
 de-compressed and then re-compressed to the \pdfcompresslevel, and
 additional streams and dicts are added. You see in the log if it finally
 was PNG Copy or not.

 [..]

 These are about the factors affecting the PNG to PDF size. For your big
 PNG graphic you may find a preprocessing (e. g., pngtopnm | pnmtopng
 will definitely remove all fat) that makes it compliant with the PNG
 copy.

 I will give that a try. But I doubt that there is much 'fat' on that
 graphic. Anyhow, you never know before you have tried it. :-)

 
 No luck. I used imagemagick to convert to pnm and back.
 Transparency was removed before by adding a white background, also all
 not critical chunks (ICC profile, backgroundcolor, resolution, creation
 and modify date, comment) were removed. The graphic is a valid PNG
 (TweakPNG) and aside from the size, there is nothing special with this
 graphic. Still no '(PNG copy)'.
 
 @luigi: an ICC profile definitely breaks the png copy rules
 
 The only chunks left are
 
 IHDRPNG image header: 5900x4094, 8bits/sample, truecolor, noninterlaced
 IDATPNG image data
 ..
 IDATPNG image data
 IENDend-of-image marker
 
 Mh, where is the show stopper? The compression method?

Looks like some of ConTeXt PDF/X-related settings is causing this. If I
reduce the code to the pure picture, the '(PNG copy)' is triggered.
Probably the active color management (default color space) is breaking
the copy process here.

Sorry for any inconvenience. I should have tested this case before...

Best wishes, Peter


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

___
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] \asciimode and cld

2011-05-27 Thread Hans Hagen

On 27-5-2011 11:00, Peter Münster wrote:

Hello,

How can one use \asciimode in cld syntax?

This does not seem to work:

context.starttext()
context.asciimode()
contextbla % bla
context.stoptext()


\starttext

\startluacode
context.startTEXpage()
context.starttext()
context.pushcatcodes(txtcatcodes)
context(bla % bla)
context.popcatcodes()
context.stoptext()
context.stopTEXpage()
\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] compresslevel and png graphics (mkiv)

2011-05-27 Thread Hartmut Henkel
  @luigi: an ICC profile definitely breaks the png copy rules
  
  The only chunks left are
  
  IHDRPNG image header: 5900x4094, 8bits/sample, truecolor,
 noninterlaced
  IDATPNG image data
  ..
  IDATPNG image data
  IENDend-of-image marker
  
  Mh, where is the show stopper? The compression method?
 
 Looks like some of ConTeXt PDF/X-related settings is causing this. If I
 reduce the code to the pure picture, the '(PNG copy)' is triggered.
 Probably the active color management (default color space) is breaking
 the copy process here.

must be some \pdfimageapplygamma  0, only this and the \pdfimagehicolor
primitive can influence this low level stuff.

Btw, just \pdfimageapplygamma  0 (without setting \pdfgamma and 
\pdfimagegamma) already changes the PNG image, since the luatex (and pdftex) 
internal defaults are not gamma-neutral. No idea if (and then
to which value) this should be fixed.

Regards, Hartmut
-- 
Empfehlen Sie GMX DSL Ihren Freunden und Bekannten und wir
belohnen Sie mit bis zu 50,- Euro! https://freundschaftswerbung.gmx.de
___
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] TOC : Chapter title under its number (separate lines)

2011-05-27 Thread Mathieu DUPONT


As for the interaction patching, in the following example I can't figure out 
how to have, for the chapter lines, only CHAPTER 1 being the interaction and 
not the title + the dots line + the page number, as it is the case with 
this code.The example is minimal, but I left everything I am afraid could be 
dropped by a solution.
Thanks for help !

\setupinteraction[state=start]
\setuplabeltext[chapter=CHAPITRE~]
\setupcombinedlist[content][level=3,alternative=c,  ]   
\unprotect\define[3]\ChapterList{\vbox{ \setuplocalinterlinespace[line=2.8ex]   
\listparameter\c!before \leftskip\listparameter\c!margin
\noindent\currentlistsymbol\crlf#2\enspace\listdots\enspace#3   \par
\listparameter\c!after  \setuplocalinterlinespace[line=4.2ex]   }}\protect
\setuplist[chapter][label=yes,  alternative=vertical,   
command=\ChapterList,   interaction=all,]   \starttext
\startfrontmatter\placecontent\stopfrontmatter
\startbodymatter\chapter{CHAPTER}\section{SECTION}\subsection{SUBSECTION}\stopbodymatter
\stoptext 



Mathieu



 Date: Fri, 27 May 2011 11:14:26 +0200
 From: alan.bras...@cea.fr
 To: schuster.wolfg...@googlemail.com
 CC: ntg-context@ntg.nl
 Subject: Re: [NTG-context] TOC : Chapter title under its number (separate 
 lines)
 
 On Thu, May 26, 2011 at 08:16:21PM +0200, Wolfgang Schuster wrote:
  
  Am 26.05.2011 um 18:48 schrieb Alan Braslau:
  
   \setuplist[chapter][label=yes,alternative=vertical,command=\ChapterList,interaction=all]
   
   Almost works. Almost in that all lines get indented by one level,
   and then the page number (and the title if it is long and multi-line)
   stick(s) out by this much on the right.
   
   The manual is a bit cryptic concerning horizontal and vertical:
 As an alternative for none, we can use horizontal and vertical.
 Both commands have their spacing tuned for typesetting lists in
 for instance menus.
  
  I don’t read the manual very often, so i missed this.
 
 Before asking for help, I always
 1) experiment
 2) look in the manual(s)
 3) search the mailing list
 4) consult the wiki
 5) try to understand the sources
 I'm sure that you start with the last step.
 
  
  There are two ways to have a interactive list:
  
  1. Patch the command alternative
  
  2. Introduce a new alternative which has interactive support
 plus a few more missing features (e.g. label support)
  
  Wolfgang
 
 In fact,
 \setuplist [chapter] [label=yes]
 should work out of the box.
 
 Currently, one must set:
 \setuplabeltext [chapter=Chapter ] % with trailing space; blank by default
 \setuplabeltext [appendix=Appendix ]  % with trailing space; blank by default
 (This *should* be included in the language files, not redefined by the user. 
 Indeed, \setuphead [chapter] [label=no] could be the default, not blanking 
 out the labeltext.)
 Secondly, the spacing of the TOC is all wrong. This should not need patching 
 to yield an acceptable result.
 
 Alan
 ___
 If your question is of interest to others as well, please add an entry to the 
 Wiki!
 
 maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
 webpage  : http://www.pragma-ade.nl / http://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] \asciimode and cld

2011-05-27 Thread Hans Hagen

On 27-5-2011 3:07, Hans Hagen wrote:

On 27-5-2011 11:00, Peter Münster wrote:

Hello,

How can one use \asciimode in cld syntax?

This does not seem to work:

context.starttext()
context.asciimode()
contextbla % bla
context.stoptext()


\starttext

\startluacode
context.startTEXpage()
context.starttext()
context.pushcatcodes(txtcatcodes)
context(bla % bla)
context.popcatcodes()
context.stoptext()
context.stopTEXpage()
\stopluacode

\stoptext


better

\startluacode
context.startTEXpage()
context.pushcatcodes(txtcatcodes)
context(bla % bla)
context.popcatcodes()
context.stopTEXpage()
\stopluacode



-
  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] TOC : Chapter title under its number (separate lines)

2011-05-27 Thread Alan Braslau
interaction=sectionnumber
rather than
interaction=all
doesn't seem to help here...

Alan

On Fri, May 27, 2011 at 09:33:53AM -0400, Mathieu DUPONT wrote:
 
 As for the interaction patching, in the following example I can't figure out
 how to have, for the chapter lines, only CHAPTER 1 being the interaction and
 not the title + the dots line + the page number, as it is the case with
 this code.
 The example is minimal, but I left everything I am afraid could be dropped by 
 a
 solution.
 
 Thanks for help !
 
 
 \setupinteraction[state=start]
 
 \setuplabeltext[chapter=CHAPITRE~]
 
 \setupcombinedlist[content][
 level=3,
 alternative=c,
 ]
 \unprotect
 \define[3]\ChapterList{\vbox{
 \setuplocalinterlinespace[line=2.8ex]
 \listparameter\c!before
 \leftskip\listparameter\c!margin
 \noindent\currentlistsymbol\crlf#2\enspace\listdots\enspace#3
 \par
 \listparameter\c!after
 \setuplocalinterlinespace[line=4.2ex]
 }}
 \protect
 
 \setuplist[chapter][
 label=yes,
 alternative=vertical,
 command=\ChapterList,
 interaction=all,
 ]
 \starttext
 
 \startfrontmatter
 \placecontent
 \stopfrontmatter
 
 \startbodymatter
 \chapter{CHAPTER}
 \section{SECTION}
 \subsection{SUBSECTION}
 \stopbodymatter
 
 \stoptext 
 
 Mathieu
___
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] TOC : Chapter title under its number (separate lines)

2011-05-27 Thread Mathieu DUPONT


No, I had tried that.The problem is obviously caused by all the layers of 
patching, which I need though.



Mathieu



 Date: Fri, 27 May 2011 16:00:36 +0200
 From: alan.bras...@cea.fr
 To: ntg-context@ntg.nl
 Subject: Re: [NTG-context] TOC : Chapter title under its number (separate 
 lines)
 
 interaction=sectionnumber
 rather than
 interaction=all
 doesn't seem to help here...
 
 Alan
 
 On Fri, May 27, 2011 at 09:33:53AM -0400, Mathieu DUPONT wrote:
  
  As for the interaction patching, in the following example I can't figure out
  how to have, for the chapter lines, only CHAPTER 1 being the interaction 
  and
  not the title + the dots line + the page number, as it is the case 
  with
  this code.
  The example is minimal, but I left everything I am afraid could be dropped 
  by a
  solution.
  
  Thanks for help !
  
  
  \setupinteraction[state=start]
  
  \setuplabeltext[chapter=CHAPITRE~]
  
  \setupcombinedlist[content][
  level=3,
  alternative=c,
  ]
  \unprotect
  \define[3]\ChapterList{\vbox{
  \setuplocalinterlinespace[line=2.8ex]
  \listparameter\c!before
  \leftskip\listparameter\c!margin
  \noindent\currentlistsymbol\crlf#2\enspace\listdots\enspace#3
  \par
  \listparameter\c!after
  \setuplocalinterlinespace[line=4.2ex]
  }}
  \protect
  
  \setuplist[chapter][
  label=yes,
  alternative=vertical,
  command=\ChapterList,
  interaction=all,
  ]
  \starttext
  
  \startfrontmatter
  \placecontent
  \stopfrontmatter
  
  \startbodymatter
  \chapter{CHAPTER}
  \section{SECTION}
  \subsection{SUBSECTION}
  \stopbodymatter
  
  \stoptext 
  
  Mathieu
 ___
 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] \definehead \setuphead new type included in a list such as TOC

2011-05-27 Thread Mathieu DUPONT


That was very useful.
Thanks again Wolfgang !



Mathieu



From: schuster.wolfg...@googlemail.com
Date: Thu, 26 May 2011 18:52:48 +0200
To: ntg-context@ntg.nl
Subject: Re: [NTG-context] \definehead \setuphead new type included in a
list such as TOC




Am 26.05.2011 um 18:15 schrieb Mathieu DUPONT:Hi,
In the following example, I define 2 new heads, and I want them to :
1- inherits from Title (or Chapter would be fine)2- show in the TOC3- not be 
counted (CHAPTER should be 1)
Is there an option I can put into \setuphead[Abstract][] so it gets included in 
the TOC ?That would be the easiest way of getting the three desired results.
Your own headings aren’t shown in the TOC because you use \completecontentwhich 
lists only the default numbered headings (\part, \chapter etc.)
There are different solution:
1. Replace \completecontent with the following
  \title{Contents}  \placelist[part,chapter,Abstract,Intro, section,...]
2. Redefine \completecontent (it’s explained in the big manual):
  \definecombinedlist[content][part,chapter,Abstract,Intro, section,...]
3. Create your own combinedlist:
  \definecombinedlist[mycontent][part,chapter,Abstract,Intro, section,...]
  \setupheadtext[mycontent=Contents]
  \starttext
  \completemycontent
  \stoptext
Wolfgang


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

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___
   ___
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] Validate (cross)references

2011-05-27 Thread Andreas Schneider
Hello,

if  I  use  \in,  \about,  \at  or  anything  else  that  generates  a
cross-reference,  and  that  reference  happens to be invalid (typo or
whatever),  it  just  prints  out  nothing.  Is  there a way to have
context throw an error if a reference is invalid? (That probably would
only  make  sense  in the second pass of context, since the first pass
has to collect the references first.)

If context can't do it by itself, I'll probably just grep for unknown
reference  and  use  that,  but  if context could do it by itself, it
would be nice for automated builds (I actually have my current ConTeXt
project in a Continous Integration system, so anything that leads to a
wrong result should throw an error there.)

-- 
Best Regards,
Andreas

___
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] Validate (cross)references

2011-05-27 Thread Wolfgang Schuster

Am 27.05.2011 um 17:04 schrieb Andreas Schneider:

 Hello,
 
 if  I  use  \in,  \about,  \at  or  anything  else  that  generates  a
 cross-reference,  and  that  reference  happens to be invalid (typo or
 whatever),  it  just  prints  out  nothing.  Is  there a way to have
 context throw an error if a reference is invalid? (That probably would
 only  make  sense  in the second pass of context, since the first pass
 has to collect the references first.)

Unknown references are shown as “??” in your text.

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] compresslevel and png graphics (mkiv)

2011-05-27 Thread Peter Rolf
Am 27.05.2011 15:09, schrieb Hartmut Henkel:
 @luigi: an ICC profile definitely breaks the png copy rules

 The only chunks left are

 IHDRPNG image header: 5900x4094, 8bits/sample, truecolor,
 noninterlaced
 IDATPNG image data
 ..
 IDATPNG image data
 IENDend-of-image marker

 Mh, where is the show stopper? The compression method?

 Looks like some of ConTeXt PDF/X-related settings is causing this. If I
 reduce the code to the pure picture, the '(PNG copy)' is triggered.
 Probably the active color management (default color space) is breaking
 the copy process here.
 
Sorry Hartmut, my last statement is complete BS. I made a 'blind' run in
my lunch break, not inspecting the pdf. And sadly I had forgotten, that
I changed the test file yesterday to use a small png test graphic
instead of my big png. *brain vs. full stomach: 0:1*

So the PDF/X settings have no influence on this. The big png is not
'copied'.
Anyhow, this is not a serious problem and honestly I don't have that
much time now. When I have some more time I will use gdb to find the
failing condition in writepng.w. Will be interesting, the last time I
used gdb is more than 10 years ago.

Thanks for all answers so far.

Regards, Peter

 must be some \pdfimageapplygamma  0, only this and the \pdfimagehicolor
 primitive can influence this low level stuff.
 
 Btw, just \pdfimageapplygamma  0 (without setting \pdfgamma and 
 \pdfimagegamma) already changes the PNG image, since the luatex (and pdftex) 
 internal defaults are not gamma-neutral. No idea if (and then
 to which value) this should be fixed.
 
 Regards, Hartmut

___
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] compresslevel and png graphics (mkiv)

2011-05-27 Thread luigi scarso
On Fri, May 27, 2011 at 5:11 PM, Peter Rolf indi...@gmx.net wrote:
 Am 27.05.2011 15:09, schrieb Hartmut Henkel:
 @luigi: an ICC profile definitely breaks the png copy rules

 The only chunks left are

 IHDR    PNG image header: 5900x4094, 8bits/sample, truecolor,
 noninterlaced
 IDAT    PNG image data
 ..
 IDAT    PNG image data
 IEND    end-of-image marker

 Mh, where is the show stopper? The compression method?

 Looks like some of ConTeXt PDF/X-related settings is causing this. If I
 reduce the code to the pure picture, the '(PNG copy)' is triggered.
 Probably the active color management (default color space) is breaking
 the copy process here.

 Sorry Hartmut, my last statement is complete BS. I made a 'blind' run in
 my lunch break, not inspecting the pdf. And sadly I had forgotten, that
 I changed the test file yesterday to use a small png test graphic
 instead of my big png. *brain vs. full stomach: 0:1*

 So the PDF/X settings have no influence on this. The big png is not
 'copied'.
 Anyhow, this is not a serious problem and honestly I don't have that
 much time now. When I have some more time I will use gdb to find the
 failing condition in writepng.w. Will be interesting, the last time I
 used gdb is more than 10 years ago.
if you have an example with a public png I can take a look...

-- 
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] Validate (cross)references

2011-05-27 Thread Andreas Schneider
On Friday, May 27, 2011 17:09 Wolfgang Schuster wrote:

 Am 27.05.2011 um 17:04 schrieb Andreas Schneider:

 Hello,
 
 if  I  use  \in,  \about,  \at  or  anything  else  that  generates  a
 cross-reference,  and  that  reference  happens to be invalid (typo or
 whatever),  it  just  prints  out  nothing.  Is  there a way to have
 context throw an error if a reference is invalid? (That probably would
 only  make  sense  in the second pass of context, since the first pass
 has to collect the references first.)

 Unknown references are shown as “??” in your text.

 Wolfgang

True,  I  was  mostly  thinking  about \about, which just prints two
quotation  marks  and  nothing  in between. But my problem (if I can
even  call  it  that, since grep is already a solution, just maybe not
the  best one :D) is, that I could easily miss such small changes. I'm
working  on  technical  documentation  that  even  has  parts that are
automatically  generated  (from  XML files). I just update whatever is
necessary  (the document itself, or just the input files), commit them
to  SVN  and  our  CI  server grabs them, and runs ConTeXt. If ConTeXt
returns  with  a  return code  0, the build is marked as failed and
all  necessary  admins  (me  and  my colleague) are informed via eMail
and/or  RSS  feed.  If  the  build  succeeds,  the  generated  PDF  is
automatically distributed to the users. I consider wrong references an
error,  so  I would like the build to fail (imho referencing something
that  doesn't  exist  is  like using a macro that doesn't exist, which
fails too).

But  as I said: if context can't treat that as error, I'm fine with it
too  and  will  continue  to  grep the logfile. It's just curiosity if
there may already be a setting/parameter/whatever to get context to be
more restrictive.

-- 
Best Regards,
Andreas

___
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] compresslevel and png graphics (mkiv)

2011-05-27 Thread Peter Rolf
Am 27.05.2011 17:19, schrieb luigi scarso:
 On Fri, May 27, 2011 at 5:11 PM, Peter Rolf indi...@gmx.net wrote:
 Am 27.05.2011 15:09, schrieb Hartmut Henkel:
 @luigi: an ICC profile definitely breaks the png copy rules

 The only chunks left are

 IHDRPNG image header: 5900x4094, 8bits/sample, truecolor,
 noninterlaced
 IDATPNG image data
 ..
 IDATPNG image data
 IENDend-of-image marker

 Mh, where is the show stopper? The compression method?

 Looks like some of ConTeXt PDF/X-related settings is causing this. If I
 reduce the code to the pure picture, the '(PNG copy)' is triggered.
 Probably the active color management (default color space) is breaking
 the copy process here.

 Sorry Hartmut, my last statement is complete BS. I made a 'blind' run in
 my lunch break, not inspecting the pdf. And sadly I had forgotten, that
 I changed the test file yesterday to use a small png test graphic
 instead of my big png. *brain vs. full stomach: 0:1*

 So the PDF/X settings have no influence on this. The big png is not
 'copied'.
 Anyhow, this is not a serious problem and honestly I don't have that
 much time now. When I have some more time I will use gdb to find the
 failing condition in writepng.w. Will be interesting, the last time I
 used gdb is more than 10 years ago.
 if you have an example with a public png I can take a look...
 
Thanks Luigi. PM is on its way.
___
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] First Line After Whitespace Styling

2011-05-27 Thread Marc Trius
Hi,
I would like to be able to specify a style that would apply to text that 
appears on the first line of a paragraph after whitespace. I have no idea how 
to go about it. 

Specifically, I have a font with an alternate glyph that can only be used after 
whitespace, and I would like to have it used automatically when appropriate. 

Thank you,
Marc Trius

-- 
Marc Trius derpay...@riseup.net

The enemy is the gramophone mind, whether or not one agrees with the record 
that is being played at the moment. --- George Orwell
___
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] First Line After Whitespace Styling

2011-05-27 Thread Wolfgang Schuster

Am 27.05.2011 um 18:08 schrieb Marc Trius:

 Hi,
 I would like to be able to specify a style that would apply to text that 
 appears on the first line of a paragraph after whitespace. I have no idea how 
 to go about it. 
 
 Specifically, I have a font with an alternate glyph that can only be used 
 after whitespace, and I would like to have it used automatically when 
 appropriate. 

Do you want a initial?

\setupinitial[state=start]

\starttext
\placeinitial \input knuth
\stoptext

Wolfgang

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

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


[NTG-context] line numbers in margin from xml in context mkiv

2011-05-27 Thread Jon Crump
Hans, et alia,

Thanks for mentioning typo-mar.mkiv. Once I found it, and figured out
what to do with it (put it in my texmf-local directory), it appears
to, as you say, offer more control over margindata. My (rather
belated) thanks for offering this extended functionality, though my
grasp of context is still too fragile to really understand how to use
it.

typo-mar.mkiv appears to introduce a bug in my Arabic typesetting. In
my bilingual text, my margin data (pg/lb numbers) are placed correctly
in the margin of the English text, but the margins of the Arabic text
appear to be miscalculated and the margindata overwrites the
beginnings of the lines (or disappears beyond the edge if I set margin
'left'). My tyronic fooling around may certainly be at fault, but if
you could offer any observations on the following, I'd be grateful.

ConTeXt  ver: 2011.04.24 15:15 MKIV
My environment file is included below, stripped down as far as I could
to its essentials. I've attached the ara-style.tex file setting up
ScheherazadeRegOT; a stripped down example of my tei/xml source; and
the pdf output I'm getting. I hope I violate no convention of the list
in attaching these files, but in my naivete I'm not sure how much
information is too much.

\startxmlsetups xml:teisetups
       \xmlsetsetup{#1}{*}{-}
       \xmlsetsetup{#1}{body|p|pb|lb|}{xml:*}
       \xmlsetsetup{#1}{div[@xml:id='apr_arab']}{xml:div:arab}
       \xmlsetsetup{#1}{div[@xml:id='apr_engl']}{xml:div:engl}
               \xmlsetsetup{#1}{pb}{xml:pb}
               \xmlsetsetup{#1}{lb}{xml:lb}
\stopxmlsetups

\xmlregistersetup{xml:teisetups}
\environment ara-sty
\usetypescript[palatino]
\setupbodyfont[palatino,10pt]

\startxmlsetups xml:body
   \xmlflush{#1}
\stopxmlsetups

\startxmlsetups xml:p
       \xmlflush{#1}
\stopxmlsetups

\startxmlsetups xml:pb
   \xmlflush{#1}
\stopxmlsetups

\startxmlsetups xml:lb
       \MarText{\tfxx{xml pb/lb numbers}}
       \xmlflush{#1}
\stopxmlsetups

\definemargindata [MarText][right][color=red]

\startxmlsetups xml:div:arab
       \setarabic{\switchtobodyfont[Arabic] \xmlflush{#1}}
\stopxmlsetups

\startxmlsetups xml:div:engl
       \setlatin{\switchtobodyfont[palatino, 12pt] \xmlflush{#1}}
\stopxmlsetups


On Wed, Apr 27, 2011 at 4:28 AM, Hans Hagen pra...@wxs.nl wrote:
 On 27-4-2011 1:26, Jon Crump wrote:

 All,

 After being away from my project for a while I returned to find that
 something that worked now no longer does. I updated the minimals on my
 Mac and context is running as I would expect:

 jjc% context --version
 mtx-context     | main context file:
 /Users/jjc/context/tex/texmf-context/tex/context/base/context.mkiv
 mtx-context     | current version: 2011.04.24 15:15

 But now, while running my environment.tex file against my target
 TEI/xml file context complains:

 ! Undefined control sequence.
 l.77 \defineinmargin
                      [lineNumbers] [normal]
 ?

 see typo-mar.mkiv ... more control over margindata and new commands

 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
 -



ara-sty.tex
Description: TeX document
?xml version=1.0 encoding=utf-8?
body
  div type=month xml:id=apr_arab
pb n=001 /
lb n=01 /
p
lb n=04 /فقد صممنا على السفر الى اورباو ممشانا من هنا سيكون 
lb n=05 /نهار الاربعاء صباحاًاعني في ١٣ من هدا الشهر۔ فقد كرينا الدواب 
lb n=06 /و تختروانورتبنا كل شيء و ما بقي سوى ان نضع بغدادورائنا ۔ 
lb n=07 /من الايام الثلاثة الفاتت الى الآن جملة خطار عماليجون يودعونا 
lb n=08 /و بالاخص الاهل جملة امراريجون عندنا ۔ فنسافر صحبة كرنل 
lb n=09 /مكلر باليوزالانكليزي الذي معتمديروح الى لندرةفنأخذ درب 
lb n=10 /البر اعني الى الدير و الشامو بيروتو من هناك الى القاهرةاذا 
lb n=11 /سهل المولى ۔/p
lb n=12 /
  /div
  div type=month xml:id=apr_engl
pb n=001 /
lb n=01 /
p
lb n=04 /And so, we decided to travel to Europe. Our departure from here will be 
lb n=05 /on Wednesday morning, that is, on the 13th of this month. We have already hired the riding animals 
lb n=06 /and a mule-litter and have arranged everything, nothing is left but to put Baghdad behind us. 
lb n=07 /For the past three days till now, many visitors have come and are still coming to bid us goodbye, 
lb n=08 /especially our family who are coming often to visit us. We are traveling in the company of the English Consul-General 
lb n=09 /Colonel Mockler who has decided to go to London. Therefore, we shall take 
lb n=10 /the land road that is to ad-Dayr, Damascus and Beirut, and thence to Cairo, 
lb n=11 /God willing./p
lb n=12 /
  /div
/body


eng-arab-test.pdf
Description: Adobe PDF document

Re: [NTG-context] Validate (cross)references

2011-05-27 Thread Jesse Alama

On 2011-05-27 17:19:30 +0200, Andreas Schneider said:


On Friday, May 27, 2011 17:09 Wolfgang Schuster wrote:


Am 27.05.2011 um 17:04 schrieb Andreas Schneider:



Hello,

if  I  use  \in,  \about,  \at  or  anything  else  that  generates  a
cross-reference,  and  that  reference  happens to be invalid (typo or
whatever),  it  just  prints  out  nothing.  Is  there a way to have
context throw an error if a reference is invalid? (That probably would
only  make  sense  in the second pass of context, since the first pass
has to collect the references first.)



Unknown references are shown as “??” in your text.



Wolfgang


True,  I  was  mostly  thinking  about \about, which just prints two
quotation  marks  and  nothing  in between. But my problem (if I can
even  call  it  that, since grep is already a solution, just maybe not
the  best one :D) is, that I could easily miss such small changes. I'm
working  on  technical  documentation  that  even  has  parts that are
automatically  generated  (from  XML files). I just update whatever is
necessary  (the document itself, or just the input files), commit them
to  SVN  and  our  CI  server grabs them, and runs ConTeXt. If ConTeXt
returns  with  a  return code  0, the build is marked as failed and
all  necessary  admins  (me  and  my colleague) are informed via eMail
and/or  RSS  feed.  If  the  build  succeeds,  the  generated  PDF  is
automatically distributed to the users. I consider wrong references an
error,  so  I would like the build to fail (imho referencing something
that  doesn't  exist  is  like using a macro that doesn't exist, which
fails too).

But  as I said: if context can't treat that as error, I'm fine with it
too  and  will  continue  to  grep the logfile. It's just curiosity if
there may already be a setting/parameter/whatever to get context to be
more restrictive.


+1

I would also like ConTeXt to help me keep me document sensible in this 
way. I also resort to grep-type solutions, but sometimes I forget to do 
this, and sometimes, there are embarrassing consequences of such 
oversight.  If ConTeXt could help me avoid this all-too-common 
oversight of mine, I'd be delighted.  Throwing an error would be one 
way to do this.  If throwing an error is not possible, perhaps being 
able to customize what gets printed when an undefined reference is 
encountered.  E.g., instead of ??, a big, annoying, 
impossible-to-miss mark in the margin (as one sees when working with 
overfull lines) or a giant red stopsign saying UNDEFINED REFERENCE, 
would do just as well.


--
Jesse Alama
http://centria.di.fct.unl.pt/~alama/___
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] Validate (cross)references

2011-05-27 Thread Aditya Mahajan

On Fri, 27 May 2011, Jesse Alama wrote:

Throwing an error would be one way to do this.  If throwing an error is not 
possible, perhaps being able to customize what gets printed when an undefined 
reference is encountered.  E.g., instead of ??, a big, annoying, 
impossible-to-miss mark in the margin (as one sees when working with overfull 
lines) or a giant red stopsign saying UNDEFINED REFERENCE, would do just as 
well.


\def\dummyreference{{\red\bfd UNKNOWN REFERENCE}}

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

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


Re: [NTG-context] Validate (cross)references

2011-05-27 Thread Taco Hoekwater




On 27 mei 2011, at 19:50, Aditya Mahajan adit...@umich.edu wrote:

 On Fri, 27 May 2011, Jesse Alama wrote:
 
 Throwing an error would be one way to do this.  If throwing an error is not 
 possible, perhaps being able to customize what gets printed when an 
 undefined reference is encountered.  E.g., instead of ??, a big, annoying, 
 impossible-to-miss mark in the margin (as one sees when working with 
 overfull lines) or a giant red stopsign saying UNDEFINED REFERENCE, would 
 do just as well.
 
 \def\dummyreference{{\red\bfd UNKNOWN REFERENCE}}
 
I think this is good. Undefined references can not simply be converted to 
errors, because then 'context' stops processing, and of course in any first run 
there will be undefined references, so you would never get past that if it was 
simply an error.

But it would also help (for interactive use, at least) if context reported 
undefined references last, maybe even after the 'x processed pages' line.

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
___


[NTG-context] Modifying the header of a Register : \setuphead or \setupregister not working

2011-05-27 Thread Mathieu DUPONT


Hi,
How can one modify the header of a Register, after it apparently inherited from 
Chapter ?In the following example, I try to have the title INDEX at the same 
height as the title CHAPTER,but neither the \setuphead nor \setupregister 
commands seem to do anything.Is there another command for that ?I couldn't find 
it.
Thanks for help !

\setupinteraction[state=start]
\setuplabeltext[chapter=CHAPITRE~]\setuphead[chapter][  align=middle,   
before={\crlf\blank[1cm-4.2ex]},style={\blank[2cm]},
after={\blank[3cm]},header=empty,   ]
\defineregister[MyIndex][MyIndexs]\setupheadtext[MyIndex=INDEX]
\setupregister[MyIndex][{\blank[0cm]}]  %% not 
working\setuphead[register][{\blank[0cm]}]  %% not working
\starttext
\startbodymatter\chapter{Chapter}\MyIndex{word}word\stopbodymatter
\startbackmatter\completeMyIndex\stopbackmatter
\stoptext 



Mathieu

  ___
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] Modifying the header of a Register : \setuphead or \setupregister not working

2011-05-27 Thread Wolfgang Schuster

Am 27.05.2011 um 20:32 schrieb Mathieu DUPONT:

 
 Hi,
 
 How can one modify the header of a Register, after it apparently inherited 
 from Chapter ?
 In the following example, I try to have the title INDEX at the same height 
 as the title CHAPTER,
 but neither the \setuphead nor \setupregister commands seem to do anything.
 Is there another command for that ?
 I couldn't find it.
 
 Thanks for help !
 
 
 \setupinteraction[state=start]
 
 \setuplabeltext[chapter=CHAPITRE~]
 \setuphead[chapter][
   align=middle,
   before={\crlf\blank[1cm-4.2ex]},
   style={\blank[2cm]},
   after={\blank[3cm]},
   header=empty,
   ]

\setuphead
  [chapter]
  [alternative=middle,
   before={\blank[force,1cm]},
   numbercommand=\groupedcommand{}{\blank[2cm]},
   after={\blank[3cm]},
   header=empty]

 \defineregister[MyIndex][MyIndexs]
 \setupheadtext[MyIndex=INDEX]
 
 \setupregister[MyIndex][{\blank[0cm]}]  %% not working
 \setuphead[register][{\blank[0cm]}]  %% not working

Invalid setup, the second argument expects assignments.

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] First Line After Whitespace Styling

2011-05-27 Thread Marc Trius
On Fri, 27 May 2011 18:30:53 +0200
Wolfgang Schuster schuster.wolfg...@googlemail.com wrote:

 
 Am 27.05.2011 um 18:08 schrieb Marc Trius:
 
  Hi,
  I would like to be able to specify a style that would apply to text that 
  appears on the first line of a paragraph after whitespace. I have no idea 
  how to go about it. 
  
  Specifically, I have a font with an alternate glyph that can only be used 
  after whitespace, and I would like to have it used automatically when 
  appropriate. 
 
 Do you want a initial?
 
 \setupinitial[state=start]
 
 \starttext
 \placeinitial \input knuth
 \stoptext
 
 Wolfgang
 

No, what is something like:

...

\starttypescript  [Standard]
  \definetypeface [Standard] [rm] [serif] [frankruehl]   [default] 
[features=default]
  \definetypeface [Alt][rm] [serif] [frankruehl] [default] 
[features=alt]
  \stoptypescript

...

{\Alt This is the first line after a whitespace, this is the linebreak} and 
this is the rest of the paragraph. I'd like to have a macro that automatically 
styles the first line only so I don't have to guess at linebreaks every time I 
edit the text.

I need to do this because in texts that are written with the Hebrew alphabet, a 
shorter glyph of the tallest letter, 'lamed,' is used inside a block of text 
than in a first line, so that the interline space can be smaller. Employing 
this technique makes the difference between a pretty good and a really 
first-rate typesetting job :)

Thanks,
Marc

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


-- 
Marc Trius derpay...@riseup.net

The enemy is the gramophone mind, whether or not one agrees with the record 
that is being played at the moment. --- George Orwell
___
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] First Line After Whitespace Styling

2011-05-27 Thread Wolfgang Schuster

Am 27.05.2011 um 21:08 schrieb Marc Trius:

 No, what is something like:
 
 ...
 
 \starttypescript  [Standard]
  \definetypeface [Standard] [rm] [serif] [frankruehl]   [default] 
 [features=default]
  \definetypeface [Alt][rm] [serif] [frankruehl] [default] 
 [features=alt]
  \stoptypescript
 
 ...
 
 {\Alt This is the first line after a whitespace, this is the linebreak} and 
 this is the rest of the paragraph. I'd like to have a macro that 
 automatically styles the first line only so I don't have to guess at 
 linebreaks every time I edit the text.
 
 I need to do this because in texts that are written with the Hebrew alphabet, 
 a shorter glyph of the tallest letter, 'lamed,' is used inside a block of 
 text than in a first line, so that the interline space can be smaller. 
 Employing this technique makes the difference between a pretty good and a 
 really first-rate typesetting job :)

Adapt the following to your case:

\setupbodyfont[pagella]

\definefontfeature[allcaps][smcp=yes,c2sc=yes]

\starttext

\TreatFirstLine {\addff{allcaps}} {} {} {}
The Earth, as a habitat for animal life, is in old age and has a fatal illness. 
Several, in fact. It would be happening whether humans had ever evolved or not. 
But our presence is like the effect of an old-age patient who smokes many packs 
of cigarettes per day — and we humans are the cigarettes.

\stoptext

Wolfgang

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

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


Re: [NTG-context] Modifying the header of a Register : \setuphead or \setupregister not working

2011-05-27 Thread Mathieu DUPONT


This is fixing a lot of problems I had, thank you !



Mathieu



From: schuster.wolfg...@googlemail.com
Date: Fri, 27 May 2011 20:46:01 +0200
To: ntg-context@ntg.nl
Subject: Re: [NTG-context] Modifying the header of a Register : \setuphead  
or \setupregister not working




Am 27.05.2011 um 20:32 schrieb Mathieu DUPONT:Hi,
How can one modify the header of a Register, after it apparently inherited from 
Chapter ?In the following example, I try to have the title INDEX at the same 
height as the title CHAPTER,but neither the \setuphead nor \setupregister 
commands seem to do anything.Is there another command for that ?I couldn't find 
it.
Thanks for help !

\setupinteraction[state=start]
\setuplabeltext[chapter=CHAPITRE~]\setuphead[chapter][  align=middle,   
before={\crlf\blank[1cm-4.2ex]},style={\blank[2cm]},
after={\blank[3cm]},header=empty,   ]
\setuphead  [chapter]  [alternative=middle,   before={\blank[force,1cm]},   
numbercommand=\groupedcommand{}{\blank[2cm]},   after={\blank[3cm]},   
header=empty]
\defineregister[MyIndex][MyIndexs]\setupheadtext[MyIndex=INDEX]
\setupregister[MyIndex][{\blank[0cm]}]  %% not 
working\setuphead[register][{\blank[0cm]}]  %% not working
Invalid setup, the second argument expects assignments.
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
___
   ___
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] First Line After Whitespace Styling

2011-05-27 Thread Marc Trius
On Fri, 27 May 2011 21:19:29 +0200
Wolfgang Schuster schuster.wolfg...@googlemail.com wrote:

 
 Am 27.05.2011 um 21:08 schrieb Marc Trius:
 
  No, what is something like:
  
  ...
  
  \starttypescript  [Standard]
   \definetypeface [Standard] [rm] [serif] [frankruehl]   [default] 
  [features=default]
   \definetypeface [Alt][rm] [serif] [frankruehl] [default] 
  [features=alt]
   \stoptypescript
  
  ...
  
  {\Alt This is the first line after a whitespace, this is the linebreak} and 
  this is the rest of the paragraph. I'd like to have a macro that 
  automatically styles the first line only so I don't have to guess at 
  linebreaks every time I edit the text.
  
  I need to do this because in texts that are written with the Hebrew 
  alphabet, a shorter glyph of the tallest letter, 'lamed,' is used inside a 
  block of text than in a first line, so that the interline space can be 
  smaller. Employing this technique makes the difference between a pretty 
  good and a really first-rate typesetting job :)
 
 Adapt the following to your case:
 
 \setupbodyfont[pagella]
 
 \definefontfeature[allcaps][smcp=yes,c2sc=yes]
 
 \starttext
 
 \TreatFirstLine {\addff{allcaps}} {} {} {}
 The Earth, as a habitat for animal life, is in old age and has a fatal 
 illness. Several, in fact. It would be happening whether humans had ever 
 evolved or not. But our presence is like the effect of an old-age patient who 
 smokes many packs of cigarettes per day — and we humans are the cigarettes.
 
 \stoptext
 
 Wolfgang
 

This works perfectly! Also, the \addff is going to make my life much easier. 
Thank you very much.

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


-- 
Marc Trius derpay...@riseup.net

The enemy is the gramophone mind, whether or not one agrees with the record 
that is being played at the moment. --- George Orwell
___
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] Validate (cross)references

2011-05-27 Thread Hans Hagen

On 27-5-2011 8:03, Taco Hoekwater wrote:





On 27 mei 2011, at 19:50, Aditya Mahajanadit...@umich.edu  wrote:


On Fri, 27 May 2011, Jesse Alama wrote:


Throwing an error would be one way to do this.  If throwing an error is not possible, perhaps being 
able to customize what gets printed when an undefined reference is encountered.  E.g., instead of 
??, a big, annoying, impossible-to-miss mark in the margin (as one sees when working 
with overfull lines) or a giant red stopsign saying UNDEFINED REFERENCE, would do just 
as well.


\def\dummyreference{{\red\bfd UNKNOWN REFERENCE}}


I think this is good. Undefined references can not simply be converted to 
errors, because then 'context' stops processing, and of course in any first run 
there will be undefined references, so you would never get past that if it was 
simply an error.

But it would also help (for interactive use, at least) if context reported 
undefined references last, maybe even after the 'x processed pages' line.


there is commented code that writes it to the log; i can make that an 
option (directive) if needed


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] checking mainlanguage setup

2011-05-27 Thread Jeong Dalyoung
Dear Pontus, Marco, and Peter,

Thank you for replies.

I tested the following codes:

1)
\startluacode
if languages.current() == kr then
context(Korean)
else
context(Not Korean)
end
\stopluacode

2)
\doifelse\currentlanguage{en}{\def\lang{English}}{\def\lang{Not English}}\par
currentlanguage: \lang

are working well. 

But, the code

\startluacode
if languages.current() == kr then
context([[\def\lang{Korean}]]) %(\def\lang{Korean})
else
context([[\def\lang{English}]]) %(\def\lang{Korean})
end
\stopluacode

currentlanguage: \lang

is not working. (undifined control sequence error)

I think that there is a simple way to use lua code for this which I don't know. 
I have to read CLD manual.

Thanks again.

Best regards,

Dalyoung


On 2011. 5. 27., at 오후 10:09, ntg-context-requ...@ntg.nl wrote:

 Send ntg-context mailing list submissions to
   ntg-context@ntg.nl
 
 To subscribe or unsubscribe via the World Wide Web, visit
   http://www.ntg.nl/mailman/listinfo/ntg-context
 or, via email, send a message with subject or body 'help' to
   ntg-context-requ...@ntg.nl
 
 You can reach the person managing the list at
   ntg-context-ow...@ntg.nl
 
 When replying, please edit your Subject line so it is more specific
 than Re: Contents of ntg-context digest...
 
 
 Today's Topics:
 
   1. Re: checking mainlanguage setup (Pontus Lurcock)
   2. Re: checking mainlanguage setup (Marco)
   3. Re: checking mainlanguage setup (Peter =?utf-8?Q?M=C3=BCnster?=)
   4. [metafun] graphictext in mkiv (Marco)
   5. Re: compresslevel and png graphics (mkiv) (Peter Rolf)
   6. Re: \asciimode and cld (Hans Hagen)
   7. Re: compresslevel and png graphics (mkiv) (Hartmut Henkel)
   8. Re: compresslevel and png graphics (mkiv) (Hartmut Henkel)
 
 
 --
 
 Message: 1
 Date: Fri, 27 May 2011 22:11:24 +1200
 From: Pontus Lurcock p...@talvi.net
 To: ntg-context@ntg.nl
 Subject: Re: [NTG-context] checking mainlanguage setup
 Message-ID: 20110527101124.go20...@rae.vm.bytemark.co.uk
 Content-Type: text/plain; charset=us-ascii
 
 On Fri 27 May 2011, Jeong Dalyoung wrote:
 
 Is it possible to check what is the mainlanguage set in document?
 Now, I use \enablemode[kr] to do something A. But, I'd like to do it
 automatically if possible.
 
 According to http://wiki.contextgarden.net/Modes#System_modes , 
 the mode **kr should be automatically set if kr is the main language
 (I haven't tried it, though).
 
 Pont
 
 
 --
 
 Message: 2
 Date: Fri, 27 May 2011 12:22:38 +0200
 From: Marco net...@lavabit.com
 To: ntg-context@ntg.nl
 Subject: Re: [NTG-context] checking mainlanguage setup
 Message-ID: 20110527122238.4c709eb2@glyph
 Content-Type: text/plain; charset=US-ASCII
 
 I'd like to do the following type of setup.
 
 
 if mainlanguage == kr then
 
  do something A
 
 elseif mainlanguage == en then
 
  do something B
 
 else
  do something C
 
 endif
 
 \starttext
 \startluacode
  if languages.current() == kr then
context(Something A)
  elseif languages.current() == en then
 context(Something B)
  else
 context(Something C)
  end
 \stopluacode
 \stoptext
 
 Marco
 
 
 
 
 --
 
 Message: 3
 Date: Fri, 27 May 2011 12:41:46 +0200
 From: pmli...@free.fr (Peter =?utf-8?Q?M=C3=BCnster?=)
 To: mailing list for ConTeXt users ntg-context@ntg.nl
 Subject: Re: [NTG-context] checking mainlanguage setup
 Message-ID: 87ei3kifx1@micropit.couberia.bzh
 Content-Type: text/plain; charset=utf-8
 
 On Fri, May 27 2011, Jeong Dalyoung wrote:
 
 Is it possible to check what is the mainlanguage set in document?
 
 Yes. Example:
 
 %\mainlanguage[fr]
 %\language[fr]
 \starttext
 currentlanguage:
 \doifelse\currentlanguage{fr}{French}{Not French}\par
 currentmainlanguage:
 \doifelse\currentmainlanguage{fr}{French}{Not French}\par
 translate: \translate[fr=Fran?ais, en=French]
 \stoptext
 
 -- 
   Peter
 
 
 --
 
 Message: 4
 Date: Fri, 27 May 2011 12:45:58 +0200
 From: Marco net...@lavabit.com
 To: ntg-context@ntg.nl
 Subject: [NTG-context] [metafun] graphictext in mkiv
 Message-ID: 20110527124558.19b42ca1@glyph
 Content-Type: text/plain; charset=UTF-8
 
 The ?graphictext? makro does not work in mkiv, is it a bug
 or intended? This example works in mkii:
 
 \starttext
 \startMPcode
 draw image(graphictext FooBar scaled 8);
 \stopMPcode
 \stoptext
 
 Marco
 
 
 
 
 --
 
 Message: 5
 Date: Fri, 27 May 2011 13:57:51 +0200
 From: Peter Rolf indi...@gmx.net
 To: ntg-context@ntg.nl
 Subject: Re: [NTG-context] compresslevel and png graphics (mkiv)
 Message-ID: 4ddf91bf.8030...@gmx.net
 Content-Type: text/plain; charset=UTF-8
 
 Am 26.05.2011 18:17, schrieb Peter Rolf:
 Am 26.05.2011 12:52, schrieb Peter Rolf:
 Am 25.05.2011 21:54, schrieb Hartmut Henkel:
 [..]
 
 no. There is a PNG Copy function for literal embedding of the PNG
 file, but that triggers only, 

Re: [NTG-context] checking mainlanguage setup

2011-05-27 Thread Aditya Mahajan

On Sat, 28 May 2011, Jeong Dalyoung wrote:


\startluacode
if languages.current() == kr then
context([[\def\lang{Korean}]]) %(\def\lang{Korean})
else
context([[\def\lang{English}]]) %(\def\lang{Korean})
end
\stopluacode

currentlanguage: \lang

is not working. (undifined control sequence error)


(Untested) try

context.setvalue(lang, English)

or

context([[\\def\\lang{English}]])

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

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