Re: [NTG-context] \textcomma (was Re: Comma separating multiple footnotes)

2012-04-20 Thread Hans Hagen

On 20-4-2012 00:11, Aditya Mahajan wrote:


The case with , (comma) is more tricky. Normally, in plain TeX comma is
defined as punctuation. But since comma is used as a separator in
Europe, ConTeXt deos something smart based on the setting of
autopunction. I don't completely understand how that works.


lua magic

(Later this year I want to follow up on domain specific rendering, so 
that one can switch to (say) 'logic' and get spacing suitable for that. 
Not too hard to do as long as we have char-def up-to-date.)


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] Rendering differences between PDF viewers

2012-04-20 Thread Peter Rolf
Am 19.04.2012 20:25, schrieb Hans Hagen:
 On 18-4-2012 13:12, Peter Rolf wrote:
 
 I understand that there is no easy or general solution for this.
 But on the other hand is PNG currently the only way to use transparent
 bitmaps in TeX. The usage of transparent PNG is quite common, so this is
 a general problem that should be solved.

 I like your idea of automatically adding such groups, if the user
 declares the color space beforehand. Also no answer for the spot color
 problem, but as long as the user does not limit the used color spaces,
 things can stay as they are. Just my 2 cents.
 
 so first wen need to test with mixed color space documents and such
 hacks to see what happens (as we don't want invalid documents)


ok. i don't expect any formal problems, only more or less ugly color
shifts. anyhow, we will see.

needs some thinking about proper examples (colored text, vector and
pixel based graphics in RGB,CMYK,Spot)...
i think 'draw ColorCircle(..)' is a perfect candidate for the complete
graphic part. one page with transparency and also one page without any
transparency (the page group shouldn't kick in). later on we can add
some icc profiles to spice things up.

i'll start to make a test document on the weekend then. if i have missed
something important, let me know. any additional ideas are also welcome :-)


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] lucida ot

2012-04-20 Thread Mari Voipio
On Wed, Apr 18, 2012 at 14:37, Mari Voipio mari.voi...@iki.fi wrote:
 Now I can at least get started, and figure out about the Blackletter a
 bit later

 It turns out that I need it rather sooner than later

ARGH, I give up!

ConTeXt finds the Lucida Blackletter OT font on my system (Mac OS X), because:

mtxrun --script fonts --list --all --pattern=Lucida*

says (among others)

lucidablackletterot lucidablackletterot
 /Users/Mari/Library/Fonts/LucidaBlackletterOT.otf
lucidablackletterotnormal   lucidablackletterot
 /Users/Mari/Library/Fonts/LucidaBlackletterOT.otf
lucidablackletterotregular  lucidablackletterot
 /Users/Mari/Library/Fonts/LucidaBlackletterOT.otf



But whatever versions of font synonyms and typescripts and all other
commands I try, I always get something like
 typescripts  unknown: library 'blackletter

I'm sure I'm missing something really elementary here, but what?

This is one of my more recent attempts at calling for the font:

\starttypescript [rm] [blackletter]
  \definefontsynonym [Serif]  [file:LucidaBlackletterOT.otf]
\stoptypescript

\definetypeface [blackletter]   [rm][serif] [blackletter]

\setupbodyfont[blackletter]



Any ideas of what I'm doing wrong?


TIA,

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

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


Re: [NTG-context] lucida ot

2012-04-20 Thread Hans Hagen

On 20-4-2012 15:24, Mari Voipio wrote:


This is one of my more recent attempts at calling for the font:

\starttypescript [rm] [blackletter]
   \definefontsynonym [Serif] [file:LucidaBlackletterOT.otf]
\stoptypescript

\definetypeface [blackletter]   [rm][serif] [blackletter]

\setupbodyfont[blackletter]

Any ideas of what I'm doing wrong?


something

\starttypescript [serif] [somecollection] [name]
\setups[font:fallback:serif]
\definefontsynonym [Serif]   [file:somecolllection.otf] 
[features=default]
  % \definefontsynonym [SerifBold]   [file:somecolllectionbold.otf] 
   [features=default]
  % \definefontsynonym [SerifItalic] 
[file:somecolllectionitalic.otf]  [features=default]
  % \definefontsynonym [SerifBoldItalic] 
[file:somecolllectionbolditalic.otf]  [features=default]

\stoptypescript

\starttypescript[someinstance]
\definetypeface [someinstance] [rm] [serif] [somecollection] [default]
\stoptypescript

and then

\usetypescript[someinstance]
\setupbdyfont[someinstance]

or just

\definetypeface [someinstance] [rm] [serif] [somecollection] [default]
\setupbdyfont[someinstance]

so, the name typescript maps names and if you have conflicts, you can 
best use filenames there


then you define a typeface either or not using a typescript (depends on 
reuse) .. you need to make sure that it's 'expanded'


then you enable the bodyfont

now, in your code, some auto loading of a type-imp-* file kicks in, so 
if you'd put your code in such a file (say type-imp-xxx.mkiv), the 
\setupbodyfont[xxx] would have loaded that one


(try with \tracetypescriptstrue)

Hans




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

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


[NTG-context] tabulate to full text width?

2012-04-20 Thread Procházka Lukáš Ing . - Pontex s . r . o .

Hello,

is it possible to specify \(start)tabulate or \setuptabulate to fit \textwidth?

- I mean all columns to have the same width so in total to occupy the whole 
\textwidth...

Best regards,

Lukas


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

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

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

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


Re: [NTG-context] tabulate to full text width?

2012-04-20 Thread Marco
On 2012-04-20 Procházka Lukáš Ing. - Pontex s. r. o. l...@pontex.cz wrote:

 is it possible to specify \(start)tabulate or \setuptabulate to fit
 \textwidth?

How about linetables?

\setuplinetable [width=.5\textwidth]

\starttext
\showboxes

\starttabulate
\NC Foo \NC Bar \NC\NR
\stoptabulate

\startlinetable
\NC Foo \NC Bar \NC\NR
\stoplinetable

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

[NTG-context] imposition 2UP = empty pages

2012-04-20 Thread Henning Hraban Ramm

Hi there,

like in January (see mail by Mari), the latest beta produces only  
empty pages with 2UP imposition schema; others work (tested 2SIDE and  
2DOWN).


e.g.

\setuppapersize [A5][A4,landscape]
\setuppagenumbering [alternative=doublesided,location=footer]
\setuplayout [margin=0pt,width=fit]
\setupbackgrounds [text][text][background=screen,backgroundscreen=0.7]
\setupcolors [state=start]
\setuplayout [location=middle,marking=on]
\setuparranging [2UP] %[2*2*4,doublesided]

\startbuffer[Fakepage]
\strut
\blank[force]
\midaligned{2UP}
\vfill
\midaligned{This is page \recurselevel}
\vfill
\stopbuffer

\setupheadertexts[\CONTEXT]

\starttext

\dorecurse{16}{\getbuffer[Fakepage]\page}

\stoptext





Greetlings, 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] tabulate to full text width?

2012-04-20 Thread Procházka Lukáš Ing . - Pontex s . r . o .

Hello,

your code seems hopefully, but it doesn't compile (?!)...

Missing [ and ] somewhere?

See the test and log.

Best regards,

Lukas


On Fri, 20 Apr 2012 17:52:35 +0200, Marco net...@lavabit.com wrote:


On 2012-04-20 Procházka Lukáš Ing. - Pontex s. r. o. l...@pontex.cz wrote:


is it possible to specify \(start)tabulate or \setuptabulate to fit
\textwidth?


How about linetables?

\setuplinetable [width=.5\textwidth]

\starttext
\showboxes

\starttabulate
\NC Foo \NC Bar \NC\NR
\stoptabulate

\startlinetable
\NC Foo \NC Bar \NC\NR
\stoplinetable

\stoptext

Marco



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

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

t-LT.log
Description: Binary data


t-LT.mkiv
Description: Binary data


t-LT.pdf
Description: Adobe PDF document
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

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

Re: [NTG-context] tabulate to full text width?

2012-04-20 Thread Marco
On 2012-04-20 Procházka Lukáš Ing. - Pontex s. r. o. l...@pontex.cz wrote:

 your code seems hopefully, but it doesn't compile (?!)...

Your file works here with 2012.04.17 and 2011.05.18.

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] [dev-context] Storing and retrieving two-pass data

2012-04-20 Thread luigi scarso
On Fri, Apr 20, 2012 at 5:30 PM, Marco net...@lavabit.com wrote:
 On 2012-04-19 Wolfgang Schuster schuster.wolfg...@googlemail.com wrote:

 Hi Wolfgang,

 thanks for  the answer. In the first place I also  came up  with a
 similar solution  to yours. But  that's what I meant  by ”manually
 counting” and  wanted to avoid.  Apparently I missed  the obvious,
 there is no special magic needed:

 % doesn't seem to be necessary
 % \definedataset [test]

 \setdataset [test] [foo] [foo=first]
 \setdataset [test] [foo] [foo=second]

 \setdataset [test] [bar] [bar=first]
 \setdataset [test] [bar] [bar=second]
 \setdataset [test] [bar] [bar=third]

 \starttext
        foo is: \datasetvariable{test}{foo}{foo}\crlf
        bar is: \datasetvariable{test}{bar}{bar}
 \stoptext

 Wikified:
 http://wiki.contextgarden.net/System_Macros/Key_Value_Assignments#Two-pass_data

Two-pass data is data that can be accessed before it has been created.

Hm how can  something be read before* being created ?

(super-luminal neutrino  is not anymore a valid answer ...)
-- 
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] [dev-context] Storing and retrieving two-pass data

2012-04-20 Thread Marco
On 2012-04-20 luigi scarso luigi.sca...@gmail.com wrote:

 
 Two-pass data  is data  that can  be accessed  before it  has been
 created.
 
 Hm how can something be read before* being created ?

 (super-luminal neutrino is not anymore a valid answer ...)

- Two-pass  data is  data that  can be accessed  before it  has been
- created.

+ Two-pass data is data that is  saved to an external file (the .tuc
+ file)  instead of  being used  directly.  The reason  is that  the
+ information might not be present at that point. One example is the
+ page counter.  It's possible  to print the  total amount  of pages
+ onto the first page.

Otherwise delete the introduction  entirely. Everyone tinkering with
that  knows what  two-pass  data  is, otherwise  he  would just  use
\setvariables, right?


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] [dev-context] Storing and retrieving two-pass data

2012-04-20 Thread luigi scarso
On Fri, Apr 20, 2012 at 8:32 PM, Marco net...@lavabit.com wrote:
 On 2012-04-20 luigi scarso luigi.sca...@gmail.com wrote:

 
 Two-pass data  is data  that can  be accessed  before it  has been
 created.
 
 Hm how can something be read before* being created ?

 (super-luminal neutrino is not anymore a valid answer ...)

 - Two-pass  data is  data that  can be accessed  before it  has been
 - created.

 + Two-pass data is data that is  saved to an external file (the .tuc
 + file)  instead of  being used  directly.  The reason  is that  the
 + information might not be present at that point. One example is the
 + page counter.  It's possible  to print the  total amount  of pages
 + onto the first page.
ok x me

 Otherwise delete the introduction  entirely. Everyone tinkering with
 that  knows what  two-pass  data  is, otherwise  he  would just  use
 \setvariables, right?
No no,  it's ok to keep it .

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

[NTG-context] typeset rss feed

2012-04-20 Thread Jelle Huisman
Hello all,

I'd like to typeset an RSS feed and I was wondering whether I could
instruct ConTeXt to fetch the contents of a url like:
http://feeds.bbci.co.uk/news/rss.xml
Thanks for any pointers,

Jelle
___
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] extracting word count from a *.words file

2012-04-20 Thread Jelle Huisman
Hello all,

Here is another question. Consider this test file:

\starttext
\setupspellchecking[state=start,method=2]
\ctxlua{languages.words.threshold=3}
\input knuth
\stoptext

Typesetting this file produces a word list 'test.words' which ends like
this:

 [threshold]=1,
 [total]=122,
 [version]=1,
}

Is there a way to extract the value for [total] ('122' in this case)
so that I can use that value somewhere else, e.g. in a project file
where I want to present a word count.

Thanks for a pointer!

Jelle
___
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] typeset rss feed

2012-04-20 Thread Philipp Gesang
Hi Jelle,

On 2012-04-20 16:15, Jelle Huisman wrote:
 Hello all,
 
 I'd like to typeset an RSS feed and I was wondering whether I could
 instruct ConTeXt to fetch the contents of a url like:
 http://feeds.bbci.co.uk/news/rss.xml
 Thanks for any pointers,

the fetching part is easy as we have LuaSocket:


\starttext
\startluacode
  local bbc_rss = socket.http.requesthttp://feeds.bbci.co.uk/news/rss.xml;
  context[type](bbc_rss)
\stopluacode
\stoptext \endinput


In your document, however, you will want to save the file locally
for a given Context session and reuse the local copy to avoid
re-fetching it on every pass. Maybe use the timestamp to force
a fresh fetch after some time.

Regards
Philipp


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

-- 
()  ascii ribbon campaign - against html e-mail
/\  www.asciiribbon.org   - against proprietary attachments


pgpPrLtumzN6K.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] typeset rss feed

2012-04-20 Thread Jelle Huisman
On 04/20/2012 04:40 PM, Philipp Gesang wrote:
 Hi Jelle,
 
 On 2012-04-20 16:15, Jelle Huisman wrote:
 Hello all,

 I'd like to typeset an RSS feed and I was wondering whether I could
 instruct ConTeXt to fetch the contents of a url like:
 http://feeds.bbci.co.uk/news/rss.xml
 Thanks for any pointers,
 
 the fetching part is easy as we have LuaSocket:

Hi Philip,

Thank you, that was precisely what I was looking for. I knew that I had
seen LuaSocket before, but I could not find it.

Jelle
___
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] extracting word count from a *.words file

2012-04-20 Thread Philipp Gesang
Hi again,

On 2012-04-20 16:32, Jelle Huisman wrote:
 Hello all,
 
 Here is another question. Consider this test file:
 
 \starttext
 \setupspellchecking[state=start,method=2]
 \ctxlua{languages.words.threshold=3}
 \input knuth
 \stoptext
 
 Typesetting this file produces a word list 'test.words' which ends like
 this:
 
  [threshold]=1,
  [total]=122,
  [version]=1,
 }
 
 Is there a way to extract the value for [total] ('122' in this case)
 so that I can use that value somewhere else, e.g. in a project file
 where I want to present a word count.

The “.words”-file is well formed Lua code, so you can just
integrate it as a table:


\define\wordcount{%%% Displays word count.
  This document consists of
  \startluacode
local data = dofile\jobname.words %% Load data of _previous_ pass
context(data.total) %% access the requested field
  \stopluacode
  \space
  words.%
}

\starttext
\setupspellchecking[state=start,method=2]
\ctxlua{languages.words.threshold=3}
\input knuth

\hairline

\wordcount %% call to the macro
\stoptext


 Thanks for a pointer!

Thanks as well, btw, I didn’t know the word count facility yet!

Philipp


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

-- 
()  ascii ribbon campaign - against html e-mail
/\  www.asciiribbon.org   - against proprietary attachments


pgpjWSl4cFMhN.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] extracting word count from a *.words file

2012-04-20 Thread Marco
On 2012-04-20 Jelle Huisman je...@jhnet.nl wrote:

 Is there a way to extract the value for [total] ('122' in this case)
 so that I can use that value somewhere else, e.g. in a project file
 where I want to present a word count.

I used the word count some time ago. Here's the code I used. I have
no idea what has changed since and if it still works.

\startluacode
userdata = userdata or { }

function userdata.wordcount(listname)
filename = file.addsuffix(tex.jobname,words)
if lfs.isfile(filename) then
local w = dofile(filename)
if w then
if type(w.categories[listname]) == table then
context(w.categories[listname].total)
else
context(w.total)
end
context.par()
end
end
end
\stopluacode

\def\wordcount{%
\dosingleempty\dowordcount}

\def\dowordcount[#1]{%
\ctxlua{userdata.wordcount(#1)}}

\starttext

% Set up the word count
\ctxlua{languages.words.threshold=2}
\setupspellchecking [state=start, method=2]

\setupspellchecking [list=foo]
\startsection [title=Foo]
Foo Bar
\stopsection

\setupspellchecking [list=lorem]
\startsection [title=Lorem]
Lorem ipsum dolor sit
\stopsection

\setupspellchecking [list=stop]

\startsubject [title=Statistics]
Words in Foo:   \wordcount [foo]
Words in Lorem: \wordcount [lorem]
\stopsubject

\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] extracting word count from a *.words file

2012-04-20 Thread Jelle Huisman
On 04/20/2012 04:52 PM, Marco wrote:
 On 2012-04-20 Jelle Huisman je...@jhnet.nl wrote:
 
 Is there a way to extract the value for [total] ('122' in this case)
 so that I can use that value somewhere else, e.g. in a project file
 where I want to present a word count.
 
 I used the word count some time ago. Here's the code I used. I have
 no idea what has changed since and if it still works.

Marco,

It looks like the code still works, thanks for sharing it.

Jelle
___
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] extracting word count from a *.words file

2012-04-20 Thread Jelle Huisman
On 04/20/2012 04:53 PM, Philipp Gesang wrote:
 Hi again,
 
 On 2012-04-20 16:32, Jelle Huisman wrote:
 Hello all,

 Here is another question. Consider this test file:

 \starttext
 \setupspellchecking[state=start,method=2]
 \ctxlua{languages.words.threshold=3}
 \input knuth
 \stoptext

 Typesetting this file produces a word list 'test.words' which ends like
 this:

  [threshold]=1,
  [total]=122,
  [version]=1,
 }

 Is there a way to extract the value for [total] ('122' in this case)
 so that I can use that value somewhere else, e.g. in a project file
 where I want to present a word count.
 
 The “.words”-file is well formed Lua code, so you can just
 integrate it as a table:

Thank you, Philip, this is a clean solution.

Jelle

___
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] typeset rss feed

2012-04-20 Thread Aditya Mahajan

On Fri, 20 Apr 2012, Jelle Huisman wrote:


I'd like to typeset an RSS feed


I was also recently thinking along these lines (set a cron job to typeset 
RSS feed into pdf and email to kindle). So, please release your code 
once you are done.



and I was wondering whether I could
instruct ConTeXt to fetch the contents of a url like:
http://feeds.bbci.co.uk/news/rss.xml


Suppose you write a macro

 \processrssfile{...}

that takes a local rss file and typesets it, then you can simply call

\processrssfile{\locfilename{http://feeds.bbci.co.uk/news/rss.xml}}

to process a remote file. ConTeXt downloads and caches the file. On 
subsequent calls, the cached file is used. IIRC, the cache remains valid 
for a day and it is possible to change the threshold after which a new 
file is fetched.


FWIW, I have added this to t-vim.tex so it can pretty-print remote files. 
This only works with http:// or ftp:// and not with https://


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] Interactive image

2012-04-20 Thread Kip Warner
On Thu, 2012-04-19 at 23:53 +0200, Wolfgang Schuster wrote:
 \setupinteraction[state=start]
 
 \starttext
 This is a cow: 
 \goto{\externalfigure[cow][height=2ex]}[url(http://en.wikipedia.org/wiki/Cow)]
 \stoptext

Thanks Wolfgang. I added it to the wiki:
http://wiki.contextgarden.net/Using_Graphics#Picture_with_hyperlink

-- 
Kip Warner -- Software Engineer
OpenPGP encrypted/signed mail preferred
http://www.thevertigo.com


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
___