ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Issues using publications subsystem for non-bibliographic database
@ 2018-12-07  4:00 Rik Kabel
  2018-12-07 22:19 ` Rik Kabel
  0 siblings, 1 reply; 12+ messages in thread
From: Rik Kabel @ 2018-12-07  4:00 UTC (permalink / raw)
  To: mailing list for ConTeXt users


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

List,

I am trying to use the publications subsystem to support a 
non-bibliographic database, as chapter 10 of mkiv-publications suggests 
one can. My example is a database of quotations.

I have been partially successful, which is another way of saying there 
are some issues I have not been able to resolve.

First, what goes into a specification lua file (I think that is what the 
document suggests I need) that says my author field should be handled as 
a bibliographic author field? There is some processing: {Schopenhauer, 
Arthur} gets displayed as ArthurSchopenhauer (with no space). Specifying 
an authorconversion in \setupbtx has no effect, so it looks like I have 
to do something else.

Second, how can I link one entry to another. The example shows my 
almost-working attempt, adding a linking key (translation in the 
example) and recursively using it in processing. This fails, but when I 
use the literal equivalent, it works. (And the recursion does not seem 
to be the problem.) I know that this description is not clear, but the 
example should demonstrate the issue.

Finally, the document loses all data from the quotation database when 
\placebtxrendering for that database is omitted.

I apologize for the larger-than-usual example size.

    %{[(

    \startbuffer[quotesources]
    @book{Schopenhauer1862v2,
       title       = {Parerga und Paralipomena},
       subtitle    = {Kleine Philosophische Schriften},
       publisher   = {A. W. Hahn},
       year        = {1862},
       volume      = {2},
       volumes     = {2},
       author      = {Arthur Schopenhauer},
       editor      = {Julius Frauenstädt},
       address     = {Berlin},
       language    = {german},
    }
    @book{SchopenhauerPayne2000,
       title       = {Parerga and Paralipomena},
       subtitle    = {Short Philosophical Essays},
       publisher   = {Oxford University Press Clarendon Press},
       address     = {New York and Oxford},
       year        = {2000},
       author      = {Arthur Schopenhauer},
       volumes     = {2},
       origyear    = {1974},
       origlanguage= {german},
       translator  = {Eric F. J. Payne},
    }
    \stopbuffer

    \startbuffer[quotedatabase]
    @quote{qSchopA02,
       extract     = {Es wäre gut Bücher kaufen, wenn man die Zeit, sie zu
                      lesen, mitkaufen könnte, aber man verweschelt meistens
                      den Ankauf der Bücher mit dem Aneignen ihres Inhalts.},
       author      = {Schopenhauer, Arthur},
       born        = {1788},
       died        = {1860},
       work        = {\cite[title][sources::Schopenhauer1862v2]},
       year        = {1862},
       location    = {chapter\btxnbsp24},
       translation = {\cite[tag][qPayneE01]},
       attribnote  = {The selection was inserted posthumously into the work,
                      probably based on notes Schopenhauer left, by Julius
                      Frauenstädt, his literary executor, and has appeared
                      in different locations in various editions.},
    }
    @quote{qPayneE01,
       extract     = {Buying books would be a good thing if one could also
                      buy the time to read them in: but as a rule the
                      purchase of books is mistaken for the appropriation
                      of their contents.},
       author      = {Eric F. J. Payne},
       born        = {1895},
       died        = {1983},
       year        = {1974/2000},
       work        = {\cite[title][sources::SchopenhauerPayne2000]},
       page        = {559},
    }
    \stopbuffer

    \loadbtxdefinitionfile
       [apa]
    \usebtxdefinitions
       [apa]
    \usebtxdataset
       [sources]
       [quotesources.buffer]
    \definebtxrendering
       [sources]
       [apa]
       [group=bib,
        dataset=sources]
    \setupbtx
       [sources]
       [specification=apa,
        dataset=sources]

    \usebtxdataset
       [quotedb]
       [quotedatabase.buffer]
    \definebtxrendering
       [quotedb]
       [group=quotes,
        sorttype=cite,
        numbering=no,
        dataset=quotedb]
    \setupbtx
       [specification=quotedb,
        authorconversion=normalshort,
        dataset=quotedb]

    \startsetups btx:quotedb:cite:attribnote
        {\rm\btxfield{attribnote}}
    \stopsetups
    \startsetups btx:quotedb:cite:born
        {\rm\btxfield{born}}
    \stopsetups
    \startsetups btx:quotedb:cite:died
        {\rm\btxfield{died}}
    \stopsetups
    \startsetups btx:quotedb:cite:location
        {\rm\btxfield{location}}
    \stopsetups
    \startsetups btx:quotedb:cite:page
        {\rm\btxfield{page}}
    \stopsetups
    \startsetups btx:quotedb:cite:work
        {\rm\btxfield{work}}
    \stopsetups
    \startsetups btx:quotedb:cite:extract
        {\rm\btxfield{extract}}
    \stopsetups
    \startsetups btx:quotedb:cite:title
        {\rm\it\btxfield{title}}
    \stopsetups

    \startsetups btx:quotedb:list:quote
       \limitatetext{\btxfield{extract}}{\textwidth}{\unknown}
       \blank[none]
       -\btxspace\btxflush{author}
       \btxcomma\btxfield{year}
    \stopsetups

    \starttexdefinition Quotation #QUOTE
       \startnarrower
         \blank[halfline]
         \startparagraph
         \cite[extract][#QUOTE]
         \stopparagraph
         \startparagraph\noindentation
         \blank[halfline]
         \dontleavehmode\llap{– }\cite[author][#QUOTE]
           \btxspace \doifnotempty{\cite[born][#QUOTE]}
             {(\cite[born][#QUOTE]|–|\doiftext{\cite[died][#QUOTE]}
                                  {\cite[died][#QUOTE]})}
           \btxspace in \cite[work][#QUOTE]
           \doiftextelse{\cite[page][#QUOTE]}
             {\btxcomma p\btxperiod\btxnbsp\cite[page][#QUOTE]}
             {\doiftext{\cite[location][#QUOTE]}
                       {\btxcomma \cite[location][#QUOTE]}}
           \btxcomma \cite[year][#QUOTE]
           \btxperiod
           \cite[attribnote][#QUOTE]
           \doiftext{\cite[translation][#QUOTE]}
                    {\btxspace A translation is:}
         \stopparagraph
         \doiftext{\cite[translation][#QUOTE]}
           {\stopnarrower
    %%----------------------------------------------------------------------
    %%  When this form is used, the compilation fails.
    %
    %      \Quotation{\cite[translation][#QUOTE]}
    %
    %%  When this form is used, the compilation works, but of course, this
    %%  form is not what is wanted.
    %
            \Quotation{qPayneE01}
    %
    %%----------------------------------------------------------------------
            \startnarrower
           }
         \blank[3*halfline]
       \stopnarrower
    \stoptexdefinition

    \starttext

       \Quotation{qSchopA02}

    %%----------------------------------------------------------------------
    %%  When this form is used, the compilation fails as well, so it isn't
    %%  the recursion that is the problem.
    %
    % \Quotation{\cite[translation][qSchopA02]}
    %
    %%----------------------------------------------------------------------

       \hrule\blank

    %%----------------------------------------------------------------------
    %%  When \placebtxrendering for the quotation database is removed,
    %%  none of the text from the database is printed, even though the
    %%  dataset completeness shows the data
    %
       \placebtxrendering [quotedb][method=dataset]
    %
    %%----------------------------------------------------------------------

       \hrule\blank

       \placebtxrendering [sources][method=dataset]

       \page

       \showbtxdatasetcompleteness[dataset=quotedb]

       \page

       \showbtxdatasetcompleteness[dataset=sources,specification=apa]

    \stoptext
    %)]}

-- 

Rik



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

[-- Attachment #2: Type: text/plain, Size: 492 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] 12+ messages in thread

end of thread, other threads:[~2018-12-08 20:30 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-12-07  4:00 Issues using publications subsystem for non-bibliographic database Rik Kabel
2018-12-07 22:19 ` Rik Kabel
2018-12-07 23:01   ` Alan Braslau
2018-12-08  3:36     ` Rik Kabel
2018-12-08  3:51       ` Alan Braslau
2018-12-08  4:34         ` Rik Kabel
2018-12-08  5:03           ` Alan Braslau
2018-12-08 17:43             ` Rik Kabel
2018-12-08 19:50               ` Alan Braslau
2018-12-08 20:11                 ` Thomas A. Schmitz
2018-12-08 20:30                   ` Alan Braslau
2018-12-08 20:11                 ` Rik Kabel

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