ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* [NTG-context] BibTeX choking on comments in database
@ 2024-05-27 23:24 Kip Warner
  2024-05-28  6:05 ` [NTG-context] " Henning Hraban Ramm
  2024-05-28 23:00 ` Alan Braslau via ntg-context
  0 siblings, 2 replies; 9+ messages in thread
From: Kip Warner @ 2024-05-27 23:24 UTC (permalink / raw)
  To: mailing list for ConTeXt users


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

Hello list,

I am using BibTeX under ConTeXt to typeset a publication. I noticed
while building the publication ConTeXt raises the following non-fatal
warning:

   ...
   This is BibTeX, Version 0.99d (TeX Live 2023/Debian)
   The top-level auxiliary file: Secret_Sauce.aux
   The style file: cont-au.bst
   Database file #1: ./References.bib
   I was expecting a `{' or a `('---line 2 of file ./References.bib
    : 
    : % See the file Copying for details on copying conditions.
   (Error may have been on previous line)
   I'm skipping whatever remains of this entry
   (There was 1 error message)
   publications    > loading formatting style from 'bibl-apa'
   open source     > level 4, order 13, name
   '/usr/share/texmf/tex/context/bib/mkii/bibl-apa.tex'
   close source    > level 4, order 13, name
   '/usr/share/texmf/tex/context/bib/mkii/bibl-apa.tex'
   ...

All that's present on the first few lines of the References.bib BibTeX
database are comments that begin with the '%' character.

Is there a different character that should be used for BibTeX databases
when used with ConTeXt?

-- 
Kip Warner
OpenPGP signed/encrypted mail preferred
https://www.thevertigo.com

[-- Attachment #1.2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

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

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

maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki     : https://wiki.contextgarden.net
___________________________________________________________________________________

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

* [NTG-context] Re: BibTeX choking on comments in database
  2024-05-27 23:24 [NTG-context] BibTeX choking on comments in database Kip Warner
@ 2024-05-28  6:05 ` Henning Hraban Ramm
  2024-05-28 17:25   ` Kip Warner
  2024-05-28 23:00 ` Alan Braslau via ntg-context
  1 sibling, 1 reply; 9+ messages in thread
From: Henning Hraban Ramm @ 2024-05-28  6:05 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Am 28.05.24 um 01:24 schrieb Kip Warner:
> Hello list,
> 
> I am using BibTeX under ConTeXt to typeset a publication. I noticed
> while building the publication ConTeXt raises the following non-fatal
> warning:
> 
>     ...
>     This is BibTeX, Version 0.99d (TeX Live 2023/Debian)
>     The top-level auxiliary file: Secret_Sauce.aux
>     The style file: cont-au.bst
>     Database file #1: ./References.bib
>     I was expecting a `{' or a `('---line 2 of file ./References.bib
>      :
>      : % See the file Copying for details on copying conditions.
>     (Error may have been on previous line)
>     I'm skipping whatever remains of this entry
>     (There was 1 error message)
>     publications    > loading formatting style from 'bibl-apa'
>     open source     > level 4, order 13, name
>     '/usr/share/texmf/tex/context/bib/mkii/bibl-apa.tex'
>     close source    > level 4, order 13, name
>     '/usr/share/texmf/tex/context/bib/mkii/bibl-apa.tex'
>     ...
> 
> All that's present on the first few lines of the References.bib BibTeX
> database are comments that begin with the '%' character.
> 
> Is there a different character that should be used for BibTeX databases
> when used with ConTeXt?

According to the documentation, everything outside of entries is 
considered a comment. Inside of entries, there can’t be comments.

Hraban

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

maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki     : https://wiki.contextgarden.net
___________________________________________________________________________________

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

* [NTG-context] Re: BibTeX choking on comments in database
  2024-05-28  6:05 ` [NTG-context] " Henning Hraban Ramm
@ 2024-05-28 17:25   ` Kip Warner
  2024-05-28 22:45     ` Aditya Mahajan
  0 siblings, 1 reply; 9+ messages in thread
From: Kip Warner @ 2024-05-28 17:25 UTC (permalink / raw)
  To: mailing list for ConTeXt users


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

On Tue, 2024-05-28 at 08:05 +0200, Henning Hraban Ramm wrote:
> According to the documentation, everything outside of entries is 
> considered a comment. Inside of entries, there can’t be comments.

But in this case, is it not warning about text outside of an entry that
should be treated as a comment?

-- 
Kip Warner
OpenPGP signed/encrypted mail preferred
https://www.thevertigo.com

[-- Attachment #1.2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

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

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

maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki     : https://wiki.contextgarden.net
___________________________________________________________________________________

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

* [NTG-context] Re: BibTeX choking on comments in database
  2024-05-28 17:25   ` Kip Warner
@ 2024-05-28 22:45     ` Aditya Mahajan
  2024-05-29  4:51       ` Kip Warner
  0 siblings, 1 reply; 9+ messages in thread
From: Aditya Mahajan @ 2024-05-28 22:45 UTC (permalink / raw)
  To: mailing list for ConTeXt users

[-- Attachment #1: Type: text/plain, Size: 748 bytes --]

On Tue, 28 May 2024, Kip Warner wrote:

> On Tue, 2024-05-28 at 08:05 +0200, Henning Hraban Ramm wrote:
> > According to the documentation, everything outside of entries is 
> > considered a comment. Inside of entries, there can’t be comments.
> 
> But in this case, is it not warning about text outside of an entry that
> should be treated as a comment?

Hard to say without looking at the bib file, but % is not a comment character in bibtex. So, if your file starts with

% @article{key,
% title = {...},
% }

you will get an error from the bib parser.

If you want to comment out an entry, the simplest way is to remove the @. So,

article{key,
  title={...},
}

is a comment (since it is outside the entry). 

Aditya

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

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

maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki     : https://wiki.contextgarden.net
___________________________________________________________________________________

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

* [NTG-context] Re: BibTeX choking on comments in database
  2024-05-27 23:24 [NTG-context] BibTeX choking on comments in database Kip Warner
  2024-05-28  6:05 ` [NTG-context] " Henning Hraban Ramm
@ 2024-05-28 23:00 ` Alan Braslau via ntg-context
  2024-05-29  4:54   ` Kip Warner
  1 sibling, 1 reply; 9+ messages in thread
From: Alan Braslau via ntg-context @ 2024-05-28 23:00 UTC (permalink / raw)
  To: Kip Warner; +Cc: mailing list for ConTeXt users, Alan Braslau

On Mon, 27 May 2024 16:24:49 -0700
Kip Warner <kip@thevertigo.com> wrote:

> I am using BibTeX under ConTeXt to typeset a publication.

The Context publications reference subsystem reads BibTeX databases but
does not use BibTeX at all. I am not sure what your quoted statement
means exactly.

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

maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki     : https://wiki.contextgarden.net
___________________________________________________________________________________

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

* [NTG-context] Re: BibTeX choking on comments in database
  2024-05-28 22:45     ` Aditya Mahajan
@ 2024-05-29  4:51       ` Kip Warner
  0 siblings, 0 replies; 9+ messages in thread
From: Kip Warner @ 2024-05-29  4:51 UTC (permalink / raw)
  To: mailing list for ConTeXt users


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

On Wed, 2024-05-29 at 00:45 +0200, Aditya Mahajan wrote:
> Hard to say without looking at the bib file, but % is not a comment
> character in bibtex. So, if your file starts with

The first few lines of the file is just a copyright notice, with each
line beginning with %. If that's not an appropriate comment character,
is there any way to put comments in a BibTeX file?

-- 
Kip Warner
OpenPGP signed/encrypted mail preferred
https://www.thevertigo.com

[-- Attachment #1.2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

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

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

maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki     : https://wiki.contextgarden.net
___________________________________________________________________________________

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

* [NTG-context] Re: BibTeX choking on comments in database
  2024-05-28 23:00 ` Alan Braslau via ntg-context
@ 2024-05-29  4:54   ` Kip Warner
  2024-05-29 12:49     ` Alan Braslau via ntg-context
  0 siblings, 1 reply; 9+ messages in thread
From: Kip Warner @ 2024-05-29  4:54 UTC (permalink / raw)
  To: mailing list for ConTeXt users


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

On Tue, 2024-05-28 at 17:00 -0600, Alan Braslau wrote:
> The Context publications reference subsystem reads BibTeX databases
> but does not use BibTeX at all. I am not sure what your quoted
> statement means exactly.

I see. The first few lines of my BibTeX file just contains a copyright
notice that is commented out with the % character. If that is not a
valid comment character, is there no way to write a comment in the
file?

-- 
Kip Warner
OpenPGP signed/encrypted mail preferred
https://www.thevertigo.com

[-- Attachment #1.2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

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

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

maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki     : https://wiki.contextgarden.net
___________________________________________________________________________________

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

* [NTG-context] Re: BibTeX choking on comments in database
  2024-05-29  4:54   ` Kip Warner
@ 2024-05-29 12:49     ` Alan Braslau via ntg-context
  2024-05-29 23:08       ` Kip Warner
  0 siblings, 1 reply; 9+ messages in thread
From: Alan Braslau via ntg-context @ 2024-05-29 12:49 UTC (permalink / raw)
  To: Kip Warner; +Cc: mailing list for ConTeXt users, Alan Braslau

On Tue, 28 May 2024 21:54:08 -0700
Kip Warner <kip@thevertigo.com> wrote:

> On Tue, 2024-05-28 at 17:00 -0600, Alan Braslau wrote:
> > The Context publications reference subsystem reads BibTeX databases
> > but does not use BibTeX at all. I am not sure what your quoted
> > statement means exactly.  
> 
> I see. The first few lines of my BibTeX file just contains a copyright
> notice that is commented out with the % character. If that is not a
> valid comment character, is there no way to write a comment in the
> file?
> 

1) You appear to be using the long-frozen mkii bibliography code.
2) As Aditya wrote, anything outside of a valid entry is ignored.

@comment{
}

is a good construction.

-- 
Alan Braslau
816 West Mountain Avenue
Fort Collins, CO 80521 USA
mobile: (970) 237-0957

Conserve energy! ;-)
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki     : https://wiki.contextgarden.net
___________________________________________________________________________________

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

* [NTG-context] Re: BibTeX choking on comments in database
  2024-05-29 12:49     ` Alan Braslau via ntg-context
@ 2024-05-29 23:08       ` Kip Warner
  0 siblings, 0 replies; 9+ messages in thread
From: Kip Warner @ 2024-05-29 23:08 UTC (permalink / raw)
  To: Alan Braslau; +Cc: mailing list for ConTeXt users


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

On Wed, 2024-05-29 at 06:49 -0600, Alan Braslau wrote:
> 1) You appear to be using the long-frozen mkii bibliography code.

I think you are right! I just realized that. I'm using in my
Environment file...

   % \BIBTEX macro...
   \usemodule[abr-02]
   
   % Setup bibliography...
   
       % References database and other general settings...
       \setupbibtex[database={./References}, sort=author]
   
       % Global settings...
       \setuppublications[
           alternative=apa,
           numbering=yes,
           monthconversion=month,
           autohang=yes,
           sorttype=cite]
   
       % Without this, no hyperlinks at all in the output...
       \setupinteraction[state=start]
   
       % This two-part helper creates a hyperlink for url fields...
       \unprotect
           \def\bibgotoURL#1#2%
            {\useURL[#1][#2][][#1]\from[#1]}
           \def\bibinsertbiburl#1#2#3%
            {\bibdoifelse{\@@pb@biburl}
              {#1\expanded{\bibgotoURL{\@@pb@title}{\@@pb@biburl}}#2}{#3}}
       \protect
   
       % Book reference layout...
       \setuppublicationlayout[book]{%
            \insertauthors{}{. }{\insertthekey{}{. }{}}%
            \inserttitle{\bgroup\it }{.\egroup\space }{}%
            \insertpubname{}{. }{}%
            \insertday{}{ }{}%
            \insertmonth{\Word }{. }{}%
            \insertpubyear{}{. }{}%
            \insertnote{}{.}{}%
           }
   
       % Adjusted version of 'misc' typesetting, using \insertbiburl
       % instead of \inserttitle (and \insertbiburl runs the
       % \bibinsertbiburl macro defined above)
       \setuppublicationlayout[misc]{%
        \insertauthors{}{. }{\insertthekey{}{. }{}}%
        \insertbiburl{\bgroup\it }{.\egroup\space }{}%
        \insertpubname{}{. }{}%
        \insertday{}{ }{}%
        \insertmonth{\Word }{. }{}%
        \insertpubyear{}{. }{}%
        \insertnote{}{.}{}%
       }
   
       % finally, this is a horrible hack needed due to bibtex inserting
       % line breaks in the middle of urls in the output bbl (!)
       % If you find this hack too ugly, consider editing the .bbl by
       % hand and forgetting about the .bib file altogether...
       \let\mydodostartpublication\dodostartpublication
       \def\dodostartpublication{\catcode`\%=14 \mydodostartpublication}
   
       % Macro to put the citations as footnotes...
       \unexpanded\def\footnotecite{\dodoubleempty\domycite}
       \def\domycite[#1][#2]%
           {\ifsecondargument
               \footnote{\cite[alternative=data,#1][#2]}%
           \else
               \footnote{\cite[data][#1]}%
           \fi}
   
       % Individial citation settings...
   
           % Enable clickable links...
           \setupcite[alternative=interaction=start, compress=no]
   
       % Publication list setups for end of the book list...
   
           % Settings for triggering et al...
           \setuppublicationlist[authoretallimit=3]
           \setuppublicationlist[authoretaltext={\it\ et al.}]
           \setuppublicationlist[authoretaldisplay=2]
   
           % List the author, editor, or article author's full name, inverted...
           \setuppublicationlist[%
               author=\invertedauthor,%
               artauthor=\invertedauthor,%
               editor=\invertedauthor,%
               title=References]
   
   % Setup footnotes...
   
       \setupnotation[footnote]
           [color=colour_footnote_text,
            backgroundcolor=colour_footnote_background,
            width=0.3cm, % Space between footnote number and footnote itself
            numbercommand=] % Remove elevated footnote notation at bottom of page
   
       \setupnote[footnote]
           [textseparator={\textcomma}, % Comma delineated
            before={\crlf\crlf}] %
   
       \setupfootnotes
         [rule=on, % Disable horizontal rule
          textstyle={\hskip.03em}] % Vertical space between footnotes and the text
   
   % To move footnotes inside of text boxes to the bottom of the page with
   %  the rest of the footnotes. Disabled temporarily to fix issue of text
   %  background frame borders vanishing...
   \kindofpagetextareas\plusone

Whenever I wanted to use a citation I'd just write
\footnotecite[something]. But I see now there is this page that
describes a different process for using BibTeX:

   https://wiki.contextgarden.net/Bibliography

I will take a look today and try to incorporate the new best practice
for using the database and its citations. If you have any suggestions I
will try and incorporate them.

-- 
Kip Warner
OpenPGP signed/encrypted mail preferred
https://www.thevertigo.com

[-- Attachment #1.2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

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

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

maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki     : https://wiki.contextgarden.net
___________________________________________________________________________________

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

end of thread, other threads:[~2024-05-29 23:11 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-05-27 23:24 [NTG-context] BibTeX choking on comments in database Kip Warner
2024-05-28  6:05 ` [NTG-context] " Henning Hraban Ramm
2024-05-28 17:25   ` Kip Warner
2024-05-28 22:45     ` Aditya Mahajan
2024-05-29  4:51       ` Kip Warner
2024-05-28 23:00 ` Alan Braslau via ntg-context
2024-05-29  4:54   ` Kip Warner
2024-05-29 12:49     ` Alan Braslau via ntg-context
2024-05-29 23:08       ` Kip Warner

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