Re: [NTG-context] indices

2009-05-24 Thread Taco Hoekwater

Charles Doherty wrote:

Dear all,

I have a bibliography created in BibDesk. I insert it in my .tex file 
using \setupbibtex[database={IndexHag},sort=author] and with the other 
commands I get my bibliography printed beautifully. I assign keywords in 
BibDesk and they appear in a list in the .bbl file for example as 
\keywords{Anderson, Columba, Colum Cille, Adamn{\'a}n, hagiography, 
hagiographer, saints lives}

In the bibmod.pdf guide it says that
 \keyword KEYWORD Just text (for use in indices)
 \keywords KEYWORDS Just text (for use in indices)

I have a very long bibliography and it would be great to automatically 
generate indices based on the keywords that do not appear in the 
bibliography itself. If this can be done can someone show me how to go 
about that.


That should be possible, using two stages.

First you have to make sure that there is an \insertkeywords in
each of the \setuppublicationlayout definitions that you are
using (look into the bibl-xxx files for examples).

Second you have to redefine \insertkeywords so that it does a bit
more work than normal. Here is what it normally does:

\unprotect
\def\insertkeywords#1#2#3%
  {\bibdoifelse
 {\@@p...@keywords}
 {% keywords present
  #1\@@p...@keywords #2%
 }
 {#3}% no keywords
  }
\protect

If you change that to

\unprotect
\def\insertkeywords#1#2#3%
  {\bibdoifelse{\@@p...@keywords}
 {%
  #1\@@p...@keywords #2%
  \processcommacommand[\@@p...@keywords]\index
 }
 {#3}%
  }
\protect

it should create the indices you want, besides.

This is untested, if it does not work you should send me a test file.

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


Re: [NTG-context] two newbie questions (about conditional processing)

2009-05-24 Thread Wolfgang Schuster


Am 24.05.2009 um 06:12 schrieb Zhichu Chen:

As you said before, in my problem, this kind of handler could break  
something

like hyper-links, and I assume Yue wanted those kind of stuffs.


I don't think this is a problem for this example because the page  
dimension
are always the same while in the code for you the real and the  
calculated

coordinates are different.

Maybe just a \start(stop)setups which changes the background back to  
normal

and \prependtoks it to some token list. So is there an \everypage or
\everyshipout
token? Then using \setuphead (I don't know if it's appropriate) or
\appendtoks to every title page.


I posted a code to enable/disable the backgroundcolor for certain pages
not so long ago, take a look in the mail archive.

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


Re: [NTG-context] two newbie questions (about conditional processing)

2009-05-24 Thread Zhichu Chen
On Sun, May 24, 2009 at 4:00 PM, Wolfgang Schuster
schuster.wolfg...@googlemail.com wrote:

 Am 24.05.2009 um 06:12 schrieb Zhichu Chen:

 As you said before, in my problem, this kind of handler could break
 something
 like hyper-links, and I assume Yue wanted those kind of stuffs.

 I don't think this is a problem for this example because the page dimension
 are always the same while in the code for you the real and the calculated
 coordinates are different.

 Maybe just a \start(stop)setups which changes the background back to
 normal
 and \prependtoks it to some token list. So is there an \everypage or
 \everyshipout
 token? Then using \setuphead (I don't know if it's appropriate) or
 \appendtoks to every title page.

 I posted a code to enable/disable the backgroundcolor for certain pages
 not so long ago, take a look in the mail archive.

Found it. Well, then it's just as easy as it sounds:

\unprotect

\let\!!savedbackgroundcolor\empty

\def\onbackground
 {\globallet\@@mapagebackgroundcolor\!!savedbackgroundcolor}

\def\offbackground
 {\globallet\!!savedbackgroundcolor\@@mapagebackgroundcolor
  \globalletempty\@@mapagebackgroundcolor}

\def\nobackground
 {\globallet\@@mapagebackgroundcolor\!!savedbackgroundcolor
  \globalletempty\@@mapagebackgroundcolor
  
\appendtoks\globallet\@@mapagebackgroundcolor\!!savedbackgroundcolor\to\afterpage}

\def\gobackground
 {\globallet\@@mapagebackgroundcolor\!!savedbackgroundcolor
  \appendtoks\globalletempty\@@mapagebackgroundcolor\to\afterpage}

\protect

\setuphead
  [chapter]
  [before=\gobackground]

\setupcolors[state=start]
\setupbackgrounds[page][background=color,backgroundcolor=lightgray]\offbackground

\starttext

\chapter{hello}
\dorecurse{10}{\input zapf\par}

\chapter{hello}
\dorecurse{10}{\input zapf\par}

\chapter{hello}
\dorecurse{10}{\input zapf\par}

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




-- 
Best Regards
Chen


  Zhi-chu Chen | Shanghai Synchrotron Radiation Facility
 No. 2019 | Jialuo Rd. | Jiading | Shanghai | P.R. China
 tel: 086 21 5955 3405 | zhichu.chen.googlepages.com
   | www.sinap.ac.cn

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


Re: [NTG-context] two newbie questions (about conditional processing)

2009-05-24 Thread Wolfgang Schuster


Am 24.05.2009 um 10:46 schrieb Zhichu Chen:


Maybe just a \start(stop)setups which changes the background back to
normal and \prependtoks it to some token list. So is there an  
\everypage or
\everyshipout token? Then using \setuphead (I don't know if it's  
appropriate) or

\appendtoks to every title page.


I posted a code to enable/disable the backgroundcolor for certain  
pages

not so long ago, take a look in the mail archive.


Found it. Well, then it's just as easy as it sounds:


This could be the better method for the background color (when the code
is rewritten in a better style) but to change the textcolor you need my
other code.

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


Re: [NTG-context] two newbie questions (about conditional processing)

2009-05-24 Thread Zhichu Chen
On Sun, May 24, 2009 at 4:57 PM, Wolfgang Schuster
schuster.wolfg...@googlemail.com wrote:

 Am 24.05.2009 um 10:46 schrieb Zhichu Chen:

 Maybe just a \start(stop)setups which changes the background back to
 normal and \prependtoks it to some token list. So is there an \everypage
 or
 \everyshipout token? Then using \setuphead (I don't know if it's
 appropriate) or
 \appendtoks to every title page.

 I posted a code to enable/disable the backgroundcolor for certain pages
 not so long ago, take a look in the mail archive.

 Found it. Well, then it's just as easy as it sounds:

 This could be the better method for the background color (when the code
 is rewritten in a better style) but to change the textcolor you need my
 other code.
Yes, I noticed that. I added the foregroundcolor part to your code but
only pagenumbers are affected. And by appending
\setuppapersize [A4][A4,negative]
to \afterpage gives a really weird result

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




-- 
Best Regards
Chen


  Zhi-chu Chen | Shanghai Synchrotron Radiation Facility
 No. 2019 | Jialuo Rd. | Jiading | Shanghai | P.R. China
 tel: 086 21 5955 3405 | zhichu.chen.googlepages.com
   | www.sinap.ac.cn

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


Re: [NTG-context] two newbie questions (about conditional processing)

2009-05-24 Thread Hans Hagen

Zhichu Chen wrote:

As you said before, in my problem, this kind of handler could break something
like hyper-links, and I assume Yue wanted those kind of stuffs.

Maybe just a \start(stop)setups which changes the background back to normal
and \prependtoks it to some token list. So is there an \everypage or
\everyshipout
token? Then using \setuphead (I don't know if it's appropriate) or
\appendtoks to
every title page.


something like state=once would be handy but i'm not going to touch that 
code till i'm redoing some page-* code in mkiv


Hans


-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
 tel: 038 477 53 69 | fax: 038 477 53 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  : https://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


[NTG-context] dot and comma in two consecutive cases

2009-05-24 Thread Xan

Hi,

I have this:
\startformula
 z_k = \startcases
   \NC x_k\MC 1 \leq k \leq N \NR
   \NC y_{k-N} \MC N+1 \leq k  N+M \NR
 \stopcases t_k = \startcases
   \NC r_k\MC 1 \leq k \leq N \NR
   \NC s_{k-N} \MC N+1 \leq k  N+M \NR
 \stopcases
\stopformula

but I want to punctuate that.

When I do:

\startformula
 z_k = \startcases
   \NC x_k\MC 1 \leq k \leq N \NR
   \NC y_{k-N} \MC N+1 \leq k  N+M \NR
 \stopcases, t_k = \startcases
   \NC r_k\MC 1 \leq k \leq N \NR
   \NC s_{k-N} \MC N+1 \leq k  N+M \NR
 \stopcases.
\stopformula

the dot and the comma appear too much separate from cases.

How can I get the normal behaviour?

Thanks in advance,
Xan.
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

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


Re: [NTG-context] dot and comma in two consecutive cases

2009-05-24 Thread Aditya Mahajan

On Sun, 24 May 2009, Xan wrote:


Hi,

I have this:
\startformula
z_k = \startcases
  \NC x_k\MC 1 \leq k \leq N \NR
  \NC y_{k-N} \MC N+1 \leq k  N+M \NR
\stopcases t_k = \startcases
  \NC r_k\MC 1 \leq k \leq N \NR
  \NC s_{k-N} \MC N+1 \leq k  N+M \NR
\stopcases
\stopformula

but I want to punctuate that.

When I do:

\startformula
z_k = \startcases
  \NC x_k\MC 1 \leq k \leq N \NR
  \NC y_{k-N} \MC N+1 \leq k  N+M \NR
\stopcases, t_k = \startcases
  \NC r_k\MC 1 \leq k \leq N \NR
  \NC s_{k-N} \MC N+1 \leq k  N+M \NR
\stopcases.
\stopformula

the dot and the comma appear too much separate from cases.

How can I get the normal behaviour?


\setupmathcases[numberdistance=\zeropoint]

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


Re: [NTG-context] indices

2009-05-24 Thread Taco Hoekwater

Charles Doherty wrote:

Dear Taco,

I inserted the code as you suggested although perhaps not in the 
position you would yourself. I had to add the {} to 
\insertkeywords{}{}{}


I did this in the bibl.apa file and I get my index. Of course the 
keywords are now inserted in the bibliography. Is there a way to prevent 
that but still produce the index? Here are the test files that I am 
using. I really appreciate you taking the time to help me with this.


Remember this:

\unprotect
\def\insertkeywords#1#2#3%
  {\bibdoifelse{\@@p...@keywords}
 {%
  #1\@@p...@keywords #2%
  \processcommacommand[\@@p...@keywords]\index
 }
 {#3}%
  }
\protect

Drop the #1 .. #2 line and it will no longer typeset anything:


\unprotect
\def\insertkeywords#1#2#3%
  {\bibdoifelse{\@@p...@keywords}
 {%
  \processcommacommand[\@@p...@keywords]\index
 }
 {#3}%
  }
\protect

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


[NTG-context] Previous chapter from new font chapter

2009-05-24 Thread Maurí­cio

Hi,

Right in the main wiki page I read the current 'fonts' chapter
pdf of the new revision of user's manual. It says at item 1.5.1:

 Remember how in the previous chapter there were the tables
 that listed all the predefined combinations?  It was said
 (...)

Where can I find such previous chapter? I understand it shows a
way to list all predefined typefaces available, is that correct?

Thanks,
Maurício

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


[NTG-context] Seeking a Deeper ConTeXt: Questions for Initializing

2009-05-24 Thread John Haltiwanger
Hello,

My name is John and I'm a nearly brand new TeX convert. All it took was one
letter I wanted to look nice and now I know I will never craft an important
document in another format again.

Now, an obvious entry point is LaTeX, and indeed my first TeX document used
this macro package. However, I couldn't help but stumble across the ConTeXt
project in my investigation of the TeX landscape. The seemingly distinct
separation of style from content, evidenced by the print versus the screen
versions of some of the manuals, instantly endeared me.

Within the same week, I found the comp.text.tex newsgroup. Lo and behold
there was a quite active thread on LuaTeX, which I had just finished reading
a presentation and a couple papers on the night before. On of the issues
being discussed was the lack of a LaTeX document class for thesis. This
also involved discussion of LaTeX's shortcomings.


I wrote into the thread that based on my (albeit completely theoretical)
understanding, ConTeXt would be a wiser choice as a macro for any new
department to begin requiring TeX documents. This was based on my vague
understanding of the separation of environment from the content, as it were,
and also on the multiple outputs available for the manuals. Since I see
screen formatting as equally important, if not more, than paper formatting,
it only made sense to me that the equivalent of a unversity specific
documentclass in LaTeX would be a simple environment file in ConTeXt.


This leads me to some questions I have about how great a fit for me ConTeXt
actually is.


1) Can environment files be used across documents, or is it generally
understood that every ConTeXt document requires its own environment
formatting? (The latter is the view of someone on c.t.t, who said his
perception of ConTeXt was that it was for typesetting individual documents
and had less application beyond that domain.)


2) What is the state of XML output for ConTeXt files? I have to say I will
find it hard to justify using TeX for documents if it means they are not
translatable to XML easily. I'm also interested in any RDF support ConTeXt
might have.


I am just beginning my journey into TeX, and wish to learn the best macro
package available. To me it seems like this is ConTeXt hands down, however
the two questions above will indeed determine ConTeXt's actual utility in my
case.


Regards,

John C. Haltiwanger


P.S. For my first question, it seems easy to assume that if you can process
XML files into standardized ConTeXt documents, the same would go for
processing ConTeXt into standardized ConTeXt documents. But the question is
too large not to ask.
___
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  : https://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] Previous chapter from new font chapter

2009-05-24 Thread Taco Hoekwater

Maurí­cio wrote:

Hi,

Right in the main wiki page I read the current 'fonts' chapter
pdf of the new revision of user's manual. It says at item 1.5.1:

 Remember how in the previous chapter there were the tables
 that listed all the predefined combinations?  It was said
 (...)

Where can I find such previous chapter? I understand it shows a
way to list all predefined typefaces available, is that correct?


That would be typography. They are in the wrong order on the
wiki page. And yes, it does have such a table.

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


Re: [NTG-context] Seeking a Deeper ConTeXt: Questions for Initializing

2009-05-24 Thread Henning Hraban Ramm

Am 2009-05-24 um 19:17 schrieb John Haltiwanger:

1) Can environment files be used across documents, or is it  
generally understood that every ConTeXt document requires its own  
environment formatting? (The latter is the view of someone on c.t.t,  
who said his perception of ConTeXt was that it was for typesetting  
individual documents and had less application beyond that domain.)


Normally you use environment files for coherent projects (magazines,  
books) or sets of similar documents (letters, presentations).


The difference in usage between a LaTeX document class and a ConTeXt  
environment is neglectable IMO. The real difference is that most LaTeX  
users just *use* some document class unchanged, because LaTeX doesn't  
encourage defining your own, while there are nearly no ready-to-use  
ConTeXt environments available and most ConTeXt users want write their  
own anyway.


For one-off documents I put everything in one file (and perhaps copy  
setup bits from other one-off files or environments).


If *I* require a special layout for a single document, I normally use  
InDesign. The effort of programming a setup or an environment pays  
off only if you use it more often IMO.



2) What is the state of XML output for ConTeXt files? I have to say  
I will find it hard to justify using TeX for documents if it means  
they are not translatable to XML easily. I'm also interested in any  
RDF support ConTeXt might have.


XML is no target format for any TeX implementation.
XML is a source format, and a good one if you want to process  
(typeset) it with ConTeXt (and perhaps make HTML from the same source).


What do you mean with RDF? This one?: http://www.w3.org/RDF/
Or did you mean RTF?

ConTeXt, like every flavour of TeX, is a text compiler to PDF (and  
DVI, if that's really important for you). Professional, printable,  
presentable output. No more, no less.



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


[NTG-context] hyphenation

2009-05-24 Thread Henning Hraban Ramm

Ahoi,
(1)
there's an ongoing thread on the German mailing list (TeX-D-L), if it  
would be possible to implement weighted(?) hyphenation, i.e. that some  
breaks are better than other, e.g.

Do-nau---dampf--schiff---fahrt
Wa-ren---wirt--schaft
Eu-ro-pa---par-la--ment
(In InDesign I can suggest such priorities if I add words to the user  
dictionary.)


(2)
Uses ConTeXt the same hyphenation algorithm as LaTeX? Or one of the  
newer projects? (perhaps SiSiSi?)


(3)
Further, I wonder why \hyphenation{} is case dependend - in my last  
project Secretary General was wrongly hyphenated, but  
\hyphenation{se-cre-ta-ry} didn't fix it, I needed \hyphenation{Se-cre- 
ta-ry}. Does that make sense?




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


[NTG-context] Funny setuphead[section] behaviour

2009-05-24 Thread Vyatcheslav Yatskovsky

Hello,

Funny enough, but when I provide after={\nowhitespace} in \setuphead 
[section] in the latest mkiv beta, it affects *subsection* instead. 
(That is, subsection's afterspace is eaten).


Full code:

\setuphead [section][
  number=yes, align=right, after={\nowhitespace}, 
style={\switchtobodyfont[arialblack]\bf}]


Bets,
Vyatcheslav

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