ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Implementing a custom authorconversion for bibliographies
@ 2021-09-04  2:48 Joey McCollum via ntg-context
  2021-09-15  3:06 ` Joey McCollum via ntg-context
  0 siblings, 1 reply; 6+ messages in thread
From: Joey McCollum via ntg-context @ 2021-09-04  2:48 UTC (permalink / raw)
  To: mailing list for ConTeXt users; +Cc: Joey McCollum


[-- Attachment #1.1: Type: text/plain, Size: 2100 bytes --]

Hi,

I mentioned this in an earlier e-mail but thought that now might be a good
time to describe this issue in detail. I'd like to define a new
authorconversion that renders the first author in a list differently than
the remaining authors in the list. Specifically, I'd like to use the
"inverted" authorconversion for the first author and the "normal"
authorconversion for the rest.

In the newer bibl-bib.lua file, I can see what I might have to modify to
accomplish this (I added the  if combiner == "invertedfirst"  block):

```
function authors.concat(author,combiner,what,settings)
    if type(combiner) == "string" then
        combiner = authors[combiner or "normal"] or authors.normal
    end
    local split = splitauthors(author)
    local setting = settings[what]
    local etallimit, etaldisplay, etaltext = 1000, 1000, ""
    if setting then
        etallimit   = settings.etallimit   or 1000
        etaldisplay = settings.etaldisplay or etallimit
        etalltext   = settings.etaltext    or ""
    end
    local max = #split
    if max > etallimit and etaldisplay < max then
        max = etaldisplay
    end
    if combiner == "invertedfirst" then
        for i=1,max do
            if i == 1 then
                split[i] = authors.inverted(split[i],settings)
            else
                split[i] = authors.normal(split[i],settings)
            end

        end
    else
        for i=1,max do
            split[i] = combiner(split[i],settings)
        end
    end
    local result = bibtexconcat(split,settings)
    if max < #split then
        return result
    else
        return result .. etaltext
    end
end
```

Unfortunately, this doesn't seem to do anything. It's not clear to me
how bibl-bib.lua and bibl-bib.mkiv are being used by the other publication
support modules, if they're being used at all (publ-ini.mkiv doesn't appear
to register it, anyway). Is there another file I'd have to change to make
"invertedfirst" a working authorconversion? Is there a similar block of
code in publ-ini.lua where I should be implementing this change instead?

Thanks!

Joey

[-- Attachment #1.2: Type: text/html, Size: 2621 bytes --]

[-- Attachment #2: Type: text/plain, Size: 493 bytes --]

___________________________________________________________________________________
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

end of thread, other threads:[~2021-09-15 18:56 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-04  2:48 Implementing a custom authorconversion for bibliographies Joey McCollum via ntg-context
2021-09-15  3:06 ` Joey McCollum via ntg-context
2021-09-15  8:18   ` Hans Hagen via ntg-context
2021-09-15 14:13     ` Joey McCollum via ntg-context
2021-09-15 17:01       ` Joey McCollum via ntg-context
2021-09-15 18:56         ` Hans Hagen via ntg-context

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