* trying to fix page ranges in bibliography
@ 2011-01-29 23:58 Florian Wobbe
0 siblings, 0 replies; only message in thread
From: Florian Wobbe @ 2011-01-29 23:58 UTC (permalink / raw)
To: mailing list for ConTeXt users
Hi,
I'm trying to insert the macro \pagerange into the code from texmf-context/tex/context/base/bibl-tra.mkiv but I'm quite lost. The macro should make proper page ranges from the bibtex file entries (Pages = {...}). That means remove any whitespace before and after the hyphen and double a single hyphen:
7-9 -> 7--9
1 - 3a -> 1--3a
\def\pagerange#1%
{\directlua{
range = string.gsub("#1", "\%s*[-\%s]+", "--")
tex.sprint(range)}}
Thanks for suggestions,
Florian
___________________________________________________________________________________
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
___________________________________________________________________________________
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2011-01-29 23:58 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-01-29 23:58 trying to fix page ranges in bibliography Florian Wobbe
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).