ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* bibmodule (again)
@ 2009-05-13 21:48 Thomas A. Schmitz
  2009-05-14  8:08 ` Taco Hoekwater
  0 siblings, 1 reply; 4+ messages in thread
From: Thomas A. Schmitz @ 2009-05-13 21:48 UTC (permalink / raw)
  To: mailing ConTeXt users list for

Hi,

I don't want to sound like a whiner, but I was just wondering if  
there's any chance of having the bib module fixed. I have a paper to  
write within the next three weeks, and if bib doesn't work, I will  
have to use something else than ConTeXt. My problem is that numbered  
references do not produce any output. I attach a minimal example that  
gives the expected output in an older version of ConTeXt yet produces  
an empty citation in the most recent beta with the most recent bib  
module.

All best

Thomas

\usemodule[bib]

\setuppublications
             [refcommand=num,
              numbering=yes]

  \setuppublicationlayout[article]{%
     \insertartauthors{}{: }{\insertthekey{}{ }{}}%
     \insertarttitle{\quotation\bgroup}{,\egroup\ }{}%
     \insertjournal{\bgroup \it}{\egroup}{\insertcrossref{in }{}{}}%
     \insertvolume{ }{}{}%
     \insertpubyear{ (}{) }{\unskip.}%
     \insertpages{}{\insertnote{ [}{].}{.}}{.}%
     \insertcomment{[}{].}{}%
  }

\startpublication[k=belfiorepleasure,t=article,
a={{Belfiore}},y=1985,
n=126,s=Bel85]
\artauthor[]{Elizabeth}[E.]{}{Belfiore}
\pubyear{1985}
\arttitle{Pleasure, Tragedy and Aristotelian Psychology}
\journal{Classical Quarterly}
\volume{35}
\pages{349--61}
\stoppublication


\starttext

Citation: \cite[belfiorepleasure]

List:

\placepublications[criterium=all]

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

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


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: bibmodule (again)
  2009-05-13 21:48 bibmodule (again) Thomas A. Schmitz
@ 2009-05-14  8:08 ` Taco Hoekwater
  2009-05-14  8:44   ` Thomas A. Schmitz
  2009-05-14 12:38   ` Bruce D'Arcus
  0 siblings, 2 replies; 4+ messages in thread
From: Taco Hoekwater @ 2009-05-14  8:08 UTC (permalink / raw)
  To: mailing list for ConTeXt users


Hi,

I can't fix everything, but I believe I have made some progress.

The new structure and referencing code is totally different from
the old code and I understand less than half of it. What's worse:
I seem to be really bad at explaining to Hans all the things that
should happen wrt. references in the bib module.

Anyway:

Thomas A. Schmitz wrote:
> 
> \usemodule[bib]

At this point, please add these three (re)definitions:

%%%%%%%%%%%%%%%

\def\bibrefprefix{}

\def\preparebibreflist#1{\edef\bibreflist{#1}}

\def\docitation#1{%
  \iftrialtypesetting \else
    \ifdoinpututilities\else
      \doglobal\increment\citationnumber
      \expanded{\rawreference{}{cite-\jobname-\citationnumber}{#1}}%
  \fi \fi
  \expanded{\writedatatolist[pubs][bibref=#1]}}
%%%%%%%%%%%%%%%%%

If you turn cite compression off, it will now work (somewhat, at least).

With compression on, there is backward compatibility problem in mkiv
that I do not know how to deal with. Si here is the explanation and
then I hope Hans can make sense out of it.

In Thomas' example, in the first run the

  \placepublications[criterium=all]

creates a reference 'belfiorepleasure' with value '1', like so:

   \reference[belfiorepleasure]{1}

In the second run, the \cite[belfiorepleasure] uses this reference to
typeset the number '1' at that spot. Because the argument to \cite is
actually is a list of references, \cite (via \bibnumref) builds an
internal commalist of references to resolve.

If the citation compression is off, this is a direct list of refs,
and the citation essentially expands into

    \def\processitem#1{\in[#1]}
    \processcommalist[belfiorepleasure]\processitem

as said, that now works.

But if cite compression is on (which it is by default) the to be typeset
numbers need to be sorted, and this simple solution won't do. Instead,
the citation is expanded into something more like this:

    \def\therefs{}
    \def\processitem#1%
      {\doifreferencefoundelse{#1}
        {\addtocommalist{\reftypet}\therefs }
        {}}
    \processcommalist[belfiorepleasure]\processitem

This only works in mkii at the moment because in mkiv the \reftypet
expands to nothing. It is defined (in strc-ref.tex) as:

  \def\reftypet{\currenttextreference}

but it seems that the mkiv version of \doifreferencefoundelse does
not set up the \currentxxxreference macros any more. That is where
I got stuck, and I hope Hans can explain why that doesn't work, whether
it is intentional, and if it is indeed on purpose, what the correct
interface is to get at the 'text' field of a reference in mkiv.

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
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: bibmodule (again)
  2009-05-14  8:08 ` Taco Hoekwater
@ 2009-05-14  8:44   ` Thomas A. Schmitz
  2009-05-14 12:38   ` Bruce D'Arcus
  1 sibling, 0 replies; 4+ messages in thread
From: Thomas A. Schmitz @ 2009-05-14  8:44 UTC (permalink / raw)
  To: mailing list for ConTeXt users


On May 14, 2009, at 10:08 AM, Taco Hoekwater wrote:

>
> Hi,
>
> I can't fix everything, but I believe I have made some progress.

Hi Taco,

thanks a lot for looking into it! Your redefinitions make the minimal  
example work; I'll have to see how I can transfer them to my non- 
minimal files where I make extensive adaptations to the bib styles.

>
> The new structure and referencing code is totally different from
> the old code and I understand less than half of it. What's worse:
> I seem to be really bad at explaining to Hans all the things that
> should happen wrt. references in the bib module.
>
Wow, that's very encouraging for us mere mortals :-)

[lots of interesting information snipped]

>
> Best wishes,
> Taco

Thanks, and best wishes!

Thomas
___________________________________________________________________________________
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
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: bibmodule (again)
  2009-05-14  8:08 ` Taco Hoekwater
  2009-05-14  8:44   ` Thomas A. Schmitz
@ 2009-05-14 12:38   ` Bruce D'Arcus
  1 sibling, 0 replies; 4+ messages in thread
From: Bruce D'Arcus @ 2009-05-14 12:38 UTC (permalink / raw)
  To: ntg-context

Taco Hoekwater <taco <at> elvenkind.com> writes:

> The new structure and referencing code is totally different from
> the old code and I understand less than half of it. What's worse:
> I seem to be really bad at explaining to Hans all the things that
> should happen wrt. references in the bib module.

:-)

FWIW, Frank Bennett has completely written the Zotero Javascript CSL engine to
be faster and easier to maintain and extend. It's also now independently hosted
and developed.

<http://bitbucket.org/fbennett/citeproc-js>

Bruce

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


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2009-05-14 12:38 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-05-13 21:48 bibmodule (again) Thomas A. Schmitz
2009-05-14  8:08 ` Taco Hoekwater
2009-05-14  8:44   ` Thomas A. Schmitz
2009-05-14 12:38   ` Bruce D'Arcus

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).